473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ORA-12154: TNS:could not resolve service name

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
2 25804
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ashish Namdeo | last post by:
I get the following error: ORA-00904: invalid column name When I run the following insert command: INSERT INTO XXCUS_VGL_VST_MSTR...
0
by: wqhdebian | last post by:
It was said the ORA-02085 error result from the mismatch of database name and database link name ,and setting glabal_names=false can resolve . but I want to try the other solution,let global_names...
1
by: Doron | last post by:
I'm getting a ORA-00600 error on SYS.EXU8REF (see trace file below). SYS.EXU8REF is a view so the problem should be with one of the underlaying tables. i didnt run oerr12700 yet. can i find the...
0
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
2
by: J.Bijleveld | last post by:
Hello colleagues, At this moment we have a real big problem using a .NET application with an Oracle database (v8.1.6). I hope someone has encountered this problem before and is able to help me...
1
by: jkstexas2001 | last post by:
Could someone be of assistance and show me the problem with the following code? I have researched Metalink regarding ORA-29531, and the most common cause of this error is the failure to declare the...
2
by: Dwie | last post by:
Dear All, I'm a new in Oracle DB. I'm using Windows 2000 as server and Windows XP as client. I installed Oracle Enterprise on server and Oracle 8.1 on clients. I have some client with 2 different...
4
by: raccoon | last post by:
keep getting an ora-04020: deadlock detected while trying to lock object XDB. XDNDBKDJjilnd The statement I'm trying to issue is: REVOKE execute on abc."descript_T" FROM PUBLIC; I am not...
0
by: s.kapitza | last post by:
Hi, try M$S servicebug 3 regards s.kapitza alghaden@alumni.fdu.edu (Ahmad) wrote in message news:<4a75f4b7.0308080649.49105373@posting.google.com>...
0
by: wolfee | last post by:
I'm running 10gR2 RAC in Prod, Test and DEV and after doing a clone to the DEV environment I'm getting a wierd ORA-12514 error for only one node. I can tnsping the node and it comes back fine. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.