We are currently struggling with the following situation:
db1 (11.2.0.3) on server1 (Linux)
db2 (11.2.0.3) on server2 (Linux)
We regularly clone db1 to db2.
In db1 we created a database link like this:
CREATE PUBLIC DATABASE LINK "DB1LINK"
CONNECT TO USER
IDENTIFIED BY "ABC"
USING 'DB1';
This link, along with the database, got cloned to db2 multiple times. On db2 the link works fine. On db1 the link does not work for any of our developers connecting to it, nor for us, no matter which application we use, with one exception.
server1 $ sqlplus user/abc@db1
USER@DB1 > select * from dual@db1link;
select * from dual@db1link
*
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
IF we connect locally from server1 using SQLPLUS like this:
server1 $ sqlplus user/abc
THEN the database link works:
USER@DB1 > select * from dual@db1link;
D
-
X
tnsnames.ora on server 1 - has the same entry for db1 as exists in the tnsnames.ora on server2. Also only one tnsnames.ora exists on server1.
sqlpus user@db1 works locally and from server2
Does anyone have an idea what the issue may be?