Oracle Configuration Tnsnames.ora File Instance
In order to connect with the server, the client must first contact the listening process on the server. Oracle describes the connection information through the connection descriptor in the Tnsnames.ora file. The general Tnsnames.ora is built on the client. In the case of a client/server structure, where only one machine on the entire network has an Oracle database server installed, you need to define the file on the server for each client you want to access the Oracle server. However, if more than one machine on the network has an Oracle database server installed and there is a requirement for data sharing between the servers, the file must be defined on each server. The Tnsnames.ora file is placed by default in the/oracle_home/product/8.1.7/network/admin directory. Here is the file style for Tnsnames.ora:
ORA817 =
(DESCRIPTION =
(Address_list =//Indicates that the client is connected to one or more servers via multiple protocols.) In this style file, it means that the client is connected to the server with the TCP/IP protocol.
(ADDRESS = (PROTOCOL = TCP) (HOST = sun62) (PORT = 1521))
)
(Connect_data =
(service_name = ora817.huawei.com)
)
)
Inst1_http =
(DESCRIPTION =
(address_list =
( ADDRESS = (PROTOCOL = TCP) (HOST = sun62) (PORT = 1521))
)
(connect_data =
& nbsp; (SERVER = SHARED)
(service_name = ora817.huawei.com)
(PRESENTATION = http://admin)
)
)
Extproc_connection_data =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC))
)
(Connect_data =
(SID = Plsextproc)
(PRESENTATION = RO)
)
)
The field has the following meanings:
Address_list indicates that the client is connected to one or more servers via multiple protocols. In this style file, it means that the client is connected to the server with the TCP/IP protocol.
PROTOCOL indicates the protocol to use for the connection.
Service_Name "Service_Name" is "Global database name", Oracle8i database uses "global database name" to uniquely identify itself, the usual format is "Name.domain", The value here is "ora817.huawei.com".
HOST is the server IP address used by the TCP/IP protocol.
Port is the address used by TCP/IP.
The SID specifies the ORACLE_SID of the Oracle database on the server to which you are connecting.
Server=dedicated indicates that the Oracle database is connected with a dedicated server.
Below is an example of a Tnsnames.ora file:
Ora = Connection descriptor name: Ora
(description = Description
( Address = One of the network addresses
(protocol = TCP) network protocol (TCP represents TCP/IP protocol)
(host = 129.9.114.22) Server IP address: 129.9.114.22
(port = 1251) Server port number: 1251
)
(connect_data = connection Data
(sid = Ora7) Database identification name: Ora7
)
)