Home » RDBMS Server » Networking and Gateways » ORA-12154: TNS:could not resolve service name (oracle database server connect error)
ORA-12154: TNS:could not resolve service name [message #584509] Tue, 14 May 2013 23:20 Go to next message
pranojit
Messages: 3
Registered: May 2013
Location: Dhaka
Junior Member

hello dear,
My database is oracle9i
when try to connect oracle database using putty to AIX server
like..

$ sqlplus

SQL*Plus: Release 9.2.0.8.0 - Production on Wed May 15 09:50:01 2013

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Enter user-name: sys@testdb as sysdba
Enter password: (given password)

(then showing the following Error message)

ERROR:
ORA-12154: TNS:could not resolve service name

But I try to connect using SQLPlus window

then it is successfully connected

also if i try to connect using command line window like..

C:\>sqlplus /

Enter user-name: sys@testdb as sysdba
Enter password:
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
JServer Release 9.2.0.8.0 - Production

SQL> select name from v$database;

NAME
---------
TESTDB

then it is also successfully connected to database..

what is the problem . please anybody help immediate

For your assistancy

my TNSLISTENER.ora file is

# TNSNAMES.ORA Network Configuration File: /u01/app/oracle/product/9.2.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

SINGERDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = singerbd)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = singerdb)
)
)

TESTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = singerbd)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = testdb)
)
)


and
"sqlnet.ora" is
SQLNET.AUTHENTICATION_SERVICES = (NTS)
Re: ORA-12154: TNS:could not resolve service name [message #584510 is a reply to message #584509] Tue, 14 May 2013 23:23 Go to previous messageGo to next message
BlackSwan
Messages: 22521
Registered: January 2009
Senior Member
>SQLNET.AUTHENTICATION_SERVICES = (NTS)
what does line above do?
why does SQLNET.AUTHENTICATION_SERVICES = (NTS) exist in sqlnet.ora?
Re: ORA-12154: TNS:could not resolve service name [message #584513 is a reply to message #584510] Tue, 14 May 2013 23:36 Go to previous messageGo to next message
pranojit
Messages: 3
Registered: May 2013
Location: Dhaka
Junior Member

thanks to your reply..
what will be there(i mean "sqlnet.ora" file?
Re: ORA-12154: TNS:could not resolve service name [message #584514 is a reply to message #584513] Tue, 14 May 2013 23:38 Go to previous messageGo to next message
BlackSwan
Messages: 22521
Registered: January 2009
Senior Member
If you choose to not answer my questions to you, then I choose to not answer any more of your questions.
Re: ORA-12154: TNS:could not resolve service name [message #584521 is a reply to message #584509] Wed, 15 May 2013 00:32 Go to previous messageGo to next message
Michel Cadot
Messages: 58611
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-12154: TNS:could not resolve the connect identifier specified
 *Cause:  A connection to a database or other service was requested using
 a connect identifier, and the connect identifier specified could not
 be resolved into a connect descriptor using one of the naming methods
 configured. For example, if the type of connect identifier used was a
 net service name then the net service name could not be found in a
 naming method repository, or the repository could not be
 located or reached.
 *Action:
   - If you are using local naming (TNSNAMES.ORA file):
      - Make sure that "TNSNAMES" is listed as one of the values of the
        NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
        (SQLNET.ORA)
      - Verify that a TNSNAMES.ORA file exists and is in the proper
        directory and is accessible.
      - Check that the net service name used as the connect identifier
        exists in the TNSNAMES.ORA file.
      - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
        file.  Look for unmatched parentheses or stray characters. Errors
        in a TNSNAMES.ORA file may make it unusable.
   - If you are using directory naming:
      - Verify that "LDAP" is listed as one of the values of the
        NAMES.DIRETORY_PATH parameter in the Oracle Net profile
        (SQLNET.ORA).
      - Verify that the LDAP directory server is up and that it is
        accessible.
      - Verify that the net service name or database name used as the
        connect identifier is configured in the directory.
      - Verify that the default context being used is correct by
        specifying a fully qualified net service name or a full LDAP DN
        as the connect identifier
   - If you are using easy connect naming:
      - Verify that "EZCONNECT" is listed as one of the values of the
        NAMES.DIRETORY_PATH parameter in the Oracle Net profile
        (SQLNET.ORA).
      - Make sure the host, port and service name specified
        are correct.
      - Try enclosing the connect identifier in quote marks.

   See the Oracle Net Services Administrators Guide or the Oracle
   operating system specific guide for more information on naming.

Regards
Michel
Re: ORA-12154: TNS:could not resolve service name [message #584527 is a reply to message #584521] Wed, 15 May 2013 01:12 Go to previous messageGo to next message
pranojit
Messages: 3
Registered: May 2013
Location: Dhaka
Junior Member

thanks a lot Michel.
according your instruction i have checked & update all
then also occurred same error.

here note that, few days ago it occurred suddenly but before that it was OK
Re: ORA-12154: TNS:could not resolve service name [message #584591 is a reply to message #584527] Wed, 15 May 2013 18:31 Go to previous messageGo to next message
BlackSwan
Messages: 22521
Registered: January 2009
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 #584731 is a reply to message #584510] Fri, 17 May 2013 04:29 Go to previous message
gazzag
Messages: 276
Registered: November 2010
Location: Bristol, UK
Senior Member
BlackSwan wrote on Wed, 15 May 2013 04:23
>SQLNET.AUTHENTICATION_SERVICES = (NTS)
what does line above do?
why does SQLNET.AUTHENTICATION_SERVICES = (NTS) exist in sqlnet.ora?


http://docs.oracle.com/cd/E11882_01/network.112/e10835/sqlnet.htm#BIIDAFFD

HTH
-g

*edit: this was meant for the OP, not Black Swan* Smile

[Updated on: Fri, 17 May 2013 10:07]

Report message to a moderator

Previous Topic: ORA-12154: TNS:could not resolve service name
Next Topic: EXCEPTION HANDLING for DBLINK In TRIGGERS
Goto Forum:
  


Current Time: Tue Jul 29 11:24:47 CDT 2014

Total time taken to generate the page: 0.08904 seconds