oracle TNSnames.ora

1. location of  TNSnames.ora

C:\app\dingl\product\11.2.0\client_1\network\admin\tnsnames.ora

2. Use of the TNSnames.ora

Oracle provides a utility called tnsping:

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 on 27-AUG-20
08 10:38:07

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\Oracle92\network\ADMIN\sqlnet.ora
C:\Oracle92\network\ADMIN\tnsnames.ora

TNS-03505: Failed to resolve name

R:\>


R:\>tnsping entpr01

TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20
08 10:39:22

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\Oracle92\network\ADMIN\sqlnet.ora
C:\Oracle92\network\ADMIN\tnsnames.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = **)
 (PROTOCOL = TCP) (Host = ****) (Port = 1521))) (CONNECT_DATA = (SID = ENTPR0
1)))
OK (40 msec)

R:\>

This should show what file you're using. The utility sits in the Oracle bin 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 the ORACLE_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 in ORACLE_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 default ORACLE_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  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值