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

We have faced following  issue in some versions of oracle such as Oracle 10g and Oracle 11g Express edition.

"ORA-12154: TNS: Could not resolve service name"

When you try to connect to an Oracle Service via Oracle Networking SQL*Net, it looks up the connect data for the service. When this lookup fails, Oracle client show an error message ORA-12154.

Sometimes this error comes when one database instance tries to connect to another database instance via database link.

ORA-12154 TNS could not resolve the connect identifier specified

Root Cause:

You try to connect to Oracle Database but the service name is either missing from the TNSNAMES.ORA file or is incorrectly defined.



You have to make sure that the TNSNAMES.ORA file exists in the correct directory and accessible.

%ORACLE_HOME% /network/admin/

Ex: In Oracle 11g express, it is located at below path.



You have to make sure that the service name that you are trying to connect is included in the TNSNAMES.ORA file and it is correctly defined.


Make sure that TNSNAMES is listed as one of the values of the names.directory_path parameter in the sqlnet.ora Oracle Net profile.


You have to make sure that the syntax of TNSNAMES.ORA file is correct.

For example, if there are unmatched brackets in the file (ie: open bracket without the corresponding close bracket), the file will be rendered unusable.

XE =

If you are still facing the same issue, please write to us in comment section.

Subscribe to get free tech advice, tips and in-depth articles.

Start Your Dream Website Today & Earn Money Online

To Start a dream website, choose a Domain Name & Reliable Hosting Provider, Self-hosted Blogging Platform, WordPress Theme, Email Marketing and SEO Tool for traffic.

SiteGround Hosting Discount - 60% OFF
ConvertKit The Best Email Marketing Software
Free SEMRush SEM and SEO Tool
Get Your Hosting Package with SiteGround, Increase new email subscribers with ConvertKit and Research Keywords with SEMRush to Boost Organic Traffic.

Leave a Reply

Your email address will not be published. Required fields are marked *