Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle PL Sql Developer cannot find my tnsnames.ora file

I have an Oracle tnsnames.ora file from my previous workplace. I want to pick it up with my newly installed PL SQL Developer on another computer. I have copied the file into ..ORACLE/product/11.2.0/client_32/NETWORK/ADMIN but PL SQL Developer cannot find it.

When it starts it is not showing me any choice of database. In About->i->TNSNames I dont see any lines

I have found a number of advices to look for it in Tools->Preferences->Database->..., but I dont have a Database tab in my preferences.

How can I fix it?

like image 903
MiamiBeach Avatar asked Mar 30 '15 16:03

MiamiBeach


People also ask

Where is my Tnsnames Ora file?

By default, the tnsnames. ora file is located in the ORACLE_HOME/network/admin directory. Oracle Net will check the other directories for the configuration file.


1 Answers

If you are certain your tnsnames.ora file is correct (e.g. by testing the connection with the Oracle Net Config Assistant, or logging in successfully with SQLplus), and you are able to open the PLSQL Developer application, but you still can't connect to the database in PLSQL Developer, then follow these steps:

  1. In PLSQL Developer (version 11.0) go to Help/Support Info

  2. Click the TNS Names tab. If the path in PLSQL Developer is wrong it will be blank (no tns file found) or incorrect (wrong tns file in use)

  3. On the Info tab scroll down to the TNS File entry and to see the path for the tns file PLSQL Developer is using. Very likely this is wrong.

  4. To correct the path:

  • open a command prompt

  • navigate to the PLSQL Developer directory in Program Files

  • enter this command:

    plsqldev.exe TNS_ADMIN=c:\your\tns\directory\path\here

    *path is to the directory containing your tnsnames.ora file - for me this is: c:\Oracle\product\11.2.0\client_1\network\admin

  1. A new PLSQL Developer UI will open and you should be able to connect.

  2. Make sure you have a Windows environment variable TNS_ADMIN set to the same path

  • On Windows 7 you go to Start, Control Panel, System, Advanced System Settings, Environment Variables to view/add/update environment variables
like image 183
Jessie G. Avatar answered Oct 03 '22 03:10

Jessie G.