Use tnsnames.ora in Oracle SQL Developer

I am evaluating Oracle SQL Developer.

My tnsnames.ora is populated, and a tnsping to a connection defined in tnsnames.ora works fine. Still, SQL Developer does not display any connections.

Oracle SQL Developer Soars mentions, that if

you have Oracle client software and a tnsnames.ora file already installed on your machine, Oracle SQL Developer will automatically populate the Connections navigator from the net service names defined in tnsnames.ora.

I also tried to set my TNS_ADMIN environment variable, but after restarting SQL Developer there are still no connections displayed.

Any ideas?
Anyone successfully working with SQL Developer and tnsnames.ora?


  • In SQLDeveloper browse Tools --> Preferences , as shown in below image.



  • In the Preferences options expand Database --> select Advanced --> under "Tnsnames Directory" --> Browse the directory where tnsnames.ora present.
  • Then click on Ok , as shown in below diagram.
    tnsnames.ora available at Drive:oracleproduct10x.xxclient_xNETWORKADMIN

    SQLDeveloper更新tnsnames目录
  • Now you can connect via the TNSnames options.


    This excellent answer to a similar question (that I could not find before, unfortunately) helped me solve the problem.

    Copying Content from referenced answer :

    SQL Developer will look in the following location in this order for a tnsnames.ora file

    $HOME/.tnsnames.ora
    $TNS_ADMIN/tnsnames.ora
    TNS_ADMIN lookup key in the registry
    /etc/tnsnames.ora ( non-windows )
    $ORACLE_HOME/network/admin/tnsnames.ora
    LocalMachineSOFTWAREORACLEORACLE_HOME_KEY
    LocalMachineSOFTWAREORACLEORACLE_HOME

    If your tnsnames.ora file is not getting recognized, use the following procedure:

    Define an environmental variable called TNS_ADMIN to point to the folder that contains your tnsnames.ora file.

    In Windows, this is done by navigating to Control Panel > System > Advanced system settings > Environment Variables...
    In Linux, define the TNS_ADMIN variable in the .profile file in your home directory.

    Confirm the os is recognizing this environmental variable

    From the Windows command line: echo %TNS_ADMIN%

    From linux: echo $TNS_ADMIN

    Restart SQL Developer Now in SQL Developer right click on Connections and select New Connection.... Select TNS as connection type in the drop down box. Your entries from tnsnames.ora should now display here.


    I had the same problem, tnsnames.ora worked fine for all other tools but SQL Developer would not use it. I tried all the suggestions on the web I could find, including the solutions on the link provided here.
    Nothing worked.

    It turns out that the database was caching backup copies of tnsnames.ora like tnsnames.ora.bk2 , tnsnames09042811AM4501.bak , tnsnames.ora.bk etc. These files were not readable by the average user.

    I suspect sqldeveloper is pattern matching for the name and it was trying to read one of these backup copies and couldn't. So it just fails gracefully and shows nothing in drop down list.

    The solution is to make all the files readable or delete or move the backup copies out of the Admin directory.

    链接地址: http://www.djcxy.com/p/83726.html

    上一篇: 在Oracle上使用内连接更新语句

    下一篇: 在Oracle SQL Developer中使用tnsnames.ora