确定相关tnsnames.ora文件的位置 [英] Determining location of relevant tnsnames.ora file

查看:139
本文介绍了确定相关tnsnames.ora文件的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我同时安装了32位和64位Oracle 11g驱动程序.我在PC上搜索名称为"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:\Oracle\product\11203_32bit\CLIENT_1\NETWORK\ADMIN
2. C:\Oracle\product\11203_64bit\CLIENT_1\NETWORK\ADMIN
3. C:\Windows\TNS

tnsnames.ora文件的第3个位置的存在使我感到惊讶.

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 Software\Toad for Oracle 11.6\Toad.exe"
"C:\Program Files\Devart\dbForge Studio Express for Oracle\dbforgeoracle.exe"

根据每个程序的位置(程序文件(x86)与c:\ Program Files),这向我建议32位程序Toad应该使用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文件以外的所有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个Home,其中32位Home是活动的Home.

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:\app\C39293\product\11.2.0\client_1
    ORACLE_HOME_NAME:OraClient11g_home1
    ORACLE_HOME_KEY:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient11g_home1
    ORACLE_SID:
    NLS_LANG:AMERICAN_AMERICA.WE8MSWIN1252
    SQLPATH:
    LOCAL:
    Client DLL:C:\app\C39293\product\11.2.0\client_1\oci.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:\oracle\product\11203_32bit\CLIENT_1
    ORACLE_HOME_NAME:OraClient11g_home1_32bit
    ORACLE_HOME_KEY:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient11g_home1_32bit
    ORACLE_SID:
    NLS_LANG:AMERICAN_AMERICA.WE8MSWIN1252
    SQLPATH:c:\oracle\product\11203_32bit\CLIENT_1\dbs
    LOCAL:
    Client DLL:c:\oracle\product\11203_32bit\CLIENT_1\bin\oci.dll
    TNSNames.ora:
    SQLNet.ora:
    LDAP.ora:
    Login.sql:
    GLogin.sql:c:\oracle\product\11203_32bit\CLIENT_1\sqlplus\admin\glogin.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?

第二季度:为什么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?

第3季度:如果我将tns文件留在3号位置,则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位的,但是请执行它并转到帮助" |支持捆绑包".您将看到顶部标头将是"APPLICATION INFORMATION(32位)"或"APPLICATION INFORMATION(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客户端.因此,就Toad而言,您的64位客户端无关紧要.考虑到C:\ Windows \ TNS的奇数位置以及Toad看到的事实,它似乎是用于TNS_ADMIN文件夹的文件夹.在命令提示符处,执行SET TNS_ADMIN并查看它是否报告"TNS_ADMIN = C:\ Windows \ TNS".如果显示,则所有工具都应使用该tnsnames.ora.如果您要指向包含网络配置文件的文件夹,则这是全局替代.如果您没有将TNS_ADMIN设置为环境变量,请在Oracle根注册表中查找它:HKEY_LOCAL_MACHINE \ Software \ Oracle.

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:\Windows\TNS 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:\Windows\TNS" 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_MACHINE\Software\Oracle.

如果您对所有工具使用一组通用的连接,我将删除所有tnsnames.ora文件.我还将C:\ Windows \ TNS文件夹重新放置到更合适的位置,例如C:\ Oracle \ Admin,然后在其中创建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:\Windows\TNS folder to somewhere more appropriate like C:\Oracle\Admin 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文件的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆