make sure that you have the tnsentry of db2 in db1.
create public database link dblinkname connect to userindb2 identified by passwordindb2 using 'tnsentrynameindb2'
/
verify
select * from dual@dblinkname
/
you need to get x as the output.
select name from v$database@dblinkname
/
you need to get db2name as the output.
you may get the error "ORA-02082: a loopback database link must have a connection qualifier" in case if you use the database link name as that of the global name in db2. To avoid this, you can either give a different database link name (or) you can change the global name, then create the database link and after that you change the global name back to its original name.
Query dba_db_links
No comments:
Post a Comment