Find TNSNames location in windows 7 and How to set a new TNSNAMES location in windows 7 , XP

September 16th, 2010 by Giridhar | Posted under Howtos.

Oracle uses TNSNAMES.ORA file to resolve its DB host name. tnsnames.ora files are stored in ORACLE_HOME/network/admin/ but it is not mandatory to store it there. Also there are situvation where your system may have multiple tnsnames.ora but oracle only check one single tnsnames.ora. So it is very important to find the right location.

In windows there is a system variable defined at the time of oracle installation, it is named TNS_ADMIN. This system variable is responsible for pointing you to the right location of TNSNAMES.ORA file. So to display the location of tnsnames.ora , type the following

c:\>echo %TNS_ADMIN%


If you want to change it to your custom location, you can have this system variable re-defined Windows.

C:\> set TNS_ADMIN=$PATH;ORACLE_HOME\network\admin

Tags:

Have any comments?