TNS: could not resolve the connect identifier

BZerbe

Member²
I just got a new PC and installed PLD. When trying to connect PLD to my database I am getting a ORA-12154 error. I think this is because PLD is looking at the incorrect tnsnames.ora file.

How do I tell PLD where the correct tnsnames.ora file is?

I know there is a variable in my registry called TNS_ADMIN and this is set correctly.
 
You can go to Help > Support Info to see which Oracle Home PL/SQL Developer is using, and also which tnsnames.ora file it is using.

You can go to Tools > Preferences > Oracle / Connection to select a different Oracle Home.
 
When I go to Help > Support, then I can see the following information:

TNS File
c:\instantclient_11_2\Network\Admin\tnsnames.ora

Using
Home:
DLL: c:\instantclient_11_2\oci.dll
OCI: version 11.1

I set a different Oracle Home in my Tools > Preferences > Oracle / Connection but it is not using it (yes, I restarted PLD after I applied the preference change). Really, I just need PLD to point to a different tnsnames.ora file. How do I do that?
 
As Marco pointed out go to:
"Tools > Preferences > Oracle / Connection to select a different Oracle Home."

If everything else fails you can copy the tnsnames to the other side, keep the original copy (rename it).
 
Yes, I went to "Tools > Preferences > Oracle / Connection" and then input an Oracle Home of: \\mcwa\transfer\oracleconnection

Even with this information input, the "Help > Support" shows:

TNS File
c:\instantclient_11_2\Network\Admin\tnsnames.ora

Using
Home:
DLL: c:\instantclient_11_2\oci.dll
OCI: version 11.1

I understand I can copy and paste the tnsnames.ora file into the instantclient directory but that means I need to update that file every time the main tnsnames.ora file is changed. There's got to be an easier way.
 
I think you can go to regedit (I am on Windows 7) and export all the registry as a back up if something goes bad. Then look for HKEY_LOCAL_MACHINE >> Software >> Oracle >> Your local home and then create the variable TNS_ADMIN (IF it doesn't exist already).
The value will be "\\mcwa\transfer\oracleconnection" as you stated.

Then go to PLD and then go to Tools > Preferences > Oracle / Connection and select the same oracle home as per the registry.

Also you could try creating a system variable (windows) TNS_ADMIN and then assign the value "\\mcwa\transfer\oracleconnection" and see if either of those solutions work for you to select the right tnsnames.
 
Hey fidelfs,

Thanks for the suggestion. I do have my TNS_ADMIN variable set in my registry to the correct tnsnames.ora file. When I change my Oracle Home through the preferences in PLD, it is not reflected in the Help > Support Info. It seems like PLD is ignoring my Oracle Home change in the preferences.

Any idea why?

Brandon
 
I had the same problem. Tools > Preferences > Connections were null for Oracle Home and OCI Library. I tried setting them to direct PLD to the right place but still had the problem.
I then looked at Help > Support Info and found TNS File was set to
D:\app\product\11.2.0\client_1\Network\Admin\
which didn't exist.
I created \Network\Admin\ subdirectories under D:\app\product\11.2.0\client_1\ and then copied TNSNAMES.ORA there from
D:\app\product\11.2.0\dbhome_1\NETWORK\ADMIN
I still had the same error.
I then copied LISTENER.ORA to the client_1\Network\Admin\ subdir and it worked
 
Back
Top