Creating a database link from oracle to oracle database is easy. But setting up db_link from oracle to mssql server isn’t straight forward. We need to do odbc setup. Its knows as heterogeneous db_link.  We can achive this either by using third party odbc drivers or using oracle provided gateways utility.

Here in this article i will show how to create db_link using oracle gateway.

Download the gateway file from OTN.

unzip the file in oracle database server and execute runInstaller




Select the oracle_home same as that of the oracle database.








Here we are connecting to microsoft sql server. So select that sql server gateway option.


Enter the sql server details  to which we are creating the database link.







Run the file from root user . Now the gateway installation is done.


Now add the below entry in listener.ora file and start the listener

( HOST= — This is the oracle database server ip

Now add the tns entry in tnsnames.ora file


Lets create the database link and test it.