Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to find tnsnames.ora in SQL Developer?

I need to find the tnsnames.ora file for my connections. My servers are hosted remotely i.e. I dont have it installed on my physcial system.

like image 379
StanGeo Avatar asked Dec 21 '17 16:12

StanGeo


People also ask

How do I find the Tnsnames in SQL Developer?

In SQLDeveloper browse Tools --> Preferences , as shown in below image. In the Preferences options expand Database --> select Advanced --> under "Tnsnames Directory" --> Browse the directory where tnsnames. ora present. Then click on Ok, as shown in below diagram.

Where is Tnsnames Ora file located?

Place the tnsnames. ora file in the ORACLE_HOME\network\admin directory, and ensure that the ORACLE_HOME environment has been set to this Oracle home.

Does SQL Developer use Tnsnames Ora?

SQL Developer is installed on a machine which has multiple Oracle products installed. Each Oracle Home has its own tnsnames. ora file. This document describes the behavior of how SQL Developer picks tnsnames.


1 Answers

SQL Developer looks for tnsnames.ora files in the following locations:

  • your USER Home directory
  • $ORACLE_HOME\network\admin -- assumes you have a client installed
  • OS Environment Variable value for TNS_ADMIN
  • Registry entry for TNS_ADMIN
  • The location you specified in the preferences

enter image description here

The last one will trump the others.

You can see this for yourself in a SQL Worksheet, by running the command

show tns

enter image description here

You do not get a tnsnames.ora file 'for free.' Someone will need to build, maintain, and distribute one for and to you.

You can however connect to an Oracle Database without a TNSNames.ora file. Assuming you have all the information required (what's normally defined in the .ora file), you can make a 'Basic' connection.

enter image description here

Another quirk of the system - we actually read the entries in ANY file named tnsnames* - so if you have older versions of the file saved as something like tnsnames_old.ora or tnsnames.bak - we'll see and use those too, something SQL*Plus used to do and we were asked to follow as well.

like image 116
thatjeffsmith Avatar answered Nov 15 '22 08:11

thatjeffsmith