Home » RDBMS Server » Networking and Gateways » TOAD with ORA-12154: Error
TOAD with ORA-12154: Error [message #199827] Thu, 26 October 2006 07:03 Go to next message
ajayanikar
Messages: 4
Registered: October 2006
Location: India
Junior Member

Hi All,

Briefing about the situation:
When we are trying to connect FROM TOAD to a Database instance (A1) with valid Username/Password we are getting
" ORA-12154: TNS:could not resolve service name ". But we are able to connect to the same instance (A1) via the sqlplusw.exe.
We are able to TNSPing to this instance from TOAD.

We checked the tnsnames.ora, but could not find much what is causing this error?

Can someone guide us where is the error coming ?
Re: TOAD with ORA-12154: Error [message #199835 is a reply to message #199827] Thu, 26 October 2006 07:19 Go to previous messageGo to next message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
If I state the obvious please forgive me. I would ask the following questions and then make these suggestions:

1) so what changed? Did Toad work for you before or is this a new thing you are doing?

2) do you have multiple tnsnames.ora files? Maybe you recently installed a new Oracle product?

3) have you set TNS_ADMIN environment variable to point to a single tnsnames.ora file? This is my favorite way of making sure all tools are using the right file.

4) are you sure there is no spelling error involved? Maybe toad is passing a tnsnames entry using upper_lower case or something like that.

Might I suggest you first find out if there are multiple tnsnames.ora files available to your environment, then try setting your TNS_ADMIN environment variable so that you know for sure which one you are using. If you are not sure what this is, google. If necessary, you can temporarily rename tnsname.ora files till you figure out which one is used by which tool. Takes a little while but it works.

The basic search order for a tnsnames.ora file goes like this:

1) an errant tnsnames file in your path
2) TNS_ADMIN environment variable set to a directory
3) a GLOBAL CONFIGURATION DIRECTORY (I don't know a whole lot abouth this, think it is mostly used in Unix environments, for exp. /ect or /var/opt/oracle)
4) the normal admin directory (%oraclehome%/network/admin)

** many Oracle tools install into a different Oracle home so you end up with multiple admin directories and thus multiple tnsnames.ora files. If you have multiple such homes and/or files, you may not be using the one you think.

Good luck, Kevin
Re: TOAD with ORA-12154: Error [message #199867 is a reply to message #199835] Thu, 26 October 2006 08:57 Go to previous messageGo to next message
ajayanikar
Messages: 4
Registered: October 2006
Location: India
Junior Member

Thanks Kevin,

Tried to answer your queries:
1. We are not able to connect to this one instance from Toad and it didnt work before as well (we are able to connect to other instances)
2. There is only tnsnames.ora file in the admin folder which is being referred by Toad.
3. If you are talking about setting this environment in regedit - then that also looks good. If something else other than this - then please guide us how to check the same.
4. Checked all these earlier itself.

Infact we tried changing the tnsnames.ora to a different one and it worked fine, but when we reverted back to original tnsnames we are again not able to connect to this instance.

There is only one tnsnames.ora in the admin folder (as we searched for same in the whole system itself)

Thanks
Re: TOAD with ORA-12154: Error [message #439150 is a reply to message #199867] Thu, 14 January 2010 12:01 Go to previous message
hekzen
Messages: 1
Registered: January 2010
Location: Mexico
Junior Member
Hi ajayanikar,

You can set the environment variable in System Properities in Advanced Options tab you can find a button called "Environment Variables".

This worked for me..
Previous Topic: opitsk: network error occurred while two-task server trying to send break; error
Next Topic: Accessing a remote database
Goto Forum:
  


Current Time: Thu Apr 18 22:49:18 CDT 2024