Today's Messages (on)  | Unanswered Messages (off)

Forum: SQL & PL/SQL
 Topic: DB link issue in cloned databases on same host
DB link issue in cloned databases on same host [message #679002] Tue, 28 January 2020 00:54
aloksk
Messages: 2
Registered: January 2020
Junior Member
I two cloned database on same host.

database link is defined with domain on both like abc.domain.com

Link works on both database as :
select sysdate from dual@abc.domain.com;

but fails on one of the database:
select sysdate from dual@abc;

Any idea's?
Re: DB link issue in cloned databases on same host [message #679003 is a reply to message #679002] Tue, 28 January 2020 01:24
Michel Cadot
Messages: 66803
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.

"fails" is not an Oracle error.
There can be several roots depending on the actual error.
Use SQL*Plus and copy and paste your session, the WHOLE session.


Re: DB link issue in cloned databases on same host [message #679004 is a reply to message #679003] Tue, 28 January 2020 01:59
aloksk
Messages: 2
Registered: January 2020
Junior Member
On DB 1:
select * from dba_db_links where DB_LINK like 'TRAINING%' order by 2;SQL> SQL> SQL> SQL>

OWNER DB_LINK USERNAME HOST CREATED
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------
PUBLIC TRAINING.domain.COM ****** trainING.WORLD 20-DEC-19

SQL> select sysdate from dual@TRAINING.domain.COM;
select sysdate from dual@TRAINING;
SYSDATE
---------
28-JAN-20

SQL>

SYSDATE
---------
28-JAN-20


On DB 2(clone of DB1)
select * from dba_db_links where DB_LINK like 'TRAINING%' order by 2;SQL> SQL> SQL> SQL>

OWNER DB_LINK USERNAME HOST CREATED
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------
PUBLIC TRAINING.domain.COM ********* trainING.WORLD 20-DEC-19

SQL> select sysdate from dual@TRAINING.domain.COM;
select sysdate from dual@TRAINING;
SYSDATE
---------
28-JAN-20

SQL>
select sysdate from dual@TRAINING
*
ERROR at line 1:
ORA-02019: connection description for remote database not found

Both DB's are on same host, have same OH and TNS_ADMIN.
Re: DB link issue in cloned databases on same host [message #679005 is a reply to message #679004] Tue, 28 January 2020 02:09
Michel Cadot
Messages: 66803
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please put your code and SQL*Plus session between code tags like:
[code]SQL> select sysdate from dual;
SYSDATE
-------------------
28/01/2020 09:06:50

1 row selected.[/code]

which then gives when displayed:
SQL> select sysdate from dual;
SYSDATE
-------------------
28/01/2020 09:06:50

1 row selected.
What is the value of DB_DOMAIN in both instances (query v$parameter)?




Current Time: Tue Jan 28 05:15:43 CST 2020