• Blog
  • Get Help Now!
  • Customer Portal

BlueGecko Denmark

  • Why you need us
    • Why act now
    • Why are we unique
  • What we do
    • Products Supported 24/7
      • MySQL
      • Postgres
      • SQL Server
      • Open Source
      • OS & Storage
  • How we do it
    • Consulting
    • System Monitoring
    • Security
  • Support
    • Blog
      • Oracle
      • MySQL
      • News & Events
      • Oracle Applications
      • Amazon Web Services
      • Jeremiah Wilton’s Oradeblog
      • OurSQL Community Podcast
      • Remote DBA
    • Team viewer
    • Whitepapers
  • About Us
    • Philosophy
    • The Blue Gecko Teams
    • Employment Opportunities
    • Partners
    • News
    • Press
  • Contact Us

March 4, 2009 by jwilton

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

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/

Filed Under: Oracle Tagged With: connect identifier, ldap, ORA-12154, oracle names, service name, TNS, tnsnames.ora

Categories

  • Amazon Web Services
  • Configuration Management
  • downtime
  • Drizzle
  • ebs
  • Education
  • elastic block store
  • elastic compute cloud
  • hosting
  • hot backup
  • ignorance
  • Infrastructure
  • IOUG
  • Jeremiah Wilton's Oradeblog
  • misconception
  • misconceptions
  • Monocle
  • MySQL
  • MySQL Council
  • News
  • News & Events
  • Oracle
  • Oracle APEX
  • Oracle Applications
  • Oracle Data Guard
  • Oracle Database
  • Oracle Database Appliance
  • Oracle Linux
  • Our People
  • OurSQL Community Podcast
  • outage
  • parallel
  • performance
  • podcast
  • proof
  • Remote DBA
  • replication
  • S3
  • Security
  • SQL Server
  • System monitoring
  • Tomcat
  • Uncategorized

Contact Blue Gecko

  • This field is for validation purposes and should be left unchanged.

Get Our Newsletter

  • This field is for validation purposes and should be left unchanged.

The Fine Print

  • Privacy Policy
  • Terms of Use
  • When is remote DBA the right solution
  • What are remote DBA services
  • Get Help

Blog Categories

  • 24/7 support
  • Blue Gecko 360° Services
  • Products Supported 24/7

Virtual runs

Contact Blue Gecko

Blue Gecko A/S
Slotsgade 21
DK – 4200 Slagelse
Denmark
Phone: (DK) +45 70 60 51 20

Networks

  • Email
  • Twitter

© Blue Gecko Group