Take the 2-minute tour ×

I need to use PLSQL Developer to access oracle databases. I get the following error when I try to connect to my database. ORA-12154: TNS:could not resolve the connect identifier specified. I am able to use SQLPLUS from the command line to connect to the database, and tnsping returns successfully, but I can't figure out why PLSQL Developer will not work - it's using the right tnsnames.ora file, and the connection string in there is correct because it's the same one that tnsping uses.

Anyone have an idea what I can do to fix this? I've looked at other threads about this specific error with no luck.


    ORCL =
      (CONNECT_DATA = 
        (SERVICE_NAME = orcl)



sqlpus command line image here

PLSQL Developer Connection Preferences: image here

share|improve this question
Are you sure that PL/SQL Developer is using exactly the same TNS alias that you are using in SQL*Plus? My wild guess is that you're missing a domain (i.e. you need FOO.WORLD rather than FOO) –  Justin Cave Oct 10 '12 at 18:27
@JustinCave my computer doesn't have a domain name. If I run the command echo %userdomain% from the command line - I get my computer's hostname –  user891242 Oct 10 '12 at 18:31
I'm not talking about your computer's domain. I'm talking about the NAMES.DEFAULT_DOMAIN from your sqlnet.ora file, whether or not there is a domain on the TNS alias in your tnsnames.ora file (the .WORLD in FOO.WORLD), and whether or not that domain is present on the TNS alias that you are using in both SQL*Plus and PL/SQL Developer. –  Justin Cave Oct 10 '12 at 18:37
@JustinCave My tnsnames.ora file just contains my hostname without any domain name. My sqlnet.ora file does not have an entry for NAMES.DEFAULT_DOMAIN - do I need to give it a value? –  user891242 Oct 10 '12 at 18:48
I'm not talking about the domain on the hostname either. I'm talking about the domain (or lack thereof) on the TNS alias. Can you post your tnsnames.ora file, your sqlnet.ora file, the command line you are using for SQL*Plus, and exactly how you are configuring the connection in PL/SQL Developer? –  Justin Cave Oct 10 '12 at 18:59

9 Answers 9

up vote 8 down vote accepted

The answer was simply moving the PLSQL Developer folder from the "Program Files (x86) into the "Program Files" folder - weird!

share|improve this answer
brilliant answer for me! –  PaRiMaL RaJ May 20 '13 at 0:40
Thanks for letting us know! –  Menefee Aug 31 '13 at 14:55
Thanks for posting this answer! I've been trying to troubleshoot this issue on a Windows 7 workstation along with the Network Engineers and the Oracle DBA at where I work. –  Bryan Hepburn Jul 11 at 15:19
works for me too! I have spent many times to find this solution! :))) –  grep Jul 28 at 11:04

This error is very common, often the very first one you get on trying to establish a connection to your database. I suggest those 6 steps to fix ORA-12154 :

  1. Check instance name has been entered correctly in tnsnames.ora.
  2. There should be no control characters at the end of the instance or database name.
  3. All paranthesis around the TNS entry should be properly terminated
  4. Domain name entry in sqlnet.ora should not be conflicting with full database name.
  5. If problem still persists, try to re-create TNS entry in tnsnames.ora.
  6. At last you may add new entries using the SQL*Net Easy configuration utility.

For more informations : http://turfybot.free.fr/oracle/11g/errors/ORA-12154.html

share|improve this answer

As I can't add a comment, just thought I'd post this for completion. tufy's answer is correct, it's to do with parenthesis (brackets) in the path to the application being run.

There is an existing networking bug where the networking layer is unable to parse program locations that contain parenthesis in the path to the executable which is attempting to connect to Oracle.

Filed with Oracle, Bug 3807408 refers.


share|improve this answer
  • It did not work so i switched to oracle sql developer and it worked with no problems (making connection under 1 minute).
  • This link gave me an idea connect to MS Access so i created a user in oracle sql developer and the tried to connect to it in Toad and it worked.

Or second solution

you can try to connect using Direct not TNS by providing host and port in the connect screen of Toad

share|improve this answer

For me it was bad formatting of the tnsnames.ora connect identifier. The indentation of the identifier string is required as shown in the tnsnames.ora example in the comment.

share|improve this answer

Just wanted to add -- apparently this can also be caused by installing Instant Client for 10, then realizing you want the full install and installing it again in a parallel directory. I don't know why this broke it.

share|improve this answer

Also in addition to above solutions, also check the location where the tnsname ora file exists and compare with the path in the environment variable

share|improve this answer

I had an issue at work. The oracle server was "patched" and one of the databases I use could not be connect via the TNSNames entry but via Basic connection. The Database was up and admin could see it was up and running.

Addionally any application that used TNS for connecting to the database would not work either.

The problem found was that the database name was not correct in the TNS file but for some reason it's been working for years. Correcting the name fixed it for us. I did find that Oracle SQL Developer kept using the old TNS entry even after I updated it and I don't feel like reinstalling it for just one DB Connection. It appears that when the database was created it was given a smaller name then the others and via some cut and paste action within the TNSNames file it got mixed up. No one is sure how its worked as we're investigating it but the oracle patch ensured that the name had to be correct

An example of the name was it was down as "DBName.Part1.Part2" but in fact the DB name was "DBName"

share|improve this answer

ORA-12154: TNS:could not resolve the connect identifier specified (PLSQL Developer)

Answer: Go to the folder where you have installed ORACLE DATABASE. such as E:\oracle\product\10.2.0 [or as your oracle version]\db-1\network\ADMIN and then copy the two files (1) sqlnet.ora, (2) tnsnames.ora and close this folder. Go to the folder where you have installed ORACLE DEVELOPER. such as E:\DevSuitHome_1\NETWORK\ADMIN then rename the tow files (1) sqlnet.ora, (2) tnsnames.ora and paste the two copied files here and Your are OK.

share|improve this answer

Your Answer


