Oracle9i Net Services Reference Guide Release 1 (9.0.1) Part Number A90155-01 |
|
This chapter provides a complete listing of the tnsnames.ora
file configuration parameters.
This chapter contains these topics:
This tnsnames.ora
file is a configuration file that contains net service names mapped to connect descriptors for the local naming method, or net service names mapped to listener protocol addresses.
A net service name is an alias mapped to a database network address contained in a connect descriptor. A connect descriptor contains the location of the listener through a protocol address and the service name of the database to which to connect. Clients and database servers (that are clients of other database servers) use the net service name when making a connection with an application.
By default, tnsnames.ora
is located in the $ORACLE_HOME/network/admin
directory on UNIX, and in the ORACLE_HOME
\network\admin
directory on Windows operating systems. tnsnames.ora
can also be stored in the directory specified by the TNS_ADMIN
environment variable or in the node's global configuration directory. For Sun Solaris, this directory is /var/opt/oracle
. Windows NT does not have a central directory.
The basic syntax for a tnsnames.ora
file is shown in Figure 7-1. DESCRIPTION
contains the connect descriptor, ADDRESS
contains the protocol address, and CONNECT_DATA
contains the database service identification information.
net_service_name= (DESCRIPTION=(ADDRESS=(
protocol_address_information))
(CONNECT_DATA= (SERVICE_NAME=service_name)))
A tnsnames.ora
file can contain net service names with one or more connect descriptors. Each connect descriptor can contain one or more protocol addresses. Figure 7-2 shows two connect descriptors with multiple addresses. DESCRIPTION_LIST
defines a list of connect descriptors.
net_service_name= (DESCRIPTION_LIST= (DESCRIPTION=(ADDRESS=(
protocol_address_information))
(ADDRESS=(
protocol_address_information))
(ADDRESS=(
protocol_address_information))
(CONNECT_DATA= (SERVICE_NAME=service_name))) (DESCRIPTION=(ADDRESS=(
protocol_address_information))
(ADDRESS=(
protocol_address_information))
(ADDRESS=(
protocol_address_information))
(CONNECT_DATA= (SERVICE_NAME=service_name))))
The tnsnames.ora
file also supports connect descriptors with multiple lists of addresses, each with its own characteristics. In Figure 7-2, two address lists are presented. The first address list features client load balancing and no connect-time failover, affecting only those protocol adresses within the ADDRESS_LIST
. The second protocol address list features connect-time failover and no client load loading balancing, affecting only those protocol addresses within the ADDRESS_LIST
. The client first tries either the first or second protocol address at random, then tries protocol addresses three and four sequentially.
net_service_name= (DESCRIPTION= (ADDRESS_LIST= (LOAD_BALANCE=on) (FAILOVER=off)(ADDRESS=(
protocol_address_information))
(ADDRESS=(
protocol_address_information)))
(ADDRESS_LIST= (LOAD_BALANCE=off) (FAILOVER=on)(ADDRESS=(
protocol_address_information))
(ADDRESS=(
protocol_address_information)))
(CONNECT_DATA= (SERVICE_NAME=service_name)))
When a connect descriptor in a tnsnames.ora
file contains at least two protocol addresses for Oracle Connection Manager, parameters for connect-time failover and load balancing can be included in the file.
Figure 7-4 illustrates failover of multiple Oracle Connection Manager protocol addresses.
sample1= (DESCRIPTION= (SOURCE_ROUTE=yes) (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(PORT=1630)) # hop 1 (ADDRESS_LIST= (FAILOVER=on) (LOAD_BALANCE=off) # hop 2 (ADDRESS=(PROTOCOL=tcp)(HOST=host2a)(PORT=1630)) (ADDRESS=(PROTOCOL=tcp)(HOST=host2b)(PORT=1630))) (ADDRESS=(PROTOCOL=tcp)(HOST=host3)(PORT=1521)) # hop 3 (CONNECT_DATA=(SERVICE_NAME=Sales.us.acme.com)))
In Figure 7-4:
(ADDRESS=(PROTOCOL=tcp)(HOST=host2a)(PORT=1630))
(ADDRESS_LIST= (FAILOVER=ON) (LOAD_BALANCE=off) (ADDRESS=(PROTOCOL=tcp)(HOST=host2a)(PORT=1630)) (ADDRESS=(PROTOCOL=tcp)(HOST=host2b)(PORT=1630))
(ADDRESS=(PROTOCOL=tcp)(HOST=host3)(PORT=1521))
Figure 7-5 illustrates client load balancing among two Oracle Connection Managers and two protocol addresses:
sample2= (DESCRIPTION= (LOAD_BALANCE=on) (FAILOVER=on) (ADDRESS_LIST= (SOURCE_ROUTE=yes) (ADDRESS=(PROTOCOL=tcp)(HOST=host1)(PORT=1630)) (ADDRESS=(PROTOCOL=tcp)(HOST=host2)(PORT=1521))) (ADDRESS_LIST= (SOURCE_ROUTE=yes) (ADDRESS=(PROTOCOL=tcp)(HOST=host3)(port=1630)) (ADDRESS=(PROTOCOL=tcp)(HOST=host4)(port=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com)))
In Figure 7-5:
ADDRESS_LIST
at random and to failover to the other if the chosen ADDRESS_LIST
fails. This is indicated by the LOAD_BALANCE
and FAILOVER
parameters being set to on
.
ADDRESS_LIST
is chosen, the client first connects to the Oracle Connection Manager, using the Oracle Connection Manager protocol address that uses port 1630 indicated for the ADDRESS_LIST
.
ADDRESS_LIST
.
This section lists and describes the tnsnames.ora
file parameters that comprise connect descriptors. Configuration parameters fall into the following categories:
Each connect descriptor is contained within a DESCRIPTION
parameter. Multiple connect descriptors are characterized by the DESCRIPTION_LIST
parameter. These parameters are described next.
The DESCRIPTION
parameter is the beginning of a connect descriptor. It contains the definition of a protocol address and the service name to which to connect.
Embed this parameter under the DESCRIPTION_LIST
parameter.
net_service_name= (DESCRIPTION= (ADDRESS=...) (CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com)))
The DESCRIPTION_LIST
parameter defines a list of connect descriptors for a particular net service name.
net_service_name= (DESCRIPTION_LIST= (DESCRIPTION= (ADDRESS=...) (CONNECT_DATA=(SERVICE_NAME=sales.acme.com))) (DESCRIPTION= (ADDRESS=...) (CONNECT_DATA=(SERVICE_NAME=sales2.us.acme.com))))
The protocol address section of the tnsnames.ora
file specifies the protocol addresses of the listener.
The ADDRESS
parameter defines a single listener protocol address.
Embed this parameter under either the ADDRESS_LIST
parameter or the DESCRIPTION
parameter.
See Also:
Chapter 5, "Protocol Address Configuration" for descriptions of the correct parameters to use for each protocol |
net_service_name= (DESCRIPTION= (ADDRESS
=(PROTOCOL=tcp)(HOST=sales-svr)(PORT=1521)) (CONNECT_DATA
=(SERVICE_NAME
=sales.us.acme.com))
The ADDRESS_LIST
parameter defines a list of protocol addresses. If there is only address list, ADDRESS_LIST
is not necessary.
Embed this parameter under either the DESCRIPTION
parameter or the DESCRIPTION_LIST
parameter.
net_service_name= (description= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521))) (ADDRESS_LIST= (FAILOVER=on) (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com)))
For multiple addresses, the following parameters are available for usage:
When set to on
, yes
, or true
, the FAILOVER
parameter instructs Oracle Net, at connect time, to fail over to a different address if the first protocol address fails. When set to off
, instructs Oracle Net to try one protocol address.
Embed this parameter under either the DESCRIPTION_LIST
parameter, the DESCRIPTION
parameter, or the ADDRESS_LIST
parameter.
on
for DESCRIPTION_LIST
s, DESCRIPTION
s, and ADDRESS_LIST
s
on
| off
| yes
| no
| true
| false
net_service_name= (DESCRIPTION= (FAILOVER=on) (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com)))
When set to on
, yes
, or true
, the LOAD_BALANCE
parameter instructs Oracle Net to progress through the list of addresses in a random sequence, balancing the load on the various listener or Oracle Connection Manager protocol addresses. When set to off
, no
, or false
, this parameter instructs Oracle Net to try the protocol addresses sequentially until one succeeds.
Embed this parameter under either the DESCRIPTION_LIST
parameter, the DESCRIPTION
parameter, or the ADDRESS_LIST
parameter.
on
for DESCRIPTION_LIST
s
on
| off
| yes
| no
| true
| false
net_service_name= (DESCRIPTION= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com))
The SDU
parameter instructs Oracle Net to optimize the transfer rate of data packets being sent across the network with the session data unit (SDU) size you specify.
Embed this parameter under the DESCRIPTION
parameter.
2 KB
The SDU size can range from 512 bytes to 32 KB. The default SDU for the client and the database is 2 KB.
Optimal SDU size depends on the maximum segment size (MSS) and message fragmentation. For Two-Task Common (TTC) connections, configuring an SDU size larger than the 2 KB default requires configuring the SDU on both the client and server computers. When the configured values do not match, the lower of the two values will be used.
To minimize packet header overhead and message fragmentation, set the SDU size as a multiple of the MSS. When Oracle Advanced Security encryption is not used, increase the SDU size by one (1). For example, the TCP/IP version 4 MSS on Ethernet is 1460 bytes. Use a multiple of 1460 for the SDU size if encryption is used. If encryption is not used, increase the SDU size to 1461.
net_service_name= (DESCRIPTION= (SDU=2920) (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVER_NAME=sales.us.acme.com))
When set to on
or yes
, the SOURCE_ROUTE
parameter instructs Oracle Net to use each address in order until the destination is reached.
To use Oracle Connection Manager, an initial connection from the client to the Oracle Connection Manager is required, and a second connection from the Oracle Connection Manager to the listener is required.
Embed this parameter under either the DESCRIPTION_LIST
parameter, the DESCRIPTION
parameter, or the ADDRESS_LIST
parameter.
off
yes
| no
| on
| off
net_service_name= (DESCRIPTION= (SOURCE_ROUTE=on) (ADDRESS=(PROTOCOL=tcp)(HOST=cman-pc)(PORT=1630)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME=sales.us.acme.com))
The TYPE_OF_SERVICE
parameter specifies the type of service to use for an Oracle RDB database. It is used by Rdb interface tools. This feature should only be used if the application supports both an Oracle Rdb and Oracle database, and you want the application to randomly choose (load balance).
Embed this parameter under the DESCRIPTION
parameter.
net_service_name=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=...)
(CONNECT_DATA=
(SERVICE_NAME=generic)
(RBD_DATABASE=[.mf]mf_personal.rdb)
(GLOBAL_NAME=alpha5))
(TYPE_OF_SERVICE=rdb_database))
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com))
(TYPE_OF_SERVICE=oracle9_database)))
The connection data section of the tnsnames.or
a file specifies the name of the destination service.
The CONNECT_DATA
parameter defines the service to which to connect.
Embed this parameter under the DESCRIPTION
parameter.
CONNECT_DATA
permits the following sub-parameters:
net_service_name= (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=sales.us.acme.com)))
The FAILOVER_MODE
parameter instructs Oracle Net to fail over to a different listener if the first listener fails during runtime. Depending upon the configuration, session or any SELECT
statements which were in progress are automatically failed over.
This type of failover is called Transparent Application Failover (TAF) and should not be confused with the connect-time failover FAILOVER
parameter.
Embed this parameter under the CONNECT_DATA
parameter.
FAILOVER_MODE
supports the following sub-parameters:
BACKUP
--Specify the failover node by its net service name. A separate net service name must be created for the failover node.
TYPE
--(Required) Specify the type of failover. Three types of Oracle Net failover functionality are available by default to Oracle Call Interface (OCI) applications:
session
: Fails over the session; that is, if a user's connection is lost, a new session is automatically created for the user on the backup. This type of failover does not attempt to recover selects.
select
: Allows users with open cursors to continue fetching on them after failure. However, this mode involves overhead on the client side in normal select operations.
none
: This is the default, in which no failover functionality is used. This can also be explicitly specified to prevent failover from happening.
METHOD
--Specify how fast failover is to occur from the primary node to the backup node:
basic
: Establishes connections at failover time. This option requires almost no work on the backup database server until failover time.
preconnect
: Pre-establishes connections. This provides faster failover but requires that the backup instance be able to support all connections from every supported instance.
RETRIES
--Specify the number of times to attempt to connect after a failover. If DELAY
is specified, RETRIES
defaults to five retry attempts.
DELAY
--Specify the amount of time in seconds to wait between connect attempts. If RETRIES
is specified, DELAY
defaults to one second.
The GLOBAL_NAME
parameter identifies the Oracle Rdb database.
Embed this parameter under the CONNECT_DATA
parameter.
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVICE_NAME=generic) (RDB_DATABASE=[.mf]mf_personal.rdb) (GLOBAL_NAME=alpha5)))
The HS
parameter instructs Oracle Net to connect to a non-Oracle system through Heterogeneous Services.
Embed this parameter under the CONNECT_DATA
parameter.
None
ok
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SID=sales6) (HS=ok)))
The INSTANCE_NAME
parameter identifies the database instance to access. The instance name can be obtained from the INSTANCE_NAME
parameter in the initialization parameter file
Embed this parameter under the CONNECT_DATA
parameter.
See Also:
Oracle9i Net Services Administrator's Guide for information about the use of |
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVICE_NAME=sales.us.acme.com) (INSTANCE_NAME=sales1)))
The RDB_DATABASE
parameter specifies the file name of an Oracle RDB database.
Embed this parameter under the CONNECT_DATA
parameter.
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVICE_NAME=sales.us.acme.com) (RDB_DATABASE= [.mf]mf_personal.rdb)))
The SERVER
parameter instructs the listener to connect the client to a specific type of service handler.
Embed this parameter under the CONNECT_DATA
parameter.
dedicated
--The client request is served by a dedicated server process
shared
--The client request is served by a shared server process
Note: Shared server must be configured in the database initialization file in order for the client to connect to the database with a shared server process. See the Oracle9i Net Services Administrator's Guide for complete configuration information. |
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVER_NAME=sales.us.acme.com) (SERVER=dedicated)))
The SERVICE_NAME
parameter identifies the Oracle9i or Oracle8i service to access.
The SERVICE_NAME
parameter is typically set to the global database name, a name comprised of the database name (DB_NAME
) and domain name (DB_DOMAIN
), entered during installation or database creation.
Embed this parameter under the CONNECT_DATA
parameter.
See Also:
Oracle9i Net Services Administrator's Guide for information about the use of the |
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVICE_NAME=sales.us.acme.com)))
The SID
parameter identifies the database instance by the Oracle System Identifier (SID) for an Oracle8 database. If the database is Oracle9i or Oracle8i, use the SERVICE_NAME
parameter rather than the
SID
parameter.
Embed this parameter under the CONNECT_DATA
parameter.
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SID=sales)))
The security section of the tnsnames.or
a file specifies security-related parameters for use with Oracle Advanced Security features.
The SECURITY
parameter enables secure connections.
Embed this parameter under the DESCRIPTION
parameter.
SECURITY
permits the SSL_SERVER_CERT_DN
sub-parameter.
net_service_name= (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-svr)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-svr)(PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=sales.us.acme.com)) (SECURITY= (SSL_SERVER_DN="cn=sales,cn=OracleContext,dc=us,dc=acme,dc=com")))
The SSL_SEVER_CERT_DN
parameter specifies the distinguished name (DN) of the database server. The client uses this information to obtain the list of DNs it expects for each of the servers, enforcing the server's DN to match its service name.
Use this parameter in conjunction with the sqlnet.ora
parameter SSL_SERVER_DN_MATCH
to enable server DN matching.
See Also:
Chapter 7, "Configuring Secure Sockets Layer Authentication," in the Oracle Advanced Security Administrator's Guide |
net_service_name= (DESCRIPTION= (ADDRESS=...) (ADDRESS=...) (CONNECT_DATA= (SERVICE_NAME=finance.us.acme.com)) (SECURITY= (SSL_SERVER_DN="cn=finance,cn=OracleContext,dc=us,dc=acme,dc=com")))
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|