SqlDeveloper: clear network alias list

David Oneill picture David Oneill · Jun 20, 2011 · Viewed 7.7k times · Source

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?

Answer

David Oneill picture David Oneill · Jun 20, 2011

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.