I am struggling to create a db link from a Oracle Database to one SQL Server.
For that, I have added the followings:
In file tnsnames.ora
:
sqlUserConn =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
(CONNECT_DATA=(SID=sqlUserConn))
(HS=OK)
)
in file listener.ora
:
(SID_DESC=
(SID_NAME=sqlUserConn)
(ORACLE_HOME=C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM=dg4odbc)
)
in file sqlnet.ora
:
SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
in file initsqlUserConn.ora
:
HS_FDS_CONNECT_INFO = sqlUserConn
HS_FDS_TRACE_LEVEL = OFF
The files tnsnames.ora, sqlnet.ora and listener.ora are placed in **server\network\admin** and initsqlUserConn.ora is placed in **server\hs\admin**
I have the following sql statement:
CREATE DATABASE LINK sqlUserConn CONNECT TO "USER" IDENTIFIED BY "PASSWORD" USING 'sqlUserConn';
And then to test the db link, I am running something similar to:
Select * from table@sqlUserConn
This command is firing the following error:
ORA-12154: TNS:could not resolve the connect identifier specified
Obviously, I have done something wrong.. but still I don't get it.. It should work as I have seen a lot of users doing it like this
Could someone point me to the correct solution for linking a SQL Server database to Oracle 11g?