SQL> create database link TESTDBLINK connect to username identified by "password" using 'TRGDB';I spent much time... then found out on My Oracle Support - Database Links: Troubleshooting ORA-2085 "database link %s connects to %s" [ID 210630.1]
Database link created.
SQL> select * from tab@TESTDBLINK;
select * from tab@TESTDBLINK
*
ERROR at line 1:
ORA-02085: database link TESTDBLINK connects to TRGDB
When the source database initialization parameter GLOBAL_NAMES is set to TRUE, the database link name must match the target database global name as it exists in the GLOBAL_NAMEOn Source Database:
SQL> show parameter GLOBAL_NAMESOn Target Database:
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
global_names boolean TRUE
SQL> select * from global_name;
GLOBAL_NAME
--------------------------------------------------------------------------------
SRCDB
SQL> select * from global_name;Idea to test:
GLOBAL_NAME
--------------------------------------------------------------------------------
TRGDB
A>
SQL> create database link TRGDB connect to username identified by "password" using 'TRGDB';B>
Database link created.
SQL> select * from tab@TRGDB;
< data >
SQL> alter session set global_names=false;just ORA-02085 error, but used much time to find out -)
Session altered.
SQL> select * from tab@TESTDBLINK;
< data >
4 comments:
it was really informative and useful for me. it helped me to fix the issue at the earliest by readding your blog
you're welcome.
Thanks..Your block is very helpful.
Thanks Sir !!
Regards
Muhammad Imtiyaz
Post a Comment