京东6.18大促主会场领京享红包更优惠

 找回密码
 立即注册

QQ登录

只需一步,快速开始

关于TNS_ADMIN环境变量

2018-5-6 15:09| 发布者: zhaojun917| 查看: 801| 评论: 0|原作者: 梦想之都-俊月星空

摘要: 很多oracle产品都有自己的TNS文件,如果你的系统里装了多个Oracle的产品的话,那么客户端连instance的时候,到底是使用那个tnsnames.ora呢?这个时候就需要看TNS_ADMIN这个参数了。Question:What is thetns_adminpar ...
很多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_HOME directories) because all databases tns_admin values can be set to a single location, allowing a single set of SQL*Net files for all databases on 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的设置

修改方法:
有两个地方可以修改,一个是注册表,一个是系统环境变量。
注册表的位置:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0\TNS_ADMIN
系统环境变量的优先级高于注册表,如果设置了环境变量,那么就会忽略注册表的值。
关闭

站长推荐上一条 /6 下一条

QQ|手机版|小黑屋|梦想之都-俊月星空 ( 粤ICP备18056059号 )|网站地图

GMT+8, 2025-7-2 05:39 , Processed in 0.041243 second(s), 19 queries .

Powered by Mxzdjyxk! X3.5

© 2001-2025 Discuz! Team.

返回顶部