Question

I would like to modify TNSNAMES.ORA file to connect to an ORACLE Database and I noticed that on my PC there are 3 different files with name TNSNAMES.ORA files. Which of these three should I modify in order to make connection

D:\app\XXX\product\11.2.0\client_32\network\admin
E:\app\XXX\product\11.2.0\client_64\network\admin
D:\app\XXX\product\11.2.0\client_1\network\admin
Was it helpful?

Solution

You may start command prompt using windows commanline cmd and use below:

tnsping any_random_name

tnsping

as you can see in the image, it uses parameter file where sqlnet.ora exists. This is the folder where your current oracle installation points to. You should make change in that folder's tnsnames.ora.

OTHER TIPS

It depends!

Any application can set up its own run-time environment to use any Oracle Client that you have installed, each of which could use a different tnsnames.ora file. Luckily for us, most of them don't.

Certainly your 32-bit and 64-bit clients will look in different locations - by default.

You could set the TNS_ADMIN environment variable to a particular directory and everything would use that (all other things being equal) or, as long as you're not making use of the Oracle "Managed" driver, you can embed this directive into each of the individual tnsnames.ora files, effectively "including" a common file to be used by all of them (sadly, the "Managed" driver no longer supports this).

ifile=C:\One-in-all-TnsNames.ora
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top