Monday 23 September 2013

Tnsnames.ora

Add the following entry in your TNSNAMES.ORA file and change the values shown in brackets to suit your environment:
<addressname> =
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(Host = <hostname>)(Port = <port>))
   )
 (CONNECT_DATA =
   (SERVICE_NAME = <sid>)
 )
)
Here is a completed example:
ORA11 =
 (DESCRIPTION = 
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
   )
 (CONNECT_DATA =
   (SERVICE_NAME = ORA11)
 )
)
The TNSNAMES.ORA files are located on both client and server systems. If you make configuration changes on the server ($ORACLE_HOME/network/admin/tnsnames.ora) ensure you can connect to the database through the listener if you are logged on to the server. If you make configuration changes on the client (c:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora) ensure you can connect from your client workstation to the database through the listener running on the server.

[edit]SQL*Net Easy Configurator

One can also use the SQL*Net Easy Configurator GUI (which is 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 plug in the required settings. However, others might prefer the GUI. 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 (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).

No comments:

Post a Comment