用句点分隔的 oracle 连接标识符到底是什么处理
我想知道这个问题已经有一段时间了,但由于它没有出现太多,我把它留在了“神秘的魔法”专栏中。
在我看来,像 ABC 和 ABC.DEFG 这样的连接标识符之间存在某种关系,但我不太明白它是什么。
例如,我刚才设置的一台机器在使用 identfier ED2 时遇到问题,尽管在我的 tnsnames 文件中我清楚地看到
EDC2 = (....)
这是从另一台计算机复制并粘贴的,运行得很好。 但是,执行 tnsping EDC2 将无法解析,直到我将其更改为
EDC2.WORLD = (...)
解析为 EDC2 开始起作用为止。 这里发生了什么?
I've been wondering this for a while but since it hasn't come up much I've left it in the 'mysterious wizardy' column.
It seems to me that there is some sort of relationship between a connection identifier like ABC and ABC.DEFG and I don't quite get what it is.
For example, a machine I was setting up just now I was having problems with using the identfier ED2 even though in my tnsnames file I clearly had
EDC2 = (....)
This was copied and pasted from another computer which worked just fine. However, doing tnsping EDC2 would fail to resolve until I changed it to say
EDC2.WORLD = (...)
at which point resolving to EDC2 started working. What is going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参数交互
tnsnames.ora 文件中的 TNS 别名与sqlnet.ora 文件中的 。 例如,如果 NAMES.DEFAULT_DOMAIN 设置为 WORLD,那么当您尝试连接到没有域的别名时,sqlnet.ora 文件会告诉 Oracle 在进行查找之前自动附加域。 tnsnames.ora 文件。 如果您尝试连接到具有域的别名,
NAMES.DEFAULT_DOMAIN
将被忽略。我的一般偏好/建议是在 sqlnet.ora 中将 NAMES.DEFAULT_DOMAIN 设置为 WORLD,并在 tnsnames.ora 文件中指定 EDC2.WORLD。 这样,连接标识符 EDC2 和 EDC2.WORLD 都将起作用 - 由于
DEFAULT_DOMAIN
参数,前者会更改为后者。The TNS alias in the tnsnames.ora file interacts with the parameter
in the sqlnet.ora file. If
NAMES.DEFAULT_DOMAIN
is set to WORLD, for example, then when you try to connect to an alias without a domain, the sqlnet.ora file tells Oracle to automatically append the domain before doing the lookup in the tnsnames.ora file. If you try to connect to an alias with a domain,NAMES.DEFAULT_DOMAIN
is ignored.My general preference/ suggestion is to set
NAMES.DEFAULT_DOMAIN
to WORLD in the sqlnet.ora and specify EDC2.WORLD in the tnsnames.ora file. That way, both the connect identifier EDC2 and EDC2.WORLD will work-- the former gets changed to the latter because of theDEFAULT_DOMAIN
parameter.