Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've edited added new TNS name to tnsnames.ora. Toad for Oracle started to work at once. SQL Plus doesn't work even after logoff/logon, the same problem with my build scripts.

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

How could I fix it?

share|improve this question

migrated from May 14 '13 at 21:54

This question came from our site for professional and enthusiast programmers.

have you added a TNS_ADMIN environment variable? – vc 74 May 14 '13 at 15:00
no, let me try... – Mykhaylo Adamovych May 14 '13 at 15:01
@MykhayloAdamovych:You need to put your tnsnames.ora in TNS_ADMIN, and set enviornment variable for TNS_ADMIN – Gaurav Soni May 14 '13 at 15:03
@Gaurav Soni please comment as an answer to accept... Thank you for saving my time... – Mykhaylo Adamovych May 14 '13 at 15:09
up vote 4 down vote accepted

There are various methods of achieving this ,one of them as suggested by Yasir. Please follow the below steps:

  1. Close toad/sqlplus
  2. Create a folder TNS_ADMIN
  3. Add tnsnames.ora in TNS_ADMIN
  4. Add TNS_ADMIN in enviornment variable.
  5. Open Toad/Sqlplus and login

I think this will be very clear ,cheer

share|improve this answer

Just put your Oracle Net files (tnsnames.ora, sqlnet.ora etc.) to $ORACLE_HOME/network/admin directory.

Local Naming Parameters (tnsnames.ora):

By default, the tnsnames.ora file is located in the ORACLE_HOME/network/admin directory.

share|improve this answer

The safest and simplest way to add a tns entry to an oracle client is to use the wizard. run netca on the command line and fill in the necessary fields step by step. if you need to add parameters edit what the wizard created.

share|improve this answer
Or Oracle Net Manager (netmgr) which provides slightly more advanced settings. ;-) – Yasir Arsanukaev May 14 '13 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.