473,796 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ 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 25841
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.go ogle.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.go ogle.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
5452
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 X(VISIT_ID,VISIT_DT_FROM,VISIT_DT_TO,EMP_NAME,EMP_NO,EMP_DESGN,VISIT_TYPE,LOCATION,SPECIAL_OBSERVATION,LAST_UPDATE_DT,LAST_UPDATED_BY) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11) RETURNING...
0
5491
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 still be true.and set db_domain pramater to fix it,my question is: If my computer did not configure for domain,so there is no reall domain name for it,can I fake one domain name to use as the db_domain paramter? And I did it,set db_domain to...
1
4010
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 object/block that is giving the error via the RDBA? if so then how? any suggestions appreciated!
0
2485
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 with it. The problem is that we *Sometimes* get the ORA-24338 error when executing a query. This problem occurs random, sometimes twice a day, sometimes not at all. In
2
8458
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 with it. The problem is that we *Sometimes* get the ORA-24338 error when executing a query. This problem occurs random, sometimes twice a day, sometimes not at all. In the eventlog we get an exception like this one (stacktrace):
1
7866
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 method "public" and "static". I have done both here and still have the same error: Java Code:::::::::::::::::::::::::::::::::::::::::::::: CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "TimeZoneFormatter" AS import java.util.TimeZone;
2
43665
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 IP address, 172.16.xx.xx and 192.168.xxx.xx whices I want to connect to the server DB. How can I set the Listener.ora & Tnsnames.ora so all clients could connect to server. Right now I can connect just only one IP and the other IP is offline, but...
4
7595
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 able to find a solution for this besides the fact of just try the operation again at a later time. I did try it again and again throughout the day, but get the same error every single time.
0
1480
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
3499
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. Oracle Home is shared, so I'm using the same listener.ora file and tnsnames.ora file from both nodes. I can connect using sqlplus @<node1> fine and @<service name> fine but when I try to connect @<node2> I get the ORA-12514. This is odd because I have...
0
10465
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7558
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4127
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 we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.