Dec 11, 2010

Quick Tip–How to Create a DB Link without defining TNS on the DB Server

A database link is the way Oracle allows you to connect from one database to another.

When creating a DB link the Database TNS for the target Database should be added on the Calling Database server.

Most of the time Developers face the issue of having access to Database but does not have access to Unix to update the TNS Entry.

In such cases  you can create the DB Link directly and specify the TNS at the DB level.

CREATE DATABASE LINK ORCLlink CONNECT TO scott IDENTIFIED BY emp USING '(DESCRIPTION=(ADDRESS_LIST=(   ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.34)(PORT=1521)))   (CONNECT_DATA=(SERVICE_NAME=ORCL)))'

This worked on 9i, 10g  databases without issue.

0 comments: