Select Page

ORA-12154: TNS:could not resolve the connect identifier specified

Jeremiah Wilton | | March 4, 2009

The error also appears in some versions as: “ORA-12154: TNS:could not resolve service name.”

When a program needs to connect to an Oracle service via Oracle Networking (SQL*Net), it must look up the connect data for that service somewhere. When the lookup fails, the Oracle client code raises ORA-12154. Most people will encounter this error when their application tries to connect to an Oracle database service, but it can also be raised by one database instance trying to connect to another database service via a database link.

Note that this error is generated by the Oracle client code on the local host where the program is running, not by the remote Oracle service to which you are attempting to connect.

There are a few ways that the Oracle client code can look up connect data:

  • A flat file named tnsnames.ora
  • Oracle Names service
  • LDAP

If you see the whole ORA-12154 error with the text, then your program is finding a working Oracle client install, but that the Oracle service as specified is not listed in tnsnames.ora, Oracle Names or LDAP. The most common causes of ORA-12154 are:

  • The entry is missing from tnsnames.ora
  • The entry in tnsnames.ora is malformed
  • The program is using tnsnames.ora from the wrong ORACLE_HOME
  • The program is not using a fully-qualified service name, but no default domain is enabled in sqlnet.ora

Most sites use tnsnames.ora, but enough use Oracle Names and LDAP that the first step should be to determine which name resolution method is deployed at your site. If you are not the database administrator, you should get in touch with the people who manage your Oracle systems and find out which method you should be using. Often they will be able to provide guidance for resolving your problem in accordance with your site’s standards.

The client code decides which mechanism to use based on the file sqlnet.ora. This and tnsnames can usually both be found in the Oracle install directory (“ORACLE_HOME”), under network/admin/. This location may be overridden with the environment variable TNS_ADMIN. If the sqlnet.ora file does not exist, or does not specify a resolution method, then Oracle Net uses tnsnames.ora.

Example locations of Oracle networking files:

Windows:

ORANTNET80ADMIN
ORACLEORA81NETWORKADMIN
ORAWIN95NETWORKADMIN
ORAWINNETWORKADMIN

UNIX / Linux:

$ORACLE_HOME/network/admin/
/etc/
/var/opt/oracle/

Oracle EPM Cloud Vs. On-Premises: What’s the Difference?

EPM applications help measure the business performance. This post will help you choose the best EPM solutions for your organization’s needs and objectives.

Bobby Ellis | April 10, 2018

Hyperion Myth #9: SOX Audit Requests Are Time-consuming

With serious financial penalties, SOX audits can be intimidating — but they don’t have to be. Find out how you can use Datavail’s software to automatically prove SOX compliance.

Jonathan Berry | March 13, 2018

12c Upgrade Bug with SQL Tuning Advisor

This blog post outlines steps to take on Oracle upgrade 11.2 to 12.1 if you’re having performance problems. Oracle offers a patch and work around to BUG 20540751.

Megan Elphingstone | March 22, 2017

Work with Us

Let’s have a conversation about what you need to succeed and how we can help get you there.

CONTACT US

Work for Us

Where do you want to take your career? Explore exciting opportunities to join our team.

EXPLORE JOBS