1. location of TNSnames.ora
C:\app\dingl\product\11.2.0\client_1\network\admin\tnsnames.ora
2. Use of theTNSnames.ora
Oracle provides a utility calledtnsping:
the rest commands like sqlplus/sqlldr all use it.
R:\>tnsping someconnection TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 Production on27AUG-20 0810:3807 Copyright (c)1997 Oracle Corporation. All rights reserved Used parameter files C:\Oracle92\networkADMINsqlnetora Ctnsnames.ora TNS-03505: Failed to resolve name R Rtnsping entpr01 TNS Ping Utility 3922ora Used TNSNAMES adapter to resolve the alias Attempting contact DESCRIPTION =ADDRESS_LIST ADDRESS COMMUNITY **)PROTOCOL TCPHost ****)Port 1521)))CONNECT_DATA SID ENTPR0 1 OK (40 msec:\>
This should show what file you're using. The utility sits in the Oraclebin
directory.
http://docs.oracle.com/cd/A59447_01/nt_804ee/doc/network.804/a55913/apc.htm
3.Oracle Network Products use the following configuration files:
On Your Server | On Your Client |
---|---|
CMAN.ORA |
sqlNET.ORA |
LISTENER.ORA |
TNSNAMES.ORA |
sqlNET.ORA |
|
TNSNAMES.ORA |
Below is a description of the configuration files:
Configuration File | Description |
---|---|
CMAN.ORA |
Contains Oracle Connection Manager parameters. |
LISTENER.ORA |
Includes service names and addresses of all network listeners on a machine,the system IDs (SIDs) of the databases for which they listen,and varIoUs control parameters used by the network listener. |
NAMES.ORA |
Contains control parameters for preferred Oracle Names Servers. This file is not needed for well-known Oracle Names Servers. |
sqlNET.ORA |
Includes optional diagnostic parameters,client information about Oracle Names Servers,and can contain other optional parameters. |
TNSNAMES.ORA |
Includes a list of service names of network databases mapped to connect descriptors. |
Note: It is possible to have system and local versions of TNSNAMES.ORA and sqlNET.ORA files. Any service name or parameter is first searched in the local version of the configuration file. If the service name or parameters is not found in the local version,it is searched in the system version. The system version is located in theORACLE_HOME\NET80\ADMIN directory. A local version can exist in the current working directory where the application is running. For example,if you start sql*Plus inORACLE_HOME\BIN,then Net8 looks for a local TNSNAMES.ORA in ORAWIN\BIN. If you start sql*Plus in \PLUS,then Net8 looks for a local TNSNAMES.ORA in \PLUS. A consequence of this is that you can have multiple local files in the varIoUs directories from which you start applications. In most cases,it is recommended that only one TNSNAMES.ORA file exist and that it be located in the defaultORACLE_HOME\NET80\ADMIN directory. |
A description of how the files are created is described below:
This file... | Is created... |
---|---|
CMAN.ORA |
during installation on the server |
LISTENER.ORA |
during installation on the server |
NAMES.ORA |
on the server by Oracle Net8 Assistant when configuring preferred Oracle Names Servers |
sqlNET.ORA |
during installation on the clients and server,and regenerated on the client by Oracle Net8 Assistant. |
TNSNAMES.ORA |
on the clients and server by Oracle Net8 Easy Config or Oracle Net8 Assistant |