Tnsnames.ora [DOCS] is a configuration file for SQL*Net that describes the network service names for the databases in your organization. Basically, it tells Oracle applications how to find your databases.
This post is just a quick overview on how to get SQL Developer to ‘see’ this file and define a connection.
There’s only a single prerequisite for having SQL Developer setup such that it can use TNSNAMES to connect:
- You have somewhere a tnsnames.ora file
You don’t need a client, instant or otherwise, on your machine. You just need the file.
Now, if you DO you have a client or HOME on your machine, SQL Developer will look for those and find the tnsnames file for you. IF we can’t find it at the usual places, you can simply tell us where it is via this preference:
Once you’ve done this, assuming you have a file (or 10) in that directory, we’ll read it, parse it, and list the entries in the connection dialog.
That’s right, files. Just like SQL*Plus, we’ll read any file that starts with ‘tnsnames’ – that includes files you’ve renamed to .bak or .old. Kris talks about that more here. I have just the one, which is all I need anyway.
Defining the Connection
Just set the connection type to TNS.
No Client or Home Required
That’s right. You don’t need an Oracle Client or $ORACLE_HOME to have SQL Developer see and read a TNS file.
Just so you know I’m not cheating…
I’m able to define a new connection AND connect with these preferences ON|OFF.