Sqldeveloper 设置TNS 链接配置文件

Sqldeveloper介绍:

Oracle SQL Developer is a free and fully supported graphical tool for database development. With SQL Developer, you can browse database objects, run SQL statements and SQL scripts, and edit and debug PL/SQL statements. You can also run any number of provided reports, as well as create and save your own. SQL Developer enhances productivity and simplifies your database development tasks

sqldeveloper查找TNS文件的规则:

When you start SQL Developer and whenever you display the database connections dialog box, SQL Developer automatically reads any connections defined in the tnsnames.ora file on your system, if that file exists. You can specify the tnsnames.ora location in the Database: Advanced preferences.By default, tnsnames.ora is located in the $ORACLE_HOME/network/admin directory, but it can also be in the directory specified by the TNS_ADMIN environment variable or registry value or (on Linux systems) the global configuration directory. On Windows systems, if the tnsnames.ora file exists but its connections are not being used by SQL Developer, define TNS_ADMIN as a system environment variable. For information about the tnsnames.ora file, see the "Local Naming Parameters (tnsnames.ora)" chapter in Oracle Database Net Services Reference.

配置环境变量TNS_ADMIN,TNS_NAME,ORACLE_HOME 对于没有安装oracle 或 oracle client的环境,一般不会设置这两个环境变量。
我的系统是oracle linux x86_64,虽然安装有Oracle但是没有设定开机载入环境变量,所以最方便的还是直接在 Tools -> Preferences -> Database -> Advanced 下面直接指定 Tnsnames Directory. 然后把需要的 tnsnames.ora文件copy 一份在该目录下。





然后重启sqldeveloper,就可一在新建数据库链接的时候找到tns 定义了




猜你喜欢

转载自yutianc.iteye.com/blog/2151612
今日推荐