By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,734 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,734 IT Pros & Developers. It's quick & easy.

ORA-12154: TNS:could not resolve service name

P: n/a
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 du**@db2.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?
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jan
An entry for the 2-nd database has to be in the tnsnames.ora ON THE SERVER.

Jan

sp*******@yahoo.ca (Sheela) wrote in message news:<67**************************@posting.google. com>...
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 du**@db2.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?

Jul 19 '05 #2

P: n/a
sp*******@yahoo.ca (Sheela) wrote in message news:<67**************************@posting.google. com>...
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 du**@db2.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
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.