Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem with a database link

DKuttJan 26 2017 — edited Jan 27 2017

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?

This post has been answered by Rob the Real Relic on Jan 26 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2017
Added on Jan 26 2017
41 comments
8,592 views