Net8
Getting Started
Release 8.0.5 for Windows NT and Windows 95/98 A64419-01 |
|
This appendix describes the configuration files.
Specific topics discussed are:
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:
A description of how the files are created is described below:
The TNSNAMES.ORA file is used by clients and distributed
database servers to identify potential server destinations. It stores the
service names of databases addresses.
Note:: The Oracle Net8 Assistant creates TNSNAMES.ORA in ORACLE_HOME\NET80\ADMIN on the clients. TNSNAMES.ORA must be manually added on the server for server-to-server connections. |
A sample file is shown in Figure
C-1:
The address of the server in TNSNAMES.ORA is the same as
the address of the network listener for a server in LISTENER.ORA. Similarly,
the address in the TNSNAMES.ORA file includes the SID which is required
(as SID_NAME) in the LISTENER.ORA file. Figure
C-2 shows the matching elements:
The domain added to the service name in TNSNAMES.ORA is the
same as the domain defined in the NAMES.DIRECTORY_PATH parameter in the
SQLNET.ORA. Figure C-3 shows the relationship:
Please note that the default domain WORLD appended to the
service name if the server name does not have the .DOMAIN extension
in a connect string. For example, the connect string SCOTT/TIGER@INVENTORYDB
gets searched in the TNSNAMES.ORA as INVENTORYDB.WORLD because the SQLNET.ORA
has a NAMES.DEFAULT_DOMAIN = WORLD. If the connect string has the DOMAIN
extension, (such as SCOTT/TIGER@HR.US), the default domain is not appended.
TNSNAMES.ORA is comprised of two parts:
These parts are described in the following subsections.
The user specifies the service name (up to 64 characters),
an easy to remember database alias name, with Net8 Easy Configuration Tool
or Oracle Net8 Assistant--a single word rather than the lengthier connect
descriptor--to identify the service to which to connect. The TNSNAMES.ORA
file consists of a series of service names mapped to TNS connect descriptors.
If you are using Oracle Names Server, the service name for
a database must be exactly the same as the global database name defined
by the system administrator. Net8 limits the total length of a global database
name to 64 characters. Of these, up to eight are the DB_NAME as defined
by the database administrator, and the remainder show the service's place
in the domain hierarchy (DB_DOMAIN). The name part of the service name
can be longer than eight characters only if the DBA changes the name of
the database with a RENAME GLOBAL_NAME parameter. The total global database
name, or service name, must remain at or below 64 characters.
Alternate service names can be assigned to a database service through the TNSNAMES.ORA file. The alternate service names can be names you choose because you find them convenient and easy to remember. For example, if a database is used by two different divisions of a company, Human Resources and Finance, you can map two different service name aliases, hr and finance to the database. The TNSNAMES.ORA file has three separate entries:
Note: Although you can have multiple aliases for the same database service, you cannot have multiple network listeners for the same database service. |
All service name are assigned a connect descriptors in the
TNSNAMES.ORA file. For a database, a connect descriptor describes the location
of the network listener and the SID of the database to which to connect.
For an Oracle Connection Manager, a connect descriptor describes the location
of the Oracle Connection Manager, the location of the network listener,
and the SID of the database to which to connect.
After the service name is listed, a database connect descriptor starts with a DESCRIPTION parameter which indicates the beginning definition of a database listening address. After DESCRIPTION, a connect descriptor contains two sections:
ADDRESS contains the information required to reach the application within a given protocol environment. It includes the
Oracle Net8 Assistant and Net8 Easy Configuration Tool automatically
provide the correct protocol specific parameters for common protocols,
but you must provide the appropriate values. For information about the
parameter values of a given protocol, see the section "Configuring
TNSNAMES.ORA for Oracle Protocol Adapters" in this chapter.
CONNECT_DATA denotes the SID of the remote database. When
Net8 on the server side receives the connection request, TNS passes the
CONNECT_DATA contents to the network listener, which identifies the desired
database.
A sample CONNECT_DATA section looks like:
(CONNECT_DATA = (SID = ORCL)
If the network contains an Oracle Connection Manager, an additional SOURCE_ROUTE parameter is required. This parameter creates a source route through all Oracle Connection Managers to the destination database:
(CONNECT_DATA = (SID = ORCL) (SOURCE_ROUTE = YES)
Below is the connect descriptor syntax of the TNSNAMES.ORA file:
SERVICE_NAME.world = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (protocol adapter information) ) ) (CONNECT_DATA = (SID = SID) ) )
See "Configuring TNSNAMES.ORA for
Oracle Protocol Adapters" in this chapter for a description of the
keywords.
This section describes the address format used in a client's TNSNAMES.ORA file for the following Oracle Protocol Adapters:
TNSNAMES.ORA defines the location of Oracle8 Server machines
to which a client can connect.
The table below describes the parameters used by the Oracle
Protocol Adapters. Refer to this table for definitions as you review the
syntax examples provided throughout this section.
When using the Oracle TCP/IP Protocol Adapter, specify the address of a TNS-based application in the following format:
(ADDRESS = (PROTOCOL = TCP) (HOST = SERVER_NAME) (PORT = PORT_NUMBER))
The entry below is taken from a client machine that connects to an Oracle8 database with a SID of ORCL on a host name of INVENTORY by using the service name INVENTORYDB on a TCP/IP network.
INVENTORYDB.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = INVENTORY) (Port = 1521) ) ) (CONNECT_DATA = (SID = ORCL) ) )
When using the Oracle SPX Protocol Adapter, specify the address as follows:
(ADDRESS = (PROTOCOL = SPX) (SERVICE = TNS_APPLICATION) )
The entry below is taken from a client machine that connects to an Oracle8 database with a SID of ORCL and network listener service name of INVENTORY_LSNR by using the service name INVENTORYDB on a SPX network.
INVENTORYDB.WORLd = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = SPX) (Service = INVENTORY_LSNR) ) ) (CONNECT_DATA = (SID = ORCL) ) )
When using the Oracle Named Pipes Protocol Adapter, specify the address of a TNS-based application as follows:
(ADDRESS = (PROTOCOL = NMP) (SERVER = COMPUTER_NAME) (PIPE = PIPE _NAME) )
The entry below is taken from a client machine that connects to an Oracle8 database with a SID of ORCL on a computer name of NT_INVENTORY_BOX by using the service name INVENTORYDB on a Named Pipes network.
INVENTORYDB.WORLD = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = NMP) (Server = NT_INVENTORY_BOX) (Pipe = ORAPIPE) ) ) (CONNECT_DATA = (SID = ORCL) ) )
When using the Oracle LU6.2 Protocol Adapter for Windows NT, specify the address of a TNS-based application as follows:
(ADDRESS = (COMMUNITY= LU62.world) (PROTOCOL=LU62) (TPN= TPN_NAME) (MODE=ORAPLU62) (PARTNER_LU_NAME = "PARTNER_LU_NAME") (LLU_NAME = LOCAL_LU_NAME) )
Note: LLU and PARTNER_LU_LOCAL_ALIAS can be used in place of LLU_NAME and PARTNER_LU_NAME. |
Additional Information: See the Administrator's Guide in the Microsoft SNA Server Documentation folder for LU6.2 setup information. |
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) ) )
When using the Bequeath Protocol Adapter, specify the address of a TNS-based application as follows:
(ADDRESS = (PROTOCOL = BEQ) (PROGRAM = oracle80) (ARGV0 = oracle80SID) (ARGS = `(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))') )
The entry below is taken from a client machine that connects to a single Oracle8 database.
Beq-local.world = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = BEQ) (PROGRAM = oracle80) (ARGV0 = oracle80ORCL) (ARGS = `(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))') ) ) (CONNECT_DATA = (SID = ORCL) ) )
The SQLNET.ORA file contains optional parameters used by
clients and the server (when acting as client) on the network, such as
logging, tracing, and security parameters.
Note: The SQLNET.ORA file is automatically installed on the server and the clients in ORACLE_HOME\NET80\ADMIN. |
A sample file is shown in Figure
C-4:
TRACE_LEVEL_CLIENT = OFF <---set this to 16 if tracing is required sqlnet.authentication_services = (NONE) names.directory_path = (TNSNAMES, HOSTNAME) names.default_domain = world automatic_ipc = off
This section covers the following SQLNET.ORA configuration issues:
The optional server parameter, SQLNET.EXPIRE_TIME, determines
how often the network listener sends a probe to verify that a client/server
connection is still active. If a client is abnormally terminated, a connection
remains open indefinitely unless identified and closed by the system. If
you specify this parameter, the network listener sends a probe periodically
to determine whether there is an invalid connection to terminate. If the
network listener finds a dead connection, or a connection no longer in
use, it returns an error, causing the server process to exit. This parameter
must be set in the SQLNET.ORA file on the server.
Dead connection detection has costs associated with it:
In short, evaluate carefully whether you benefit from enabling
the dead connection detection feature.
The following SQLNET.ORA logging and tracing parameters are
available:
All errors that occur in Net8 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.
You can also manually add the following optional tracing parameters for the TNSPING utility to SQLNET.ORA. TNSPING determines whether or not a service (such as a database, an Oracle Names Server, or other TNS services) on a Net8 network can be successfully reached.
Additional Information: See the Oracle Net8 Administrator's Guide for more information about the logging and tracing parameters in SQLNET.ORA. |
The NAMES.DEFAULT_DOMAIN parameter indicates the domain from
which the client most often requests names. When this parameter is set,
the domain name is automatically appended to the service name in a connect
string. For example, the connect string SCOTT/TIGER@INVENTORYDB gets searched
in the TNSNAMES.ORA as INVENTORYDB.WORLD, because the SQLNET.ORA has a
NAMES.DEFAULT_DOMAIN = WORLD. If the connect string has the DOMAIN
extension, (such as SCOTT/TIGER@HR.US), the default domain is not appended.
If you use preferred (not well-known) Oracle Names Server,
another parameter, NAMES.PREFERRED_SERVERS, is required. This parameter
includes one or more addresses of the Names servers in the order the client
prefers to use them.
Additional Information: See the Oracle Net8 Administrator's Guide. |
The IPC interprocess communication parameter, AUTOMATIC_IPC,
determines if Net8 attempts to connect to a database using IPC or through
the network first. If the parameter is set to ON (it's set to OFF by default),
Net8 tries to connect using a service name as an IPC key. If it fails,
it resolves the service name (using the TNSNAMES.ORA file or an Oracle
Names Server) and uses it for connection. If the parameter is set to OFF,
Net8 does not look for an IPC address and goes directly to the network.
Authentication, data encryption, and checksumming parameters
ensure secure transmission of data over networks. Authentication is available
with or without the Advanced Networking Option (ANO). Encryption and checksumming
parameters are only available with ANO.
Additional Information: See the Oracle Advanced Networking Option Administrator's Guide for specific configuration information on these parameters. |
The LISTENER.ORA file is the configuration file for the network listener. It resides on the server and defines:
A sample file is shown in Figure
C-5:
Note: The LISTENER.ORA file is automatically installed on the server in ORACLE_HOME\NET80\ADMIN. |
################ # Filename......: listener.ora # Node..........: local.world # Date..........: 24-MAY-97 13:23:20 ################ LISTENER = (ADDRESS_LIST = (ADDRESS= (PROTOCOL= IPC) <---IPC is the internal protocol (KEY= oracle.world) ) (ADDRESS= (PROTOCOL= IPC) (KEY= ORCL) ) (ADDRESS= (PROTOCOL= NMP) (SERVER= inventory.com) (PIPE= ORAPIPE) ) (ADDRESS= (PROTOCOL= TCP) (Host= INVENTORY) <---or, use the IP address of server (Port= 1521) ) (ADDRESS= (PROTOCOL= TCP) (Host= INVENTORY) (Port= 1526) ) (ADDRESS= (PROTOCOL= TCP) (Host= 127.0.0.1) (Port= 1521) ) ) STARTUP_WAIT_TIME_LISTENER = 0 CONNECT_TIMEOUT_LISTENER = 10 TRACE_LEVEL_LISTENER = 0 SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = inventory.com) (SID_NAME = ORCL) <---Database system identifier, default is ORCL ) (SID_DESC = (SID_NAME = extproc) (PROGRAM=extproc) ) ) PASSWORDS_LISTENER = (oracle)
This section covers the following LISTENER.ORA configuration issues:
You can create connections to multiple databases in two ways, using one or multiple network listeners:
The default network listener name is LISTENER, which is the
recommended name in a standard installation that requires only one network
listener on a machine. The network listener name must be unique on the
machine running Oracle8 database. If you have more than one network listener
on a machine, each requires a unique name.
The TURTLE node, for example, might have three network listeners with the names:
The network listener usually listens both for internal connection
requests and for connection requests from across the network.
The network listener listens for IPC calls if IPC addresses
are in the LISTENER.ORA file.
The IPC address format, which is the same across platforms, is as follows:
(ADDRESS= (PROTOCOL=IPC) (KEY=string) )
Net8 Easy Configuration Tool and Oracle Net8 Assistant create
two IPC addresses for each database for which a network listener queries.
In one, the key value is equal to the service name. This IPC address is
used for connections from 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.
The network 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) )
If you expect the listener to handle large volumes of connection
requests, you may specify a queue for the process. This will allow the
listener to dynamically handle larger numbers of concurrent connection
requests.
To specify a queue size for a listener, enter a value to
the QUEUESIZE keyword at the end of any listening address in your listener
configuration file.
A typical listener configuration file with the queue size specified.
LISTENER = (ADDRESS_LIST = (ADDRESS= (PROTOCOL= TCP) (HOST= INVENTORY) (PORT= 1521) ( QUEUESIZE = 20) )
Note:: Currently, you can only configure the queue size for listeners operating on TCP/IP. The queue size is 5 for Windows NT 4.0 Workstation and 50 for Windows NT 4.0 Server. |
The LISTENER.ORA file describes the database SIDs for which the network listener queries. These are the same SIDs listed in the client's TNSNAMES.ORA file. LISTENER.ORA is made up of keyword-value pairs.
SID_LIST_LISTENER_NAME= (SID_LIST = (SID_DESC = (SID_NAME = SID) ) )
The SID is the Oracle SID of the database server.
(SID_NAME = ORCL)
The following parameters control the behavior of the network
listener:
Clients do not need a TNSNAMES.ORA file if an Oracle Names Server is used. If the TNSNAMES.ORA is created, the client may use it to resolve the service name before resolving it through the Names Servers. Oracle Names requires the following entries in the LISTENER.ORA file for a network 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) ) )
where LISTENER_NAME is the name of the network listener.
LISTENER is the name of the default network listener.
Additionally, the Oracle Names allows databases to automatically register with Oracle Names Servers and allows clients to automatically find Oracle Names Servers. Oracle Names requires the following entry in the LISTENER.ORA file:
USE_PLUG_AND_PLAY_LISTENER_NAME=ON
Clients do not need a TNSNAMES.ORA file if the host naming adapter is used. A Oracle8 server requires the following entry in the LISTENER.ORA file to use host naming names resolution:
SID_LIST_LISTENER_NAME= (SID_LIST = (SID_DESC = (SID_NAME = ORCL) (GLOBAL_DBNAME = HOSTNAME) )
where
The CMAN.ORA file is the configuration file for the Oracle
Connection Manager on the server.
A sample file is shown in Figure
C-6:
# # Connection Manager config file # cman.ora # # # cman's listening addresses # cman = (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=inventory.com)(PORT=1610)) (ADDRESS=(PROTOCOL=tcp)(HOST=inventory.com)(PORT=1620)) ) # # cman's configurable params # # MAXIMUM_RELAYS defaults to 8 # LOG_LEVEL defaults to 0 # TRACING defaults to no # RELAY_STATISTICS defaults to no # SHOW_TNS_INFO defaults to no # USE_ASYNC_CALL (for nscall/nsanswer/nsaccept calls) # defaults to yes # AUTHENTICATION_LEVEL defaults to 0 # MAXIMUM_CONNECT_DATA defaults to 1024 # ANSWER_TIMEOUT defaults to 0 # cman_profile = (parameter_list= (MAXIMUM_RELAYS=1024) (LOG_LEVEL=1) (TRACING=yes) (RELAY_STATISTICS=yes) (SHOW_TNS_INFO=yes) (USE_ASYNC_CALL=yes) (AUTHENTICATION_LEVEL=1) ) # #========================================================================== # cman is used as a TCP fire wall proxy IF AND ONLY IF "cman_rules" exists #========================================================================== # #cman_rules = (rule_list= # (rule=(src=spcstn)(dst=x)(srv=x)(act=accept)) # )
The CMAN.ORA consists of following sections:
CMAN |
Contains the listening address for the Oracle Connection Manager. |
CMAN_PROFILE |
Contains CMAN configuration parameters. |
CMAN_RULES |
Contains the rules for filtering incoming connection requests. |
The listening address is a combination of the service name
and address. The format of the address is similar to the listening addresses
in the LISTENER.ORA file, except for the exclusion of the CONNECT_DATA
segment.
In the example below, the Oracle Connection Manager is listening on two addresses, SPX and TCP/IP. The Oracle Connection Manager can listen on any protocol that Oracle supports on the platform the Oracle Connection Manager is running on.
CMAN= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=SPX) (SERVICE=CMAN) ) (ADDRESS= (PROTOCOL=TCP) (HOST=CMAN.US.ORACLE.COM) (PORT=1610) ) )
The CMAN_PROFILE section defines Oracle Connection Manager parameters:
CMAN_PROFILE= (PARAMETER_LIST= (MAXIMUM_RELAYS=64) (LOG_LEVEL=0) (TRACING=YES) (RELAY_STATISTICS=YES) (SHOW_TNS_INFO=NO) (USE_ASYNC_CALL=YES) (AUTHENTICATION_LEVEL=0) )
The CMAN_RULES section defines access control rules:
In order to have access control on your database server, you need to specify whom to accept or reject in the RULES configuration parameter. The rules specification involves these elements:
You can specify several rules for a single access control to fine tune whom accesses your database server.
CMAN_RULES= (RULE_LIST= (RULE= (SRC = shost) (DST = dhost) (SRV = service) (ACT = ACCEPT | REJECT) ) )
Multiple RULEs can be defined within the RULE_LIST. The rules
in the first matched RULE are applied to the request. When CMAN_RULES exists,
the Oracle Connection Manager adheres to the principle "that which is not
expressly permitted is prohibited." If the CMAN_RULES are not defined,
then everything is permitted.