问题描述
我安装了 32 位和 64 位 Oracle 11g 驱动程序.我在我的电脑上搜索名为tnsnames.ora"的文件,并在以下位置找到了 3 个:
I installed both the 32 and 64-bit Oracle 11g drivers. I search my PC looking for files with the name "tnsnames.ora" and found 3 in the following locations:
1. C:Oracleproduct11203_32bitCLIENT_1NETWORKADMIN
2. C:Oracleproduct11203_64bitCLIENT_1NETWORKADMIN
3. C:WindowsTNS
tnsnames.ora 文件的第三个位置的存在让我感到惊讶.
The existence of the 3rd location of the tnsnames.ora file surprises me.
我的 PC 上安装了以下 Oracle 客户端:
I have the following Oracle clients installed on my PC:
"C:Program Files (x86)Quest SoftwareToad for Oracle 11.6Toad.exe"
"C:Program FilesDevartdbForge Studio Express for Oracledbforgeoracle.exe"
基于每个程序的位置(Program Files (x86) vs. c:Program Files),这向我建议 Toad,一个 32 位程序,应该使用 32 位驱动程序,dbForge 应该使用 64位驱动程序.
Based on the location of each program (Program Files (x86) vs. c:Program Files), This suggests to me that the Toad, a 32 bit program, should use the 32 bit driver and dbForge should use the 64 bit driver.
dbForge 似乎在位置 #2 或 #3 中使用 tnsnames.ora 文件.我通过系统地重命名除一个 tns 文件之外的所有文件,然后在尝试从应用程序创建新连接时检查从文件读取的连接名称是否可用来了解这一点.
dbForge seems to use either the tnsnames.ora file in either location #2 or #3. I know this by systematically renaming all but one of the tns files and then checking to see if the connection names read from the file are available when trying to create a new connection from with the app.
但是,TOAD 似乎只能识别位置 #3 中的 tnsnames.ora 文件,而根本无法识别位置 2 中的 tnsnames.ora 文件!(因为它是一个 32 位程序,我没想到它会识别位置 2 中的 tns 文件,情况确实如此).为了希望清楚起见,总结一下 TOAD 测试,TOAD 仅识别位置 3 中的 tns 文件.
However, TOAD seems to only recognize the tnsnames.ora file in location #3 and it did not recognize the tnsnames.ora file in location 2 at all! (Being that it was a 32 bit program, I did not expect it to recognize the tns file in location 2 and that was the case). TO summarize the TOAD test for the sake of hopeful clarity, TOAD only recognized the tns file in location 3.
其他同事在他们机器上的位置 3 中没有 tns 文件.我不确定我为什么这样做.当我运行 Toad 时,它显示以下 2 个主页,其中 32 位主页是活动的主页.
Other colleagues do not have a tns file in location 3 on their machines. I'm not sure why I do. When I run Toad, it shows the following 2 Home, with the 32 bit Home as being the active one.
OraClient11g_home1 (11.2.0.3)
ORACLE_HOME:C:appC39293product11.2.0client_1
ORACLE_HOME_NAME:OraClient11g_home1
ORACLE_HOME_KEY:HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraClient11g_home1
ORACLE_SID:
NLS_LANG:AMERICAN_AMERICA.WE8MSWIN1252
SQLPATH:
LOCAL:
Client DLL:C:appC39293product11.2.0client_1oci.dll
TNSNames.ora:
SQLNet.ora:
LDAP.ora:
Login.sql:
GLogin.sql:
In system PATH:No
Home is valid:No
OraClient11g_home1_32bit (11.2.0.3)
ORACLE_HOME:c:oracleproduct11203_32bitCLIENT_1
ORACLE_HOME_NAME:OraClient11g_home1_32bit
ORACLE_HOME_KEY:HKEY_LOCAL_MACHINESOFTWAREORACLEKEY_OraClient11g_home1_32bit
ORACLE_SID:
NLS_LANG:AMERICAN_AMERICA.WE8MSWIN1252
SQLPATH:c:oracleproduct11203_32bitCLIENT_1dbs
LOCAL:
Client DLL:c:oracleproduct11203_32bitCLIENT_1inoci.dll
TNSNames.ora:
SQLNet.ora:
LDAP.ora:
Login.sql:
GLogin.sql:c:oracleproduct11203_32bitCLIENT_1sqlplusadminglogin.sql
In system PATH:Yes
问题 1: OraClient11g_home1 是我的 64 位家庭版还是我安装了两个 Oracle 客户端?
Q1: Is OraClient11g_home1 my 64 bit home or do I have two Oracle clients installed?
问题 2: 为什么 32 位 TOAD 不使用位置 #1 中的 tns,而只使用位置 #3 中的 tns?
Q2: Why doesn't 32 bit TOAD use the tns in location #1 instead of only using the one in location #3?
Q3:如果我留在位置 3 的 tns 文件上,dbForge 和 TOAD 都可以工作,但我想知道为什么这样我才能准确地了解如何将 tns 信息从一台机器移动到另一个.
Q3: If I leave on the tns file in location 3, both dbForge and TOAD work but I'd like to know why so I can accurately understand how to move tns info from one machine to another.
推荐答案
仅根据您的路径,您怀疑安装了两个客户端(Toad 和 dbforge 是工具,而不是客户端,因此您的术语有点偏离).一个是 32 位的,另一个是 64 位的.根据其安装路径,Toad 似乎是 32 位的,但执行它并转到 Help|Support Bundle.您会看到顶部标题是应用程序信息(32 位)"或应用程序信息(64 位)",只是为了确认.Toad 11.6 是第一个引入 64 位版本的.
Just based on your paths you have two installed clients as you suspect (Toad and dbforge are tools, not clients so your terminology is a bit off). One 32-bit, the other 64-bit. It appears that Toad is 32-bit based on its installation path, but execute it and go to Help|Support Bundle. You'll see the top header will be "APPLICATION INFORMATION (32-bit)" or "APPLICATION INFORMATION (64-bit)" just to confirm. Toad 11.6 was the first to introduce a 64-bit version.
Toad 只会看到与其相同平台的 Oracle 客户端.因此,您的 64 位客户端与 Toad 无关.C:WindowsTNS 似乎是用于 TNS_ADMIN 文件夹的文件夹,因为它的位置很奇怪,而且 Toad 可以看到它.在命令提示符下执行 SET TNS_ADMIN 并查看它是否报告TNS_ADMIN=C:WindowsTNS" 如果是,则所有工具都应该使用该 tnsnames.ora.如果您将其指向包含网络配置文件的文件夹,则这是全局覆盖.如果您没有将 TNS_ADMIN 设置为环境变量,请在您的 Oracle 根注册表中查找它:HKEY_LOCAL_MACHINESoftwareOracle.
Toad will only see the Oracle client that is for the same platform as it. So your 64-bit client is irrelevant for Toad's sake. The C:WindowsTNS appears to be a folder used for TNS_ADMIN folder given its odd location and the fact that Toad sees it. At command prompt execute SET TNS_ADMIN and see if it reports "TNS_ADMIN=C:WindowsTNS" If it does, then all Tools should be using that tnsnames.ora. That's a global override if you will that points to the folder containing your net configuration files. If you don't have TNS_ADMIN set as an environment variable then look for it in your Oracle root registry: HKEY_LOCAL_MACHINESoftwareOracle.
如果您为所有工具使用一组通用连接,我会删除您的所有 tnsnames.ora 文件.我还会将该 C:WindowsTNS 文件夹重新定位到更合适的位置,例如 C:OracleAdmin 并在那里创建您的 tnsnames.ora、sqlnet.ora 和 ldap.ora(如果适用).创建一个指向该位置的 TNS_ADMIN 环境变量.
If you use a common set of connections for all of your tools I'd delete all of your tnsnames.ora files. I'd also relocate that C:WindowsTNS folder to somewhere more appropriate like C:OracleAdmin and create your tnsnames.ora, sqlnet.ora, and ldap.ora (if applicable) there. Create a TNS_ADMIN environment variable pointing to that location.
这篇关于确定相关 tnsnames.ora 文件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!