設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 1709|回復: 0
打印 上一主題 下一主題

Setting the TNS_ADMIN Environment Variable

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2019-12-2 12:13:12 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
The TNS_ADMIN  environment variable is used to specify the directory location for the tnsnames.ora file.
The TNS_ADMIN environment variable can be defined in the following ways:


1.       Access the Windows registry by clicking: Start  Run  regedit
2. Add the TNS_ADMIN environment variable to the HKEY_LOCAL_MACHINE\Software\Oracle\ORACLE_HOME key by right mouse clicking, and then selecting: New  Key  String Value

If you are unsure where to set TNS_ADMIN in the registry, see the ORACLE_HOME\bin\oracle.key file which provides the location of the registry key used by executables within that home.

Each time a different Oracle version is installed on Windows, the default location to which SQL*Net files are generated is the ORACLE_HOME\network\admin directory.

TNS_ADMIN may also be defined as a system-wide or global variable within the operating system.  To do so:
1.      Logon as Administrator
2.      Click Start  Settings  Control Panel
3.      Double click the SYSTEM icon
4.      From System Properties, select Environment tab
5.      Highlight OS in the list of Systems Variables
6.      Change the Variable from OS to TNS_ADMIN
7.      Change the Value to the file path where the configuration files will reside.   
         For example: c:\oranwin\network\admin.
8.      Click set, then apply
9.      Click OK to close window
    Changing TNS_ADMIN at the Session Level
For temporary usage, the TNS_ADMIN may also be defined for a given DOS prompt by using the set command:

C:\> set tns_admin=c:\temp

According to the docs, the precedence in which Oracle Net
                Configuration files are resolved is:
               

                           
  • Oracle Net files in present working directory (PWD/CWD)
                           
  • TNS_ADMIN set for each session session or by a user-defined script
                           
  • TNS_ADMIN set as a global environment variable
                           
  • TNS_ADMIN as defined in the registry
                           
  • Oracle Net files in %ORACLE_HOME/network/admin
    (Oracle default location)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-16 00:59 , Processed in 0.268522 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表