Use tnsnames.ora in Oracle SQL Developer

后端 未结 5 1750
野趣味
野趣味 2020-12-12 14:33

I am evaluating Oracle SQL Developer.

My tnsnames.ora is populated, and a tnsping to a connection defined in tnsnames.ora work

5条回答
  •  不知归路
    2020-12-12 15:09

    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
    LocalMachine\SOFTWARE\ORACLE\ORACLE_HOME_KEY
    LocalMachine\SOFTWARE\ORACLE\ORACLE_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.

提交回复
热议问题