Link to home
Start Free TrialLog in
Avatar of wscott30
wscott30

asked on

Problem creating oracle to sqlserver database link using intermediate server

Objective:  
Create database link from Oracle (database=PDASH) to SQLServer dev-sqlva (database=WAREPORT) using  intermediate SQLServer stag-bobj.  I have been told by our DBAs that the Oracle listener needs to reside on a separate server than the target SQLServer database, hence the need for an ‘intermediate’ server.  We have gotten this configuration to work previously, but something is preventing us from succeeding this time.

Setup / Configuration:
+++++++++++   On intermediate server (stag-bobj) ++++++++++++++++++++++
1. Installed Oracle 11g database server software for Windows 64bit.
2. Using $ORACLE_HOME\bin\netca - created listener configuration and started listener service.  
3. Configured HS (Heterogeneous Services)
4. Create System DSN entry in ODBC config manager 'dev_wareport' pointing to dev-sqlva,
using SQL server driver (6.01.) and user PDASH/PDASH for login

+++++++++++   On dev-sqlva  (WAREPORT)  server+++++++++++++++++++++++++++++++++
5. Create user PDASH/PDASH in SQL server database - WAREPORT. User should have read access to required tables.

+++++++++++   On Oracle Database (PDASH) server  +++++++++++++++++++++++++++++++++
6. Run script in Oracle database PDASH as sys to create HS Data Dictionary.
7. Add tnsnames.ora entry on PDASH database server pointing to stag-bobj.
8. Login as user pdash/pdash to PDASH database  and create db link.
-- use the same userid (PDASH) as in SQL server (step #5) and ODBC entry (step #4)

Problem:  
The DbLink is not working.  After going through the steps above and doing a tnsping from stag-bobj I get this….
C:\OracleDB64\product\11.2.0\dbhome_1\BIN>tnsping dev-sqlva

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 19-AUG-2
014 11:39:34

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
c:\OracleDB64\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTO
COL=TCP)(HOST=172.23.40.23)(PORT=1521)))
TNS-12541: TNS:no listener

.....When I check the Component Services on stag-bobj, it shows the listener as ‘Started’.  When I attempt to query the target WAREPORT database on dev-sqlva, while logged in as PDASH/PDASH in the PDASH  database,  I get this….

select count (*) from wareport.doi_stat@WAREPORT;

[1]: ORA-00942: table or view does not exist
[1]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'WAREPORT.DOI_STAT'. {42S02,NativeErr = 208}[Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared. {42000,NativeErr = 8180}
[1]: ORA-02063: preceding 2 lines from WAREPORT


Please see attachment for further details.  Thanks!
Problem-Description.docx
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The Oracle listener need not be on a separate server. However, it needs an Oracle gateway for SQL server installed and tnsnames.ora to be configured accordingly.

Details of oracle gateways can be found in the below doc:

http://docs.oracle.com/cd/E11882_01/gateways.112/e12070.pdf
Avatar of wscott30
wscott30

ASKER

Sorry about the delay. This got me what I needed in a roundabout way. When I created the ODBC on the intermediate server, I neglected to change the default database from 'master' to the database that I wanted - 'wareport'.  Thanks a bunch!