dbTalk Databases Forums  

ORA-12154: TNS:could not resolve service name

comp.databases.oracle comp.databases.oracle


Discuss ORA-12154: TNS:could not resolve service name in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sheela
 
Posts: n/a

Default ORA-12154: TNS:could not resolve service name - 08-16-2004 , 12:05 PM






I am trying to access the tables of a remote database(db2) from db1
database. I am getting the following error: ORA-12154: TNS:could not
resolve service name
I tried tnsping the db2 service_name and it is working.


I created a dblink like this at db1.


CREATE DATABASE LINK db2.oracle.com
CONNECT TO scott IDENTIFIED BY tiger
USING 'db2servicename';



When I will tried to access the db2 database tables from db1, I am
getting the above error.

sql> select sysdate from dual (AT) db2 (DOT) oracle.com ( from db1)
ORA-12154: TNS:could not resolve service name

The TNSNAMEs.ora file looks like this.

db2.oracle.com =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 85))
)
(CONNECT_DATA =
(SID = db2)
(SERVER = DEDICATED)
(SERVICE_NAME = db2servicename)

Do I need to add anything else in the tnsnames.ora file?

Reply With Quote
  #2  
Old   
Jan
 
Posts: n/a

Default Re: ORA-12154: TNS:could not resolve service name - 08-17-2004 , 01:36 AM






An entry for the 2-nd database has to be in the tnsnames.ora ON THE SERVER.

Jan

spathiyal (AT) yahoo (DOT) ca (Sheela) wrote in message news:<678ae5f9.0408160905.7e0aac46 (AT) posting (DOT) google.com>...
Quote:
I am trying to access the tables of a remote database(db2) from db1
database. I am getting the following error: ORA-12154: TNS:could not
resolve service name
I tried tnsping the db2 service_name and it is working.


I created a dblink like this at db1.


CREATE DATABASE LINK db2.oracle.com
CONNECT TO scott IDENTIFIED BY tiger
USING 'db2servicename';



When I will tried to access the db2 database tables from db1, I am
getting the above error.

sql> select sysdate from dual (AT) db2 (DOT) oracle.com ( from db1)
ORA-12154: TNS:could not resolve service name

The TNSNAMEs.ora file looks like this.

db2.oracle.com =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 85))
)
(CONNECT_DATA =
(SID = db2)
(SERVER = DEDICATED)
(SERVICE_NAME = db2servicename)

Do I need to add anything else in the tnsnames.ora file?

Reply With Quote
  #3  
Old   
sybrandb@yahoo.com
 
Posts: n/a

Default Re: ORA-12154: TNS:could not resolve service name - 08-17-2004 , 03:21 AM



spathiyal (AT) yahoo (DOT) ca (Sheela) wrote in message news:<678ae5f9.0408160905.7e0aac46 (AT) posting (DOT) google.com>...
Quote:
I am trying to access the tables of a remote database(db2) from db1
database. I am getting the following error: ORA-12154: TNS:could not
resolve service name
I tried tnsping the db2 service_name and it is working.


I created a dblink like this at db1.


CREATE DATABASE LINK db2.oracle.com
CONNECT TO scott IDENTIFIED BY tiger
USING 'db2servicename';



When I will tried to access the db2 database tables from db1, I am
getting the above error.

sql> select sysdate from dual (AT) db2 (DOT) oracle.com ( from db1)
ORA-12154: TNS:could not resolve service name

The TNSNAMEs.ora file looks like this.

db2.oracle.com =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 85))
)
(CONNECT_DATA =
(SID = db2)
(SERVER = DEDICATED)
(SERVICE_NAME = db2servicename)

Do I need to add anything else in the tnsnames.ora file?

The tnsnames.ora *on the database server* must list the remote database.
Database links are from server to server.

Sybrand Bakker
Senior Oracle DBA


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.