I created database link, and when issuing
select * from ticket@prod where abc='xyz'
(prod is my database link name)
it gives me TNS error,
ORA-12154: TNS:could not resolve service name
Please let me know how to resolve it.
Post the syntax you used to create the dblink. seems you didn't mention the servicename in the link or mentioned service name doesn't exists.
create public database link abc.world connect to fshatat identified by howdy using 'aaa.world'
This aaa.world has an entry in My TNSNAMES.ORA file
put service name in tnsnames.ora(In server) and then create a public database link.
create public database link <db_link_name>
connect to user_name identified by password
Check Tnsnames.ora in the server where you have created the database link, does prod exist there?
create user xxxwebt identified by xxxwebt
default tablespace users
temporary tablespace temp
grant create session to xxxwebt ;
CREATE DATABASE LINK yyywblnk.world
CONNECT TO xxxwebt IDENTIFIED BY xxxwebt
USING 'webzzz.world' ;
"xxxwebt" is user on remote databse
"webzzz.world" is service name to connect to remote databse.
"yyywblnk.world" is the link to remote database.
It works for me. Try figuring out in which step its going wrong.
Can you sqlplus to remote database using that service name and that user ? If you do you should be fine conecting thru dblink also..
Thanks SReddy, Sree_Sri, Pando.
Click Here to Expand Forum to Full Width