Followers

Tuesday, April 16, 2019

Mamun's DBA Blog: How to create DB Link without modifying the tnsnames.ora

Suppose you want to create a database_link, but you don’t have the privilege to modify the tnsname entry. In that case you can create the database_link directly using tns description.

sql>create public database link DBA connect to orcl identified by welcome1 USING
'(DESCRIPTION=(ADDRESS_LIST=(
ADDRESS=(PROTOCOL=TCP)(HOST=srv1)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=DBA)))'
/
database link created.
Most easiest one is below. No need to write the complete tns description also.

create public database link TEST connect to system identified by welcome1 
 using  '192.168.227.4:1521/TEST';
Database link created.
SQL> select sysdate from dual@TEST;
SYSDATE
---------
13-APR-19

No comments:

Post a Comment