Where is TNSNAMES.ORA?

41,529

Solution 1

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.

Solution 2

How to find 'TNSNAMES.ORA' on Windows

Step 1) Please check if Oracle has been installed on your system. On Cmd, Type 'sql plus' enter image description here

  1. Then Control Panel -> Advanced System Settings ->

enter image description here

3)On the 'Advanced' tab, select 'Environment Variables' Then check 'Oracle ' or 'TNS_ADMIN' on System Variables.

enter image description here

  1. Here, on 'TNS_ADMIN' will get the path for TNS file

enter image description here

Share:
41,529

Related videos on Youtube

Alexis Eggermont
Author by

Alexis Eggermont

Updated on March 24, 2022

Comments

  • Alexis Eggermont
    Alexis Eggermont about 2 years

    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?

    • shree.pat18
      shree.pat18 over 8 years
    • Shannon Severance
      Shannon Severance over 8 years
      attrib /s tnsnames.ora
    • Bob Jarvis - Слава Україні
      Bob Jarvis - Слава Україні over 8 years
      cd c:\ then dir /s tnsnames.ora
    • Alexis Eggermont
      Alexis Eggermont over 8 years
      Yes but it refers either to the TNS_ADMIN environment variable, which I don't have, or to ORACLE_HOME, which is empty
    • Alexis Eggermont
      Alexis Eggermont over 8 years
      both of these get me 'file not found', and yet I definitely have working processes which use the ODBC driver configured with a TNS Service Name.
    • Alexis Eggermont
      Alexis Eggermont over 8 years
      Solved. I was able to use IP:port/service name instead of the TNSNAME. I think there is simply no TNSNAMES.ORA on that computer.
    • Wernfried Domscheit
      Wernfried Domscheit over 8 years
      TNS: Connect timeout occurred sounds more like a network problem or firewall issue, not a missing tnsnames.ora file.
  • Christopher Jones
    Christopher Jones about 2 years
    That's a good general solution. The interesting thing about the actual value in your answer is that it appears to be a default location that the Oracle libraries will use anyway. I.e you don't need to set TNS_ADMIN at all for ODBC in this case.