473,473 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 25811
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.