I have Oracle 11g and SQL Server 2012 installed on the same virtual machine. OS is Windows Server 2012. I want to access SQL Server 2012 from Oracle. I created the machine a few days back to test the connection process before applying it on server.
I had come through several issues but now I am stuck with this one.
ORA-12523: TNS:listener could not find instance appropriate for the client connection
I have already created ODBC Connection by the name of sqldb.
kshaz is my machine name.
Following are my configuration details.
listener.ora file
# listener.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = sqldb)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = hsodbc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = kshaz)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\Administrator
DIRECT_HANDOFF_TTC_LISTENER = OFF
tnsnames.ora file
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
SQLDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = sqldb)
)
)
sqlnet.ora file
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
initsqldb.ora file
HS_FDS_CONNECT_INFO = sqldb
HS_FDS_TRACE_LEVEL = off
I am running the following query.
select * from emptest@sqld
emptest is the table created at SQL Server 2012 and SQLD is the public database link.
Where have I gone wrong with the configuration? Or if there is any step that I have missed?
Thank you.
来源:https://stackoverflow.com/questions/43558423/issue-connecting-oracle-11g-to-sql-server-2012-ora-12523-tnslistener-could