What is the TNSNAMES.ORA file?

Question

What is the TNSNAMES.ORA file? Is there an example of this file for Oracle 10g that applies to OnGuard?

Answer

TNSNAMES.ORA is a SQL*Net configuration file that defines databases addresses for establishing connections to them. In Oracle 10g, this file normally resides on the database server in the $ORACLE_HOME\NETWORK\ADMIN directory, and on the client in the c:\oracle\product\10.2.0\db_1\network\admin directory.

The TNSNAMES.ORA files is located on both client and server systems. Configuration changes made on either the server or the client should be tested to ensure connectivity after the changes are made.

An example TNSNAMES.ORA file is shown below.

# tnsnames.ora Network Configuration File:
C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora     ?  actual path to file
# Generated by Oracle configuration tools.

LENEL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = LENLSERVER)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = LENEL)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

Applies To

OnGuard (All versions)
Oracle 10g

Additional Information

SQL*Net Easy Configurator

One can also use the SQL*Net Easy Configurator graphic user interface (which gets installed when you install the Oracle Client Software) to change TNSNAMES.ORA entries. Most people prefer to edit the TNSNAMES.ORA file with an editor and enter the required settings. However, others might prefer the graphical user interface. Note the file is usually found in the ORACLE HOME/network/admin/ directory.

SQL*Net Easy Configurator will guide you through a set of screens (using a wizard) to add as many entries as you like for each database you need to connect to. Also supply an alias name as prompted to identify each database. (The alias name and database name can be different.)

Reference: http://www.orafaq.com/wiki/Tnsnames.ora 

For more information about ORACLE HOME, refer to http://www.orafaq.com/wiki/ORACLE_HOME.