Home » RDBMS Server » Networking and Gateways » ORA-12154-Error while executing sql through database link
ORA-12154-Error while executing sql through database link [message #66529] Tue, 23 July 2002 21:37 Go to next message
Sanjay R
Messages: 1
Registered: July 2002
Junior Member
I am having problems accessing tables using database link. I would be highly obliged if you help me resolve it.

I am trying to create a database link from my windows 2000 professional client to oracle 8i databases on HPUX.

I have two databases on two different servers and i need to access a table in one database from another database.

I have updated the tnsnames.ora on my local system with following entries

---

PPROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prd)(PORT = 1521))
(CONNECT_DATA =(SID = PROD))
)

NPROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dev)(PORT = 1522))
(CONNECT_DATA = (SID = CLONE))
)

---

I have created the database link using the following command:

create database link ofprod
connect to current_user
using 'PPROD';

when I execute the following command, I get an error:

SELECT * FROM jobcust_mapping@ofprod;

The error I encounter is

ERROR at line 1:
ORA-12154: TNS:could not resolve service name



Can you please help to how to resolve this problem.Is there any setting that I need to do at the server end. Is there anything that I need to check to ensure that the database link works.....

Thanks in advance
Re: ORA-12154-Error while executing sql through database link [message #66530 is a reply to message #66529] Wed, 24 July 2002 01:48 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
check whether GLOBAL_NAMES is set to true. 
If true, the dblink name MUST be the same as the DB_NAME of the target database.
else unset the DB_link.
2) Verify the GLOBAL_NAME matches the DB_NAME.DB_DOMAIN (also in init<sid>.ora)
To check the current value, issue either of the following commands using
   SQL> SELECT * from GLOBAL_NAME;
   The return value should match DB_NAME and DB_DOMAIN parameter values in init<sid>.ora file.
   If it does not, issue the following statement using SQL*Plus or Server Manager:
SQL> ALTER DATABASE RENAME GLOBAL_NAME TO  db_name.db_domain;
3) Verify you can successfully connect to the database using SQL*Plus 
   sqlplus username/password@alias
Re: ORA-12154-Error while executing sql through database link [message #66798 is a reply to message #66529] Thu, 16 January 2003 13:13 Go to previous messageGo to next message
Nate Heffner
Messages: 1
Registered: January 2003
Junior Member
After I've successfully verified the 3 points listed above what next? I still cannot execute my sql.
Re: ORA-12154-Error while executing sql through database link [message #67160 is a reply to message #66798] Wed, 07 January 2004 03:06 Go to previous message
arun
Messages: 67
Registered: January 2000
Member
Hi,

Have u got any solution for the dblink problem. B'coz still i m also getting the same error even after verifing those 3 points..

Please give me the solution if u have.
Previous Topic: Connecting Oracle from MPE using SQL*NET
Next Topic: my oracle forms cant connect with database in th same system
Goto Forum:
  


Current Time: Sat Apr 27 17:44:52 CDT 2024