SqlDeveloper:清除网络别名列表
我使用 sql-developer 连接到具有多个不同用户的多个不同的 Oracle 数据库。连接信息保存在 tnsnames.ora
文件中,这样当数据库更改服务器时,我不必手动更新与其的所有连接。我最近更新了 tnsnames 文件,现在网络别名列表中每个应该存在的条目都有 2 个条目。第二个条目似乎有效(当我测试连接时,IE 通过了测试)。然而,默认情况下,它似乎选择第一个条目,这是行不通的。
我怀疑这是由于这里的答案: 向 SQL Developer 添加新连接时不显示 Oracle TNS 名称 但是,该答案并未解决如何解决该问题。
那么,如何完全清除网络别名列表并强制它从文件中重新加载?
I use sql-developer to connect to several different oracle databases with several different users. The connection info is kept in a tnsnames.ora
file so that when a database changes servers, I don't have to manually update all my connections to it. I recently updated my tnsnames file, and now there are 2 entries in the network alias list for each one that should be there. The 2nd entry appears to work (IE passes the test when I test the connection). However, by default, it seems to choose the first entry, which doesn't work.
I suspect this is due to the answer here: Oracle TNS names not showing when adding new connection to SQL Developer however, that answer doesn't address how to fix that problem.
So, how do I completely clear the network alias list and force it to re-load from the file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它正在抓取我在同一文件夹中的 tnsnames.ora_OLD 的旧副本。根据:
http://forums.oracle.com/forums/thread.jspa?threadID=1017751
“SQL Developer 的 TNS 名称功能有一个长期存在的功能,SQL Developer 将在其中找到所有匹配的 tnsnames.ora* 文件TNS Admin 目录并列出所有这些目录的内容,例如,TNSNAMES.ORA、TNSNAMES.ORA~ 和 TNSNAMES.ORA.201001210957 中定义的所有 TNS 别名都将包含在网络别名列表中。
删除该旧文件会删除多余的条目。
It was grabbing an old copy of tnsnames.ora_OLD that I had in the same folder. According to:
http://forums.oracle.com/forums/thread.jspa?threadID=1017751
"There is a longstanding feature with SQL Developer's TNS Names functionality where SQL Developer will find all of the matching tnsnames.ora* files in the TNS Admin directory and list the contents of all of them. For example, all of the TNS aliases defined in TNSNAMES.ORA, TNSNAMES.ORA~ and TNSNAMES.ORA.201001210957 will be included in the Network Alias list."
Deleting that old file removed the extra entries.
我发现重复的 TNS 名称来自以下两个文件;
tnsnames.ora AND tnsnames.~ora
两个选项;
选项 1. 删除文件“ tnsnames.~ora”
选项 2. 如果您必须将此“ tnsnames.~ora”保留在文件夹中,则将其重命名为“tnsnames~ora.txt”
** 请注意,如果您重命名它“tnsnames.~ora.txt”,它仍然会显示重复。
我的理解是,如果文件名以“tnsnames”开头并以“ora”结尾,
它会给你重复的 TNS 名称。
I found that duplicated TNS names came from following two files;
tnsnames.ora AND tnsnames.~ora
Two options;
option 1. delete file " tnsnames.~ora"
option 2. if you have to keep this " tnsnames.~ora" in the folder, then rename it to like "tnsnames~ora.txt"
** Please note, if you rename it "tnsnames.~ora.txt", it will still shows duplicated.
My understanding is that if filename start with "tnsnames" and ends with "ora",
it will gives you duplicated TNS names.