SSDT: Creation of localDB instances from project file - Sql Server Unit testing purposes
I have a SqlServer Database Project in my solution (VS2013 Professional) which has a corresponding test project with some stored procedure unit tests. Currently I am using a LocalDB and as far as I understand a local database instance is created in C:\Users\[User]\AppData\Local\Microsoft\Microsoft
SQL Server Local DB\Instances\Projects and the specific .mdf file referenced in the SQL Server Object Explorer is in C:\Users\[User]\AppData\Local\Microsoft\VisualStudio\SSDT\[ProjectName]. The unit tests run fine on my local machine which I have developed
the project on.
My issue is we have a box which is configured to check out the project file from our version control, build the project using ms build commands and then run the unit tests using VSTest.Console. Usually with C# Test projects we reference the test project
dll and the unit tests run fine. I have referenced the dll for the test project with the stored procedure unit tests in.
With the Stored Procedure unit tests however we get this exception:
Initialization method [project].[spTest].TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.
After some digging I have realised that the localdb instance seems to be created when the project itself is created in VS not when it is built. Specifically when the localdb is first used and if you look into the appData folder of the test machine there
is no corresponding mdf file for the project.
The question is is there a way to set up a localDB instance on the new machine if all you have the project file? The only purpose of the project on the test machine is to run the unit tests, no other development purposes. VS2013 Professional is installed
on the test machine but a solution only using config file changes or MSBuild/VSTest commands would be preferable.
I realise you could change the connection string to an actual test database and run the unit tests of that but we quite like the localdb approach for the testing. I also realise that you could potentially transfer the mdf file (haven't tested this solution)
as well, though I would prefer if there is a solution to my initial question.
http://technet.microsoft.com/en-us/library/hh234692.aspx
http://msdn.microsoft.com/en-us/library/hh309441(v=vs.110).aspx
I have been reading up on LocalDB and I assume a automatic LocalDB is created when you create a sql server database project (ie on localdb first use). I have tried adding the database creation to the test project config file but do not really know where
to go from there. The second link does not really specify when the named localdb will be created if you add the config items and I am not even sure if that is an actual solution. Here's my test project config file for reference
<configSections>
<section name="system.data.localdb" type="System.Data.LocalDBConfigurationSection,System.Data,Version=4.0.0.0,Culture=neutral,PublicKeyToken=[PublicKeyToken]"/>
<section name="SqlUnitTesting_VS2013" type="Microsoft.Data.Tools.Schema.Sql.UnitTesting.Configuration.SqlUnitTestingSection, Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=12.0.0.0, Culture=neutral, PublicKeyToken=[PublicKeyToken]" />
</configSections>
<system.data.localdb>
<localdbinstances>
<add name="SimpleUnitTestingDB" version="11.0" />
</localdbinstances>
</system.data.localdb>
<SqlUnitTesting_VS2013>
<DatabaseDeployment DatabaseProjectFileName="..\..\..\SimpleUnitTestDB\SimpleUnitTestDB.sqlproj"
Configuration="Release" />
<DataGeneration ClearDatabase="true" />
<ExecutionContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
CommandTimeout="30" />
<PrivilegedContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
CommandTimeout="30" />
</SqlUnitTesting_VS2013>
Thanks in advance for any response. Sorry if there is any misunderstanding, while I have been using VS to develop from the start, this is the first time I have used a Sql Server Database Project.
Regards,
Christopher.
Yes, you can create a LocalDB instance manually. You use the SqlLocalDb utility, see here:
http://technet.microsoft.com/en-us/library/hh212961.aspx
Erland Sommarskog, SQL Server MVP, [email protected]
Similar Messages
-
Using SQLCMD variables in SQL Server Unit Test Project
Is it possible to use SQLCMD variables in my SQL Server Unit Test Project? In my test initialize script I'd like to set a database name variable, something like this:
:SETVAR MyDatabase "mydatabase"
SELECT * FROM [$(MyDatabase)].[mytable]
but I get syntax errors when I run the test. Any suggestions how I can get this to work.
Result Message: Initialization method
myTest.TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException:
Incorrect syntax near ':'..Hi Kevin,
What is the error?
This should work only thing i could see is no scheme specified.
SQL Server uses dbo as default schema.
In your case:
:SETVAR MyDatabase "mydatabase"
SELECT * FROM [$(MyDatabase)].dbo.[mytable]
Also check your instance collation if its Case sensitive then specify database and table name as exact case.
Example:
:SETVAR MyDatabase "[mydatabase]"
:setvar schemavar "[dbo]"
:setvar tablevar "[mytable]"
SELECT * FROM $(MyDatabase).$(schemavar).$(tablevar) -
Creation of database link from oracle to sql server 2000
Hi
I need to create a database link from oracle to sql server 2000.Assuming your Oracle database is running on Windows, you can set up a database link using ODBC using Heterogeneous Services and Generic Connectivity, but there are some functional limitations (i.e. no two-phase commits). If you can live with those limitations but aren't on Windows, you can generally purchase an ODBC driver for your operating system that will connect to SQL Server through someone like DataDirect and still use Generic Connectivity. If you cannot live with those limitations, you can purchase one of Oracle's Transparent Gateway products (though this can get somewhat pricey).
What version of Oracle are you on?
What operating system(s) are you using?
What are you going to use the database link for?
Justin -
How to recover from mdf file (SQL Server 2000)
Hi,
My database corrupted because when I was running an update query, there is a power failure. After the computer booted, I cannot open the database anymore, it just not responding. Then I stop the sql server service, and tried to rename the .mdf and .ldf. After that it worked normally, but I need the data from the corrupted mdf file, I tried to attach the database but it just hanged. I even tried to attach without the .ldf file but it didn't work either, so I concluded that the problem is with the mdf file.
Is there any way to recover my data ??
Thanks in advance
Regards,
EdwinTry this undocumented stuff provided by Kevin [MS].
==========
1. Back up the .mdf/.ndf files at first!!!
2. Change the database context to Master and allow updates to system tables:
Use Master
Go
sp_configure 'allow updates', 1
reconfigure with override
Go
3. Set the database in Emergency (bypass recovery) mode:
select * from sysdatabases where name = '<db_name>'
-- note the value of the status column for later use in # 6
begin tran
update sysdatabases set status = 32768 where name = '<db_name>'
-- Verify one row is updated before committing
commit tran
4. Stop and restart SQL server.
5. Call DBCC REBUILD_LOG command to rebuild a "blank" log file based on the
suspected db.
The syntax for DBCC REBUILD_LOG is as follows:
DBCC rebuild_log('<db_name>','<log_filename>')
where <db_name> is the name of the database and <log_filename> is
the physical path to the new log file, not a logical file name. If you
do not
specify the full path, the new log is created in the Windows NT system
root
directory (by default, this is the Winnt\System32 directory).
6. Set the database in single-user mode and run DBCC CHECKDB to validate
physical consistency:
sp_dboption '<db_name>', 'single user', 'true'
DBCC checkdb('<db_name>')
Go
begin tran
update sysdatabases set status = <prior value> where name = '<db_name>'
-- verify one row is updated before committing
commit tran
Go
7. Turn off the updates to system tables by using:
sp_configure 'allow updates', 0
reconfigure with override
Go
============ -
Connecting from Oracle to SQL Server
Hi
I am now tring to connect from oracle to sql server using database link.
Created database link
but when connecting to remote db getting the floowing error
select * from region@mysqlserverdsn
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from MYSQLSERVERDSN
Can anyone help
My Listener File
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc1)
(SID_DESC =
(GLOBAL_DBNAME = ORCL.DOMAIN.COM)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(SID_NAME = orcl)
(SID_DESC =
(GLOBAL_DBNAME = NORTHWIND.DOMAIN.COM)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(SID_NAME = MYSQLSERVERDSN)
(PROGRAM=hsodbc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = SALIHKM.DOMAIN.COM)(PORT = 1522))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
My Tnsnames Entry
MYSQLSERVERDSN =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xxx.xxx)(PORT=1522))
(CONNECT_DATA=(SID=MYSQLSERVERDSN))
(HS=OK)
Lsnrctl is working fine.
c:\>lsnrctl start
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 18-MAY-2006 18:53
:13
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting tnslsnr: please wait...
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
System parameter file is D:\oracle\product\10.2.0\db_1\network\admin\listener.or
a
Log messages written to D:\oracle\product\10.2.0\db_1\network\log\listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=SALIHKM.DOMAIN.COM)(POR
T=1522)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROCipc)
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SALIHKM.DOMAIN.COM)(POR
T=1522)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
ction
Start Date 18-MAY-2006 18:53:16
Uptime 0 days 0 hr. 0 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File D:\oracle\product\10.2.0\db_1\network\admin\listener.o
ra
Listener Log File D:\oracle\product\10.2.0\db_1\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=SALIHKM.DOMAIN.COM)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROCipc)))
Services Summary...
Service "NORTHWIND.DOMAIN.COM" has 1 instance(s).
Instance "MYSQLSERVERDSN", status UNKNOWN, has 1 handler(s) for this service..
Service "ORCL.DOMAIN.COM" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
But Tnsping show no listener
C:\>tnsping MYSQLSERVERDSN
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 18-MAY-2
006 18:56:27
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xxx.xxx)(P
ORT=1522)) (CONNECT_DATA=(SID=MYSQLSERVERDSN)) (HS=OK))
TNS-12541: TNS:no listener
Services
C:\>lsnrctl services
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 18-MAY-2006 19:00
:04
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SALIHKM.DOMAIN.COM)(POR
T=1522)))
Services Summary...
Service "NORTHWIND.DOMAIN.COM" has 1 instance(s).
Instance "MYSQLSERVERDSN", status UNKNOWN, has 1 handler(s) for this service..
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "ORCL.DOMAIN.COM" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:ready
LOCAL SERVER
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1002 state:ready
DISPATCHER <machine: SALIHKM, pid: 2080>
(ADDRESS=(PROTOCOL=tcp)(HOST=SALIHKM.DOMAIN.COM)(PORT=1070))
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:ready
LOCAL SERVER
The command completed successfully
I am very much confused with this situation.
Thanks & Regards
Salih KmHi ,
Thanks for your reply.
Contents of my initMYSQLSERVERDSN.ora file is
# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.
# HS init parameters
HS_FDS_CONNECT_INFO = MYSQLSERVERDSN
HS_FDS_TRACE_LEVEL = 0
HS_FDS_TRACE_FILE_NAME = hsmsql.trc
# Environment variables required for the non-Oracle system
#set <envvar>=<value>
set ODBCINI=c:\WINDOWS\ODBC.INI
SALIHKM.DOMAIN.COM is my system in which Oracle Test DB is Installed.
SQL Server is in another location.
In Tnsnames i specified ip address.
One more doubt.
I am using 10g Release 2 demo version.
whether it will support Hetrogeneous Services?
How to know whether a database supports HS or not?
Thanks & Regards
Salih Km -
Oracle 10gR2 64bit odbc from oracle to sql server Win 2008 EE 64bits
Hi, I am having trouble with a 10gR2 64bits creation of odbc from oracle to sql server, I have follow several instruction with no luck at all. My OS is windows 2008 EE 64bits on the oracle and sql server server.
This is what I have done
1. in the $oracle_home/hs/admin directory
inithsodbc.ora
# HS init parameters
HS_FDS_CONNECT_INFO = hsodbc
HS_FDS_TRACE_LEVEL = off
2. in the $oracle_home/network/admin
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
(SID_DESC=
(SID_NAME=hsodbc)
(ORACLE_HOME=C:\oracle\product\10.2.0\db_1)
(PROGRAM=C:\oracle\product\10.2.0\db_1\hs\hsodbc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
And the tnsname.ora
# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
PRUEBA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = prueba)
hsodbc =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=xx.xx.xx.xx)(PORT=1521))
(CONNECT_DATA=(SID=hsodbc))
(HS=OK)
I create the odbc connection an test it , the result is TEST PASSED
4. The i create a database link on my database
CREATE PUBLIC DATABASE LINK XYZ
CONNECT TO "sysdba" IDENTIFIED BY "masterkey"
USING 'hsodbc';
5 execute a select
SQL> select * from dual@XYZ;
select * from dual@XYZ
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from XYZ
6. When I check the listener log i'm getting this error
25-MAR-2011 11:48:40 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169870592)) * status * 0
25-MAR-2011 11:48:47 * (CONNECT_DATA=(SID=hsodbc)(CID=(PROGRAM=)(HOST=PRO)(USER=PRO\Administrator))) * (ADDRESS=(PROTOCOL=tcp)(HOST=xx.xx.xx.xx)(PORT=49329)) * establish * hsodbc * 12518
TNS-12518: TNS:listener could not hand off client connection
TNS-12560: TNS:protocol adapter error
TNS-00530: Protocol adapter error
Edited by: user626125 on Mar 26, 2011 11:39 AM
Edited by: user626125 on Apr 12, 2011 2:49 PMHeterogeneous Connectivity
-
Oracle DB Link from Oracle to SQL Server
Dear buddies,
I am trying to create a dblink from Oracle to SQL Server.
This is my tnsnames.ora
sq =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=LOCALHOST)(PORT=1521)
(CONNECT_DATA=(SID=sq))
(HS=OK)
)This is my listener
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = sq)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_2)
(PROGRAM = hsodbc)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)initsq.ora
# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.
# HS init parameters
HS_FDS_CONNECT_INFO = sq
HS_FDS_TRACE_LEVEL = OFF
# Environment variables required for the non-Oracle system
#set <envvar>=<value>I have created my System DSN for sq with the appropriate values which works fine when I tested the connection.
These 2 databases are in different servers.
This is how I created the db link in Oracle
create public database link sq
CONNECT TO XXX IDENTIFIED BY "XXX"
using 'sq'
select "Column1"
from "Table1"@'sq';The error I receive is: ORA-01729: database link name expected
When I try to recreate the database link it tells me that: ORA-02011: duplicate database link name
I hope someone could guide me.
Thanks.C:\Documents and Settings\Administrator>tnsping sq
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 16-AUG-2011 14:48:40
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files:
D:\oracle\product\10.2.0\db_2\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name
C:\Documents and Settings\Administrator> -
RH server 8 - upscaling from Access to SQL Server 2008?
Hi gang-
We are currently running RoboHelp Server 8 on the default Access database and Tomcat. We would like to increase the number of help projects that are tracked by the RH Server, and have concerns that Access will handle the increased load, so we are considering upsizing to SQL Server 2008.
Our IT people think this should be fairly straightforward, but want to know if Adobe provides any tool or has any recommendations when upsizing from Access to SQL Server.They are concerned about retaining things like primary and secondary keys, as well as any indexes that are currently in Access.
If anyone has experience with such a migration, please share!
Thanks,
-=Ed.We are also currently on an Access DB and considering (have been for some time but that's a different story) upgrading to SQL Server. There is no migration tool from Access to SQL Server provided so you'd have to allow some additional effort if you want to retain the data. I am not an expert on DBs but I'm sure there are ways to migrate the data. I have found a few links when searching on Google. For example:
http://support.microsoft.com/kb/237980
Adobe does provide a cheat sheet at the link below which may be useful to you.
http://blogs.adobe.com/techcomm/2009/05/advanced_database_setup_for_robohelp_server_8.html
The RoboColum(n)
@robocolumn
Colum McAndrew -
Any way of importing from Access to SQL Server?
I have a huge store of information in Access. But now I'm required to use SQL Server.
Is there any way of importing the information from Access to SQL Server by Java programming?
Or is there a manual way of doing that?
Thank you in advance.I need to use Java because this is for a client. I
can't expect the client to follow those steps. As a
result, I want to create something simple for the
client to convert from Access to SQL Server.
Any other way of doing that?
That argument does not make sense.
There is no way that a 'client' is going to be able to manage MS SQL Server without understanding how it works. MS SQL Server is a complex database and requires at least some dedicated support, even if it is only part time.
For example consider the following:
-MS Access does not have a log file. MS SQL Server does. How is the log file going to be sized?
-If the log file fills up (like for a run away query) MS SQL Server comes to a screeching halt. How is that problem going to be fixed?
Now maybe you are going to provide that support, which means you can run those scripts. Or the client is going to support it in which case they need to have someone who understands it - and they will need to know how to run those scripts (since it is rather basic knowledge.) -
How ignore Change_tracking in build script deployment in Project Database SQL Server VS2013
Hello,
I have a "Project Database SQL Server" in SSDT VS2013 and my scenario is as follows:
My project database has not enabled the feature of [CHANGE_TRACKING].
I have N production databases, and there are a few in particular that are characteristic of [CHANGE_TRACKING]
enabled.
When I publish the project database against a target
base has not enabled the feature of [CHANGE_TRACKING] no problem, everything works as expected.
The problem is when I publish
the project database against a database that has ENABLED feature tracking changes.
I want the VS to make the comparison
of schemes in the publication, ignore this feature, and NOT generate deployment scripts with instructions like:
'Alter table dbo.table DISABLE CHANGE_TRACKING'
'Alter database name SET CHANGE_TRACKING = OFF'
It is possible to somehow customize the build-deployment to avoid this outcome?
I hope the collaboration of you lot.
Thank you very much.
EstyfenHi, thanks by response.
The configuration "Do not
alter Change Data Capture objects"
is on, but even so, I do not get
the expected results. When I run the generated
script publication makes me a "Disable
CHANGE_TRACKING" tables that have
activated the "track changes"
in the destination database.
Stay tuned for
your help ..
thank you very much
Estyfen -
Creating Database Link from Oracle to SQL Server
I am trying to create a database link from Oracle to SQL Server, and the documentation is about as clear as mud to me. Can anyone send me clear instructions on exactly what I need to do? What needs to be in tnsnames.ora and listener.ora files? Is there anything other than those two files that needs to be set up? Do I set up an ODBC connection? Anything else? I want to execute queries against a SQL Server database and load data into Oracle database.
Thanks so much,
SusanThese are the instructions from an old document I created. The steps are same for SQL Server and Sybase. Hope it helps.
The 9i Transparent Gateway Software is in Oracle Software CD -> oracle9i database -> Custom -> Oracle Transparent Gateways
The gateway can be installed on the same machine as the Oracle database or
on the Sybase server or on a third machine as a stand-alone.
We have installed the gateway software in one of oracle database
servers in a separate oracle home.
These are the steps involved in configuring a gateway to a Sybase database
1. Install Sybase client and Gateway software on the Gateway Server
2. Configure <initsidfile> in the Gateway Server's <gatewayhome>
/u00/app/oracle/product/9.2.0/tg4sybs/admin/init<gatewaysid>.ora
Sybase server and database information is required for this step.
eg: HS_FDS_CONNECT_INFO=USTRUD01.uwd
3. Add an entry in listener.ora in <listnenerhome>
(/u00/app/oracle/product/9.0.1/network/admin/listener.ora) for the <gatewaysid>
4. Edit the tnsnames file (/u00/app/oracle/product/9.0.1/network/admin/tnsnames.ora)
to add an entry <tnsalias> for the <gatewaysid>
5. Create a database link to the Sybase database in the oracle database.
The steps for creating the database link are
a. create a login oracle_tgw in the sybase server
b. add the user to the sybase database with the necessary privilege on the tables
c. create the database link in the required oracle database using the command
"create public database link <dblinkname> connect to oracle_tgw identified by password using 'tnsalias'; "
6. Restart the gateway listener. -
Import data from postgreSQL into SQL server 2005
I am trying to import one table from postgreSQL to SQL Server 2005 using sql server import and export wizard. When i test the connection after providing data source, location, username, password in the Data Link Properties section I get the message "Test Connection Succeeded". As soon as i press next to go onto next step i get the following error.
TITLE: SQL Server Import and Export Wizard
Cannot get string literals from the database connection "Provider=PostgreSQL.1;User ID=sa;Data Source=localhost;Location=TestMasterMap;Extended Properties=".
ADDITIONAL INFORMATION:
Object reference not set to an instance of an object. (DTSWizard)
BUTTONS:
OK
I have tried all sorts of different combinations for these properties but it always fails on this step. Can anybody help me with this?
The settings above worked for a small table with 3 rows. Now when I try to import the bigger table which I wanted to import in the first instance I get following out of memory error. Anybody knows how to work around this. I have checked my task manager and more than half of my memory was still not used when I get this error.
TITLE: SQL Server Import and Export Wizard
Column information for the source and destination data could not be retrieved.
"Query" -> [temporary].[dbo].[exporttable]:
- ERROR [HY000] Out of memory while reading tuples.;
No query has been executed with that handle
ADDITIONAL INFORMATION:
ERROR [HY000] Out of memory while reading tuples.;
No query has been executed with that handle (PSQLODBC.DLL)
BUTTONS:
OK -
Migrating Data from MySQL to SQL Server 2012
Hi all,
I'm Migrating a database from MySQL to SQL Server 2012, using SSMA for MySQL v5.2.1258. I've got the schema migrated over and have resolved any migration issues (stored procedures / views), but when it comes to migrating over the data I'm just hitting
a wall.
None of the data is migrating and when the migration report is displayed every table has a red x against it's Status. The Output box has the following:
Data migration operation has finished.
0 table(s) successfully migrated.
0 table(s) partially migrated.
64 table(s) failed to migrate.
I've seen on the forum that someone else was having the same problem
(http://social.msdn.microsoft.com/Forums/en-US/sqlservermigration/thread/b835f4b3-3d93-42a4-9b6b-d21d3dfd8dab/)
I've set the project settings mode to default, still getting the same error and tried using both Client Side Data Migration and Server Side migration, with both giving the same result. I've tried going through the step-by-step blog as well.
I am doing something really stupid? There are 64 tables, so don't really want to try doing exports from each table and importing it into the new database.
Hope someone can help.
Cheers
AlexHello,
I don’t have suggestions for you, but you can try contacting the SQL Server Migration Assistant (SSMA) Team via e-mail ([email protected])
to see if they can provide a solution on this scenario.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
How to Uninstall SQL instance on active-passive SQL server , which failed during Cluster Setup (Error-Failed at Validate Active Directory Configuration)
active-passive SQL server cluster setup failed due to some steps missed in initial cluster setup,
now i have unistall sql instance from nodes,
Your help will higly appriciated.
Regards,
Anish
AsandeenHello,
Please refer to the following link about remove a node of SQL Server Failover Cluster Instance:
http://msdn.microsoft.com/en-us/library/ms191545.aspx#Remove
Regards,
Fanny Liu
Fanny Liu
TechNet Community Support -
Execute SQL Task with Parameter - from DB2 to SQL Server
I am pulling data from DB2 to SQL Server.
1st Execute SQL task runs the following against DB2:
SELECT TIMESTAMP(CHAR(CURRENT_DATE - (DAY(CURRENT_DATE)-1) DAYS - 1 MONTH)) as START_MONTH
FROM SYSIBM.SYSDUMMY1;
I'm storing it as a Result Set.
Next I have a Data Flow Task. This pulls data from DB2 where the date matches the parameter.
FROM SCHEMA.TABLE t
WHERE DATE_TIME_COLUMN= ?
This works fine. Guessing, because the parameter source is DB2 and the Data Flow source is DB2.
The problem is, I want to remove existing data for the same date in the SQL table. IE, if I'm pulling March 2014 data from DB2, I want to be sure there is no March 2014 data in the SQL table. The main use is for re-runs.
So, I added another Execute SQL task after the first one that assigns the variable, and before the Data Flow Task. This runs the following statement against SQL Server:
DELETE FROM
database.dbo.table
WHERE DATE_TIME_FIELD >= ?
The package fails at the new Execute SQL Task with the following error message:
Error: 0xC002F210 at Execute SQL Task, Execute SQL Task: Executing the query "DELETE FROM
SBO.dbo.tblHE_MSP_FEE_BUCKETS
WHERE T..." failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established
correctly.
Task failed: Execute SQL Task
SSIS package "Load_MSP_Fee_Buckets_SQL.dtsx" finished: Success.
The program '[14240] Load_MSP_Fee_Buckets_SQL.dtsx: DTS' has exited with code 0 (0x0).
I am assuming this is something to do with the Parameter source being DB2, and trying to use against SQL?
Any suggestions on how to make this work??
Thanks,
-Al HParameter name is unrecognized
is the key, how come DB2 is related if it runs against SQL Server
What I think is happening you do not use the OLEDB connection to SQL Server.
Likewise, if it is ADO then the query needs to be
DELETE FROM
database.dbo.table
WHERE DATE_TIME_FIELD >= @MyDate
Arthur My Blog
Maybe you are looking for
-
Ok here i am back again.. I am creating a database upgrade tool, the column types are also subject to change. I use the CAST(col_name AS newtype) function to cast types, this often works. But not for all cases. @see http://download-west.oracle.com/do
-
Moving a folder in applications to external hard drive
Hello! So background story: I recently started moving all of my photos, music, and video library from my Macintosh HD to my external hard drive. I do have my Adobe CS4 suite installed on my Mac HD, and it is a folder inside 'Applications.' So here is
-
Hi, I am using eclipse version 0.9.13 and working through the creditflow example. I am getting the following error message on Windows 2000 using java 1.4 Buildfile: C:\Documents and Settings\dkunzman\workspace\CreditFlow\build.xml main: [bpelc] BPEL
-
Shared photostream disappeared
Hi all! I have a serious problem with a shared photo stream. I have 9 shared photo streams in total, all have been working well except one for the last week. This particular stream is shared with about 8 people, and everyone is able to add pictures t
-
Multi-SCORM Packager for v.5 & v.7 files
Hi all, I have 11 different projects that originally were created in v.5 and that I am editing now. This is the only version of Captivate that the client has and wants to maintain the files in this version. I also have v.7 on my machine. Since Multi-