David Oneill
David Oneill

Reputation: 13075

SqlDeveloper: clear network alias list

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?

Upvotes: 3

Views: 8555

Answers (2)

John Suh
John Suh

Reputation: 11

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.

Upvotes: 1

David Oneill
David Oneill

Reputation: 13075

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.

Upvotes: 5

Related Questions