Home » RDBMS Server » Networking and Gateways » ORA-12154: TNS:could not resolve service name (oracle 9.2.0, AIX 5.3)
ORA-12154: TNS:could not resolve service name [message #584358] Mon, 13 May 2013 06:26 Go to next message
Hossain
Messages: 11
Registered: October 2004
Location: Dhaka
Junior Member
Hi Experts,

I have overwritten tnsnames.ora file with newone. In new tnsnames.ora file I have added new host string, remaining all unchanged.

after that, when trying to connect using sqlplus(from windows machine, sqlplusw.exe), working fine. But when trying to connect through putty getting error.

ORA-12154: TNS:could not resolve service name

for the same reason my scheduled cron tab can not run export backup. cron tab error is

EXP-00056: ORACLE error 12154 encountered
ORA-12154: TNS:could not resolve service name
EXP-00000: Export terminated unsuccessfully

I am suspecting problem may be due to file accessing permission related issue. But cant solve it. Current tnsnames.ora files permission is

# ls -l admin
total 112
-rw-r--r-- 1 oracle oinstall 14661 Apr 26 2002 libnk59.exp
-rw-r--r-- 1 oracle oinstall 643 Apr 26 2002 libnk59.imp
-rw-r--r-- 1 oracle oinstall 5728 Apr 26 2002 libnrad9.exp
-rw-r--r-- 1 oracle oinstall 405 Apr 26 2002 libnrad9.imp
-rw-r--r-- 1 oracle oinstall 932 Jan 24 2008 listener.ora
drwxr-xr-x 2 oracle oinstall 256 Jan 21 2008 samples
-rw-r--r-- 1 oracle oinstall 130 Mar 18 2002 shrept.lst
-rw-r--r-- 1 oracle oinstall 24 Apr 29 2002 snmp_ro.ora
-rw-r----- 1 oracle oinstall 38 Oct 21 2010 sqlnet.ora
-rwxr-xr-x 1 oracle oinstall 1102 May 13 12:31 tnsnames.ora



Regards
Hossain

  • Attachment: error.GIF
    (Size: 20.96KB, Downloaded 1993 times)
Re: ORA-12154: TNS:could not resolve service name [message #584360 is a reply to message #584358] Mon, 13 May 2013 06:28 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
How many TNSNAMES.ORA files do you have? More than one (which is the case if there are several Oracle products installed). Consider using TNS_ADMIN environment variable which will point to a single TNSNAMES.ORA file you maintain and use.
Re: ORA-12154: TNS:could not resolve service name [message #584380 is a reply to message #584360] Mon, 13 May 2013 08:31 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member

ORA-12154 ALWAYS only occurs on SQL Client & no SQL*Net packets ever leave client system
ORA-12154 NEVER involves the listener, the database itself or anything on the DB Server.
ORA-12154 occurs when client requests a connection to some DB server system using some connection string.
TNS-03505 is thrown by tnsping & is same error as ORA-12154 thrown by sqlplus or others.
The lookup operation fails because the name provided can NOT be resolved to any remote DB.
The analogous operation would be when you wanted to call somebody, but could not find their name in any phonebook.
The most frequent cause for the ORA-12154 error is when the connection alias can not be found in tnsnames.ora.
The lookup operation of the alias can be impacted by the contents of the sqlnet.ora file; specifically DOMAIN entry.
TROUBLESHOOTING GUIDE: ORA-12154 & TNS-12154 TNS:could not resolve service name [ID 114085.1]
http://edstevensdba.wordpress.com/2011/02/26/ora-12154tns-03505/
Re: ORA-12154: TNS:could not resolve service name [message #584382 is a reply to message #584360] Mon, 13 May 2013 08:45 Go to previous messageGo to next message
Hossain
Messages: 11
Registered: October 2004
Location: Dhaka
Junior Member
I have one TNSNAMES.ora file currently. However, how can I know current value of tns_admin varable?

regards
Hossain
Re: ORA-12154: TNS:could not resolve service name [message #584383 is a reply to message #584360] Mon, 13 May 2013 08:47 Go to previous messageGo to next message
Hossain
Messages: 11
Registered: October 2004
Location: Dhaka
Junior Member
I have one TNSNAMES.ora file currently. However, how can I know current value of tns_admin varable?

regards
Hossain
Re: ORA-12154: TNS:could not resolve service name [message #584384 is a reply to message #584382] Mon, 13 May 2013 08:48 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
> However, how can I know current value of tns_admin varable?

echo $TNS_ADMIN
Previous Topic: oracle 9i to Sql server 2008 R2 migration
Next Topic: ORA-12154: TNS:could not resolve service name
Goto Forum:
  


Current Time: Sun Nov 24 23:57:00 CST 2024