I am working on a Windows server and access Oracle databases using the Oracle ODBC driver. I have Oracle ODBC connections that work fine on this machine.
However I want to add a new connection, and when testing it I get the error
Unable to connect SQL State=S1000 [Oracle][ODBC][Ora] ORA-12170: TNS: Connect timeout occurred I presume, though I am no DBA, that this has something to do with my TNS Service Name not being in TNSNAMES.ORA which points oracle toward the right server, port, etc.
However I cannot find TNSNAMES.ORA
I have an ORACLE_HOME environment variable, but it is empty.
Where can I find this file or otherwise configure my TNS names?
83 Answers
tnsnames.ora is located in the ORACLE_HOME\network\admin directory on Windows. Oracle home path is usually C:\app\oracle_account\product\12.1.0\dbhome_1 in windows.
How to find 'TNSNAMES.ORA' on Windows
Step 1) Please check if Oracle has been installed on your system. On Cmd, Type 'sql plus' 
- Then Control Panel -> Advanced System Settings ->
3)On the 'Advanced' tab, select 'Environment Variables' Then check 'Oracle ' or 'TNS_ADMIN' on System Variables.
- Here, on 'TNS_ADMIN' will get the path for TNS file
The path to the tns file can be listed in machine.config too.
<oracle.manageddataaccess.client> <version number="4.121.2.0"> <settings> <setting name="TNS_ADMIN" value="C:\app\client\...\product\12.1.0\client\network\admin"/> </settings> </version> </oracle.manageddataaccess.client> 1