I've been trying to configure Heterogeneous Services to create a connection between an Oracle 10g database & a SQL Server database in my sandbox environment.
I went through the process of:
1) Creating a System DSN to the SQL Server database. The DSN connects to the database successfully when tested. The DSN name is HSTEST.
2) Creating the InitHS file (named initHSTEST.ora), here are the results:
# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent.
I restarted both of my listeners without a problem, but when I try tnsping on the Oracle server, here's what I get:
C:\>tnsping hstest
TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 03-MAY-2
005 12:49:49
Copyright (c) 1997, 2003, Oracle. All rights reserved.
Used parameter files:
TNS-03505: Failed to resolve name
SQL Server and Oracle are running on the same machine. I don't have an issue with tnsping on any of the other Oracle databases. What I'm trying to figure out is if I have done anything incorrectly on the HS configuration.
If I haven't done anything incorrectly, is the Transparent Gateway an option? And can I download the Transparent Gateway from OTN for development use?
Hmmm. From the error it looks like thk10g is not in your DNS or HSTEST is not in the correct TNSNAMES.ORA file. I would check to make sure all your copies of TNSNAMES.ORA (especially in your $OH) contain the alias you are trying to connect to.
So I thought about that comment about the db_1 directory for a second & it hit me. I also have Oracle Warehouse Builder installed in that sandbox, which is in the db__2 directory. OWB also has its own tnsnames.ora file.
I put the SID entry into the OWB tnsnames.ora file & presto, I can do a tnsping without an issue!
C:\Documents and Settings\Administrator>tnsping hstest
TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 03-MAY-2
005 15:22:32
Copyright (c) 1997, 2003, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = thk10g)(
PORT = 1521)) (CONNECT_DATA= (SID=HSTEST)) (HS=OK))
OK (70 msec)
I created a database link using the new SID using the following command:
create database link hstest connect to sa identified by XXXXXXX using 'HSTEST';
I then tried to query that database link, and I get the following error through SQL+Plus:
SQL> select * from employees@hstest;
select * from employees@hstest
*
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
ORA-12154:
SQL> select * from all_catalog@demo;
select * from all_catalog@demo
*
ERROR at line 1:
ORA-12154: TNS:could not resolve service name
Resolution:
The database link uses a SQL*Net alias not specified
in the TNSNAMES.ORA of the database server.
Query the data dictionary to figure out the 'HOST'
specified for the database link:
select db_link, host from user_db_links;
or
select db_link, host from dba_db_links;
The 'HOST' value is the alias of the SQL*Net.
Please make sure it exists in the TNSNAMES.ORA file
present at the Oracle database server.
Bookmarks