Linux – How to find out which tnsnames.ora file is being used by the linux system

linuxoracle

When I do an updatedb and locate tnsnames.ora I get back a long list due to various Oracle DB installations. I need to add some entries to whichever is the "default" tnsnames.ora configured for the system.

How do I find out which of the many tnsnames.ora files is actually being used?

note: none of the 30 odd instances are under any "system" folders (e.g. /etc /usr etc) and:

> echo $TNS_ADMIN
TNS_ADMIN: Undefined variable.
> echo $PATH
/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/ade/bin:/usr/NX/bin
> echo $ORACLE_HOME
ORACLE_HOME: Undefined variable.

RHEL4

Best Answer

If $TNS_ADMIN is not set, then the tnsnames.ora should be in $ORACLE_HOME/network/admin/.

You can find more explanations on tnsnames.ora in Net Services Reference book.

To determine the value of $ORACLE_HOME, you can look at the file /etc/oratab. This file lists database, the associated $ORACLE_HOME and if the DB must be started/stopped automatically.

You can also find some informations in the oraInventory (have a look at /etc/oraInventory folder or /etc/oraInst.loc file)

Related Topic