Documente Academic
Documente Profesional
Documente Cultură
oracle Databases
There may be some requirements to access the Data residing in different flavors of
Databases like MS-SQL, Access, and Sybase from the Oracle database. This can be
achieved with the help of creating Heterogeneous Services to connect to non-oracle
flavors of the database and also integrate the data residing in them. The HS
(Heterogeneous Services) is created with the help of the ODBC drivers for that
particular flavor of the database (e.g. For MS-Access we need MS driver for Access).
Generic Connectivity is implemented by using a Heterogeneous Services ODBC
agent. An ODBC agent is included as part of the Oracle system and is installed in the
same ORACLE_HOME and resides in the folder HS.
7. Modify the Listener.ora and the TNSNAMES.ORA file so that to connect to the
Database.
8. Restart the Listener or START the listener if a new one has been created specific
for the new connection.
9. Creation of the Database Link to connect to the HS connection.
Let us see the above steps in a brief fashion. Here we can consider of having a MS-
Access Database from where in the data needs to be accessed into Oracle database:
1. Create the MS-Access database or copy the same to the local server
where in the Database is hosted.
2. Create the ODBC connection. This can be done as follows:
Click on START à Control Panel à Administrative Tools and then open Data Sources
(ODBC)
Click on the SYSTEM DSN Tab and then click on the ADD button.
Also you can find out more at the Software Outsourcing Company website:
http://www.symbyo.com
After that, enter the Data source name using which you would like to connect to the
MS-Access Database (here in our case it’s ChryslerMDB). Also, select the MS-
Access file by clicking on SELECT button and then click on OK to complete the
configuration.
1. Check for the connectivity and confirm whether the ODBC connection
is working fine.
*********************************************************************
***********
NAME
----------------------------------------------------------------
VALUE
----------------------------------------------------------------------------
global_names
FALSE
SQL>
*********************************************************************
**********
1. Once this is done, we need to create the INIT.ORA file for the
HSODBC connection that needs to be created. This needs to be done in
%ORACLE_HOME% oracleora92hsadmin folder. (In UNIX, it will be $
ORACLE_HOME oracleora92hsadmin). Create a file saying init<sid for non-
oracle database>.ora file with the following contents : In our case the file
should be named as initchryslermdb.ora
HS_FDS_CONNECT_INFO = chryslermdb
HS_FDS_TRACE_LEVEL = 0
In the above chryslermdb id the non-oracle database connection string or the DSN
name that we created in Step 2.
1. Once this is done, the next step is to update the Listener.ORA file. We
can use the same listener that is been used by the database to access the ODBC
connection or a different one can also be configured. Here we will create a
new listener for the ODBC connection.
LISTENER_MSACCESS =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
SID_LIST_LISTENER_MSACCESS =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:oracleora92)
(PROGRAM = extproc)
(SID_DESC =
(ORACLE_HOME = C:oracleora92)
(SID_NAME = chryslermdb)
(PROGRAM = HSODBC)
In the above SID_NAME ChryslerMDB is the SID name that we have given for non-
oracle database (e.g. MS-ACCESS or MS-SQL). Once this is done start the Listener
by executing the following command at the command line .
------------------------
Alias listener_msaccess
tion
Security OFF
SNMP OFF
Services Summary...
Update the TNSNAMES.ORA file with the entries similar to the following :
Chryslermdb.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = <hostname>)
(Port = 1522)
(HS=ok)
Here TEST1 is the DB Link name and CHRYSLERMDB.WORLD is the name of the
DSN entry in the TNSNAMES.ORA file.
Once this is done, we can do any operations on the Non-oracle database by executing
the commands from Oracle database. For e.g.
Note : We have to make sure that the SID name in the TNSNAMES.ORA and
LISTENER.ORA and the one in the USING clause of the Create Database Link
matches, otherwise we will not be able to connect to the database and will get some
errors. Also, the init.ora file at the %ORACLE_HOME% oracleora92hsadmin should
be created with the correct SID failing which will lead to errors.
Source: ArticleBase.com