Oracle Network Products Getting Started for Windows Platforms | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Understanding the TNSNAMES.ORA File
The TNSNAMES.ORA file is used by clients and distributed database servers to identify potential server destinations.
################
# Filename......: tnsnames.ora
# Name..........: LOCAL_REGION.world
# Date..........: 04-DEC-96 13:50:40
################
<service_name>.world = <---world is the domain name
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = <---listener address
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = <server _name>) <---or, use IP address of NT server
(PORT = 1521) <---must match port in LISTENER.ORA file
)
)
(CONNECT_DATA =
(SID = <SID>)) <---database name, default is ORCL
(SOURCE_ROUTE=yes)
)
)
TNSNAMES.ORA is comprised of two parts:
CONNECT_DATA SID Keyword
SQL*Net uses the CONNECT_DATA keyword to denote the SID of the remote database. When SQL*Net on the server side receives the connection request, TNS passes the CONNECT_DATA contents to the network listener, which identifies the desired database.
(CONNECT_DATA =
(SID = ORCL)
<Alias>.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = community_name)
(protocol adapter information)
)
)
(CONNECT_DATA =
(SID = SID)
)
)See Table E-1, "Oracle Protocol Adapter Parameters" in this appendix for a description of the keywords.
Specifying Service Names
All connect descriptors are assigned service names (or database aliases) in the TNSNAMES.ORA file. The user specifies the service name--a single word rather than the lengthier connect descriptor--to identify the database to which to connect. The TNSNAMES.ORA file consists of a series of service names mapped to TNS connect descriptors.
|
|
Specifying TCP/IP Addresses
When using the TCP/IP Protocol Adapter, specify the address of a TNS-based application in the following format:
(ADDRESS =
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = server_name)
(PORT = port_number)
|
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = GREENWOOD)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY = SPX.world)
(PROTOCOL = SPX)
(SERVICE = tns_application)
|
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SPX.world)
(PROTOCOL = SPX)
(SERVICE = ORCL_LSNR)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY = NMP.world)
(PROTOCOL = NMP)
(SERVER = server_name)
(PIPE = pipe _name)
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = NMP.WORLD)
(PROTOCOL = NMP)
(SERVER = GREENWOOD)
(PIPE = dbpipe0)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY = community_name)
(PROTOCOL = DECNet)
(NODE = DecNet_node_name)
(OBJECT = database_alias)
testdnt.sample =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = desktopdecnet.sample)
(PROTOCOL = DECnet)
(NODE = 19.470)
(OBJECT = ORACLE733)
)
(CONNECT_DATA =
(SID = ORACLE7)
)
)
)
(ADDRESS =
(COMMUNITY = NTB.world)
(PROTOCOL = NTB)
(NTBNAME = ntb_name)
|
GREEN =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = NTB.world)
(PROTOCOL = NTB)
(NTBNAME = GREENWOOD)
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL=LU62)
(TPN= tpn_name)
(MODE=ORAPLU62)
(PARTNER_LU_NAME = "partner_lu_name")
(LLU_NAME = local_lu_name)
|
|
mvs.world = (DESCRIPTION =
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL=LU62)
(TPN=RECVTP)
(MODE=ORAPLU62)
(PARTNER_LU_NAME = "ORACLE.TNSORAK")
(LLU = SENDLU)
)
(CONNECT_DATA=(SID=ORCL)
)
)
nt.world = (DESCRIPTION =
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL=LU62)
(TPN=RECVTP)
(MODE=ORAPLU62)
(PARTNER_LU_NAME = "ORACLE.HQEW001")
(LLU = SENDLU)
)
(CONNECT_DATA=(SID=ORCL)
)
)
To contact an Oracle7 server using the LU6.2 protocol, the following parameters are needed:
Parameter | Description |
PLU_LA | |
Logical unit (LU) partner name, LU_NAME
| |
Transaction program (TP) name, TP_NAME | |
MODE |
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL = LU62)
(LU_NAME = lu_name)
(TP_NAME = tpn_name)
(MODE = mode_name)When using the NSD.INI file (for NS/WIN), specify the TNS-based application as follows:
If you choose NSD.INI file (for NS/WIN), the TP_NAME, LU_NAME, and MODE are taken from the PLU_LA alias, and your TNSNAMES.ORA entry is simpler:
(ADDRESS =
(COMMUNITY= LU62.world)
(PROTOCOL = LU6.2)
(PLU_LA = partner_lu_alias)TP_NAME, LU_NAME, and MODE are specified in the NSD.INI file.
|
Specifying Bequeath Addresses
When you configure TNSNAMES.ORA and specify the Bequeath Protocol Adapter, the following address appears in TNSNAMES.ORA:
(ADDRESS =
(COMMUNITY = beq.world)
(PROTOCOL = BEQ)
(PROGRAM = oracle73)
(ARGV0 = oracle73SID)
(ARGS = `(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
GREEN.world =
(DESCRIPTION =
(ADDRESS_LIST =
(COMMUNITY = beq.world)
(PROTOCOL = BEQ)
(PROGRAM = oracle73)
(ARGV0 = oracle73SID)
(ARGS = `(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
)
)
(CONNECT_DATA =
(SID = ORCL)
)
)
|
A sample file is shown in Figure E-2
################
# Filename......: sqlnet.ora
# Name..........: TCP.world
# Date..........: 04-DEC-96 13:50:40
################
AUTOMATIC_IPC = OFF <---set this to OFF if you do not wish to use IPC
TRACE_LEVEL_CLIENT = OFF <---set this to 16 if tracing is required
names.directory_path = (TNSNAMES)
names.default_domain = world
name.default_zone = world
Specify this parameter in the Connection Expire Time field of the Client Profile property sheet of Oracle Network Manager for Windows. Enter the time, in minutes, between probes for a dead connection. The range of possible values is from one to a very large number. However, a value of approximately 10 is recommended. If no value is entered in this field, the broken connections remain indefinitely.
Dead connection detection has costs associated with it:
|
|
All errors that occur in SQL*Net are written to log files, while detailed sequences of events as they happen are written to trace files. Trace files provide more information than log files.
|
Understanding the IPC Parameter
The IPC (interprocess communication parameter), AUTOMATIC_IPC, determines if SQL*Net attempts to connect to a database locally or through the network first. If the parameter is set to ON, SQL*Net looks for an IPC address and then goes through the network; if the parameter is set to OFF, SQL*Net does not look for an IPC address and goes directly to the network. Understanding Authentication, Encryption, and Checksumming Parameters
Authentication, data encryption, and checksumming parameters ensure secure transmission of data over networks. Authentication is available with or without ANO. Encryption and checksumming parameters are only available without ANO.
|
Understanding the LISTENER.ORA File
The LISTENER.ORA file is the configuration file for the listener. It resides on the server and defines:
|
###########
# FILENAME: listener.ora
# NAME....: Sever name
# Date..........: 04-DEC-96 13:50:40
###########
LISTENER =
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL=IPC) <---IPC is the internal protocol
(KEY= service_name) <---automatically added, but necessary
)
(ADDRESS=
(PROTOCOL=IPC)
(KEY =SID)
)
(ADDRESS =
(COMMUNITY = TCP.world)
(PROTOCOL = TCP)
(HOST = host_name) <---or, use the IP address of NT server
(PORT = 1521)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = ADMIN
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = SID) <---Database system identifier, default is ORCL
)
)
PASSWORDS_LISTENER = (oracle)
The IPC address format, which is the same across platforms, is as follows:
(ADDRESS=Oracle Network Manager and SQL*Net Easy Configuration create two IPC addresses for each database for which a listener queries. In one, the key value is equal to the service name. This IPC address is used for connections from other applications on the same node. Service names are described in the section "Understanding the TNSNAMES.ORA File" in this appendix. In the other IPC address, the key value is equal to the database SID, which is described in the next section. This IPC address is used by the database dispatcher to identify the listener.
(PROTOCOL=IPC)
(KEY=string)
|
LU6.2 Addresses
The listener must have a fully qualified local lu name rather than a partner lu name that may be specified in the TNSNAMES.ORA. Below is a sample LU6.2 address:
(ADDRESS=
(PROTOCOL= LU62)
(TPN = RECVTP)
(LLU_NAME = "ORACLE.HQEW001")
(MODE = ORAPLU62)
)
SID_LIST_listener_name=
(SID_LIST =
(SID_DESC =
(SID_NAME = SID)
)
)
The SID is the Oracle SID of the database server.
(SID_NAME = db2)
)
)
|
|
Using the Dynamic Discovery Option
Clients do no need a TNSNAMES.ORA file if the Oracle Names Server is used. If the TNSNAMES.ORA is created, the client first uses it to resolve the service name before resolving it through the Names Server's DDO. A SQL*Net server requires the following entries in the LISTENER.ORA file for a listener to register itself as a service to a well-known Oracle Names Server:
SID_LIST_listener_name=
(SID_LIST =
(SID_DESC =
(SID_NAME = ORCL)
(GLOBAL_DBNAME = ORCL.world)
)
USE_PLUG_AND_PLAY_listener_name=ONwhere listener_name is the name of the listener. LISTENER is the name of the default listener.
GLOBAL_DBNAME | Specifies the names of the database instance. It must be globally unique. |
USE_PLUG_AND_PLAY | Instructs the listener to find and register with a well-known Oracle Names Server. |
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |