Heterogeneous Services - Generic Connectivity In Oracle9i
Oracle9i, like previous versions, supports heterogeneous services to allow data in non-Oracle database to be queried using SQL. This support has been in the form of transparent gateways, which are vendor specific, or generic connectivity which uses ODBC or OLEDB to make the connections. The functionality supported by generic connectivity is typically more limited than that possible when using vendor specific gateways, but it is quick and simple to configure. The steps listed below can be used to connect Oracle to any ODBC compliant database (MS Access, SQL Server etc.) on the local server:- Make sure a valid username and password are present for the non-Oracle database (MyUser/MyPassword).
- Create an ODBC DataSource for the non-Oracle database (Access1).
-
Create a file called: "ORACLE_HOME\hs\admin\initACCESS1.ora" which contains:
HS_FDS_CONNECT_INFO = Access1 #ODBC DSN HS_FDS_TRACE_LEVEL = OFF -
Add the following entry to the tnsnames.ora file:
ACCESS1.WORLD = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)) (CONNECT_DATA=(SID=ACCESS1)) (HS=OK) ) -
Add the following entry into the listener.ora file:
(SID_DESC= (SID_NAME=ACCESS1) (ORACLE_HOME=D:\Oracle\Ora\9011) (PROGRAM=hsodbc) ) - Reload the listener:
lsnrctl reload -
Create a database link using:
CREATE DATABASE LINK access1.world CONNECT TO "MyUser" IDENTIFIED BY "MyPassword" USING 'ACCESS1.WORLD'; -
Query the table using:
SELECT * FROM mytable@ACCESS1.WORLD;
For more information see:
- Oracle9i Heterogeneous Connectivity Administrator's Guide Release 2
- Oracle Database Heterogeneous Connectivity Administrator's Guide 10g Release 2
Back to the Top.
