Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using an Oracle database link to a SQL Server database

37907Apr 5 2004 — edited May 27 2004
I am accessing Oracle8i Enterprise Edition Release 8.1.6.0.0
I am accessing SQL Server (MSSQL7).

The Oracle server is one location, the SQL server is another location and I am in a third location. I able to login to the Oracle and SQL server from my location.

1) From the Start menu, I clicked Settings > Control Panel > Administrative Tools and select the Data Sources (ODBC) icon.
2) Select the System DSN tab to display the system data sources.
3) Click Add.
4) From the list of installed ODBC drivers, selected the name of the driver that the data source will use - SQL Server.
5) Click Finish.
6) Enter a name for the DSN, 'oracle_to_sql' and SQL Server machine (MYSqlServer).
7) Continue clicking Next and answering the prompts until I reached the end (click Finish).
8) I tested the connection and it was good.
9) added to the "network/admin/tnsnames.ora" and "network/admin/listener.ora" files (on my local drive):

Tnsnames.ora
------------
hsodbc=
(description=
(address=(protocol=tcp)(host=MYSqlServer)(port=1521))
(connect_data=(sid=hsodbc))
(hs=ok)
)

Listener.ora
------------
sid_list_listener=
(sid_list=
(sid_desc=
(sid_name=hsodbc)
(ORACLE_HOME = c:\orant)
(program= hsodbc)
)
)

10) Stopped/Started the Oracle listener
lsnrctl stop
lsnrctl start

11) In $ORACLE_HOME/hs/admin/inithsodbc.ora made sure I added the statement below:
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = oracle_to_sql
12) Connect to the Oracle database and create a database link to access the target database.
SQL> create database link hsodbc
SQL> connect to scott identified by tiger
SQL> using 'hsodbc';

--- Here I get a connection failed message.

So I tried to great a database link by:
create database link sqlserver connect to scott identified by tiger
using 'ODBC:oracle_to_sql';

This appears to work but when I do the query:

select * from mytable@sqlserver;

I get the error message:
"ORA-06401: NetCMN: invalid driver designator"

I then edited the INIT.ORA file
and Set the global_names = false

But still get the "ORA-06401: NetCMN" error.

I modified the Tnsnames.ora, Listener.ora & inithsodbc.ora files on my local computer.

For the database link to work would I need to edit the Tnsnames.ora entry on the computer that is hosting the Oracle database? If this is the case Is there any way of not doing that?

I am more interesting in getting Genericm Connectivity and Hetergeneous Services working correctly.

Can any one see where I am going wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 24 2004
Added on Apr 5 2004
1 comment
1,040 views