您的当前位置:首页正文

关于TNS_ADMIN环境变量

来源:华佗健康网
关于TNS_ADMIN环境变量

这⾥我补充⼀句:TNS_ADMIN正常是写客户端的路径(但是很奇怪,我改成服务端的居然也不影响访问,我服务端客户端都在本地)很多oracle产品都有⾃⼰的TNS⽂件,如果你的系统⾥装了多个Oracle的产品的话,那么客户端连instance的时候,到底是使⽤那个tnsnames.ora呢?这个时候就需要看TNS_ADMIN这个参数了。

Question: What is the tns_admin parameter and how do I use tns_admin to define a common location for my TNS files?

Answer: The tns_admin parameter determines the location of the tns administration files (e.g. tnsnames.ora and listener.ora, etc.)

The tns_admin parameter is super useful on servers with many databases on different release levels (hence different $ORACLE_HOMEdirectories) because all databases tns_admin values can be set to a single location, allowing a single set of SQL*Net files for all databaseson the server.

Without the tns_admin variable, each instance would have it's own set of TNS files in the $ORACLE_HOME/network/admin directory.查看⽅法:命令⾏

C:\\Documents and Settings\\ptian>set TNS_ADMIN

TNS_ADMIN=D:\\oracle\\product\\10.1.0\\Db_1\\NETWORK\\ADMIN

这就表⽰客户端会从D:\\oracle\\product\\10.1.0\\Db_1\\NETWORK\\ADMIN下读取TNS的设置

因篇幅问题不能全部显示,请点此查看更多更全内容