I created a database link as follows:
CREATE PUBLIC DATABASE LINK abc
CONNECT TO scott IDENTIFIED BY tiger USING 'abc';
It created the link successfully. But when I try to use this link as follows:
SELECT * FROM tablename@abc
it shows following error:
ORA-12154: TNS:could not resolve service name
I have checked TNSNAMES.ORA. I can connect to this remote database from other places like SQL Plus. I tried by setting global_names to both TRUE and FALSE. But no use. Can somebody help me please?
Before answering to this probelm i have some question to get the clear pic of the netowrk envoirment over there with you.
1) How are u accessing the db? From Oracle client software or Oracle developer i.e forms, reports?
2) What is the start in dir. of the SQL which is able to connect to the link? is it with the developer or the ora client part?
3)Show me the TNSNAMES entry on the board.
I hope if i get more details i could be able to help you..
I guess you have a sqlnet.ora file ... try creating your DB*Link using abc.world
whenever you are connecting database from your client or server oracle will check the name in tnsnames.ora.
1.You are connecting abc database from your client by using abc connect string in your local tnsnames.ora. No problem You can connect to the database through sqlplus.
The same step you follow to connect the database xyz by using xyz. No problem, you can connect to the database sqlplus.
But if you created abc dblink in xyz database to connect abc database then
you have to add the abc connect string in tnsnames.ora on XYZ database(server) .
Because dblink will connect another database by using server side tnsnames.ora, Not Client tnsnames.ora.
But sqlplus always use local tnsnames.ora connect string.
Click Here to Expand Forum to Full Width