When the listener is started, the Oracle instance willregister its service names with the listener.NOTE If you are running an Oracle instance under a version of Oracle prior to Oracle8i,
Trang 1You may optionally specify the service name of an Oracle instance by setting theSERVICE_NAMES parameter in the init.ora file I recommend setting the servicename in this manner as good practice, to eliminate guesswork The following exampleillustrates setting the service name of an Oracle instance In this example, two servicenames are specified for a single instance
service_names = toffee.cafecandy.com, orange.cafecandy.com
Naming Methods
The Net8 client resolves net service names through one of five known naming methods:
Local naming Local naming is specific to each Oracle client and requiresextensive administration With local naming, net service names are stored in thetnsnames.orafile residing in $ORACLE_HOME/network/admin on a Unix system or
in %ORACLE_HOME%\network\admin on a Windows NT system Local naming ismost appropriate for small networks with a limited number of services and clients
Oracle Names Oracle Names is an Oracle directory service comprised of asystem of Oracle Names servers, which can be centrally managed by the DBA
Oracle Names is a good solution for a high-volume, dynamic, and complex environment
NOTE Oracle Names will be deprecated in Oracle9i Because of this, if you need a tralized naming resolution solution, it is recommended that you use Oracle Directory Nam-ing rather than Oracle Names
cen-Oracle Directory Naming Oracle Directory Naming uses an LDAP(Lightweight Directory Access Protocol)–compliant directory server to store netservice names and connect descriptors The network directory becomes the cen-tral repository for all data on databases, network components, and user and cor-porate policies and preferences, replacing client-side and server-side localized files
Administrators can centrally manage these objects, and all systems on the geneous network can refer to the directory for information Net8 supports OracleInternet Directory, Microsoft Active Directory, and Novell Directory Services (NDS)
hetero-Host naming Host naming uses a known name resolution service in aTCP/IP environment, such as Domain Name System (DNS) or NetworkInformation Services (NIS)
INTRODUCING NET8
P A R TII
Trang 2External naming External naming support allows sites to resolve Oracleservice names using industry-standard name services, including Sun NIS+, NDS,and the Open Software Foundation/Distributed Computing Environment(OSF/DCE) Cell Directory Service (CDS).
Local naming and host naming fall under the localized management network figuration model Localized management involves configuring name resolution oneach Oracle client in a tnsnames.ora file Oracle Names, Oracle Directory Naming,and external naming fall under the centralized management network configurationmodel Centralized management eases management of Oracle clients, because you donot need to reconfigure each client every time a new Oracle service is added to thenetwork
con-Configuring Net8
Net8 is typically installed along with other Oracle8i products For example, when youinstall the database server or SQL*Plus, Net8 will be installed at the same time Youcan choose to install Net8 without any other client software (though some dependentlibraries will still be installed) If you need to install Net8, simply insert your serverinstallation CD (or SQL*Plus installation CD), start the Universal Installer, and choose
to do a Custom Install From the Available Product Components window, choose Net8.(See Chapter 2 for details on the Oracle Universal Installer and installing Oracle8icomponents.)
N OTE In addition to installing Net8 you will need to install one or more protocoladapters, to allow Net8 to communicate using the protocol you wish to use By default,Oracle will try to install the correct protocol adapter, but it’s always a good idea to makesure that the correct one is being installed
Net8 is configured using configuration files located on the client and networkserver hosts The following configuration files contain information about where ser-vices are located and how to establish connections between the application client and
an Oracle service:
• listener.ora, located on the server, contains configuration information aboutlisteners on a server
Trang 3The listener.ora and tnsnames.ora files are covered in the following discussions
of configuring the listener and client The sqlnet.ora and names.ora files are cussed later in this chapter, in the “Using Oracle Names” section
dis-Configuring and Managing the Listener
You must employ a listener on each host where an Oracle service resides The Net8listener process monitors for and processes incoming database connection requestsfrom client applications The listener process runs independently of any Oracleinstances running on the host In fact, one listener process can service connectionsfor any instance running on the host The Net8 listener verifies the connection datapassed to it by matching this information to the services that have been registeredwith the listener
The listener has a default name of LISTENER and will be automatically configured
to listen on the TCP/IP protocol on port 1521, or on the IPC protocol for external procedures
Just as you can run multiple Oracle instances on a single node, you can also ure multiple listeners for that node If you configure multiple listeners, each listenerwill have the name you specify in the listener.ora configuration file A single lis-tener can service multiple service names, and multiple listeners can service a singleservice name
config-Registering Service Names
A service name can be registered with the listener either through configuration mation saved in the listener.ora file or through automatic registration at instancestartup Beginning with Oracle8i, the PMON process will register the service names
infor-for that instance with the listener through a feature known as service registration
Ser-vice registration is automatic at instance startup if the listener is already running Ifthe listener is not already running at instance startup, Oracle will periodically check
CONFIGURING NET8
P A R TII
Trang 4to see if the listener has started When the listener is started, the Oracle instance willregister its service names with the listener.
NOTE If you are running an Oracle instance under a version of Oracle prior to Oracle8i,you must manually configure the listener for those services Listener configuration is alsorequired when using certain products such as Oracle Enterprise Manager (OEM)
You can control service name registration by specifying the name of the listener inthe init.ora file using the LOCAL_LISTENER parameter Set this parameter to a lis-tener name alias that is resolved either through tnsnames.ora or an Oracle Namesserver In the following example, the Oracle instance is configured to register its ser-vice names with the listener brewlist
Configuring the listener.ora File
Listing 9.1 shows a sample listener.ora file with a Net8 listener configuration
Listing 9.1: A listener.ora File with a Net8 Listener Configuration
# Listener Address Sectionlistener=
(description=
(address_list=
(address=(protocol=tcp)(host=oregano)(port=1521))(address=(protocol=ipc)(key=toffee.cafecandy.com)))
)
# Static Service Sectionsid_list_listener=
(sid_list=
Trang 5(sid_desc=
(global_dbname=toffee.cafecandy.com)(oracle_home=/u01/app/oracle/product/8.1.7)(sid_name=toffee)
))
# Listener Control Optionsconnect_timeout_listener=5logging_listener=off
NOTE You can use the formatting style you prefer for the listener.orafile, but youshould try to be consistent Note that some versions of the Net8 software will generate anerror if parentheses are written in the first column
There are three sections within the listener.ora file for each listener configured:
the listener address section, the static service section, and the control parameters tion Let’s look at these sections in a bit more detail
sec-The Listener Address Section
The listener address section defines the protocol addresses for the listener In otherwords, this section tells the listener where to listen for incoming connection requests
This section starts with the name of the listener, such as LISTENER, followed by adescription that is a list of protocol addresses
# Listener Addresseslistener=
(description=
(address_list=
(address=(protocol=tcp)(host=oregano)(port=1521))(address=(protocol=ipc)(key=toffee.cafecandy.com)))
)
The address in this example is a TCP/IP protocol address that specifies the name ofthe destination host and the port that the listener is monitoring The host can be thecurrent host or another host to which the listener will forward the connectionrequest The second protocol address in this listing is an IPC address In this addressdefinition, the key parameter specifies the name of the service that receives the IPCprotocol communications
CONFIGURING NET8
P A R TII
Trang 6For systems that handle many connection requests, you may want to configure aqueue for the listener process This feature enables the listener to dynamically handle
a larger volume of connection requests Check your platform-specific documentationfor availability of listener queues and default queue sizes To configure a queue for aprotocol address, specify the QUEUESIZE parameter at the end of the address defini-tion The following example demonstrates how to configure a queue size of 20 for thefirst listener address only
# Listener Addresseslistener=
(description=
(address_list=
(address=(protocol=tcp)(host=oregano)(port=1521)(queuesize=20)
)(address=(protocol=ipc)(key=toffee.cafecandy.com)))
)
The Static Service Section
The static service section includes the static service name configurations for the tener This section also supports backward compatibility for instances running ver-sions prior to Oracle8i, as well as for certain add-ons such as OEM This section starts
lis-with the parameter SID_LIST_<listener name>, such as SID_LIST_LISTENER, followed
))
In this example, the GLOBAL_DBNAME parameter specifies the service name forwhich the listener is receiving requests The ORACLE_HOME parameter should matchthe definition of the ORACLE_HOME parameter for the instance SID_NAME is theSID of the instance
Trang 7Listener Control Parameters
The control parameters are optional and control the operation of certain features ofthe listener, such as listener tracing and connection time-outs Each parameter in thissection is suffixed with the name of the listener, such as CONNECT_TIMEOUT_
LISTENER Table 9.1 describes the available control parameters
TABLE 9.1: LISTENER CONTROL PARAMETERS IN THE LISTENER.ORA FILE
connect_timeout 10 Specifies the time (in seconds) that the listener will
wait for a valid connection to be madelog_directory $ORACLE_HOME/ Specifies the destination directory for the listener
network/log log filelog_file <listener_ Specifies the name of the listener log file
pass-save_config_on_stop FALSE If set to TRUE, saves to the listener.orafile any
configuration changes set using lsnrctlstartup_wait_time 0 Specifies the time (in seconds) that the listener will
sleep before responding to the lsnrctl status commandtrace_directory $ORACLE_HOME/ Specifies the destination directory for the listener
network/trace trace filestrace_file <listener_ Specifies the name of the listener trace file
name>.trc
trace_filelen Unlimited Specifies the maximum size of the listener trace file,
in kilobytestrace_fileno 1 When trace_filelen is also specified, specifies the
maximum number of listener trace files; when thissetting is exceeded, the listener will recycle the lis-tener trace files
trace_level OFF Turns listener tracing on or off and specifies
incre-mental tracing levels: OFF (no trace output), USER(user trace information), ADMIN (administrative traceinformation), or SUPPORT (Oracle worldwide cus-tomer support trace information)
CONFIGURING NET8
P A R TII
Trang 8TABLE 9.1: LISTENER CONTROL PARAMETERS IN THE LISTENER.ORA FILE
trace_timestamp OFF Specifies whether to add a timestamp in the format
of dd-month-yyyy hh:mm:ss to a trace event; set
using ON|TRUE|OFF|FALSEuse_plug_and_play OFF Tells the listener to register services with an Oracle
Managing the Listener
You can manage the listener with the Listener Control utility, lsnrctl You can issue asingle command from the operating system prompt by passing arguments to lsnrctl,
as follows:
$ lsnrctl command [listener_name]
In this syntax, listener_name is the name of the listener defined in the
listener.orafile It is not necessary to identify the listener if you are using thedefault listener, named LISTENER Table 9.2 describes the basic lsnrctl commands
TABLE 9.2: COMMONLY USED LISTENER CONTROL (LSNRCTL) COMMANDS
START Starts the listenerSTOP Stops the listenerRELOAD Reloads the listener configurationSTATUS Shows the current status of the listener, including the version of the lis-
tener, start time, up time, tracing level, logging and tracing options, thename and location of the listener configuration file, a list of services reg-istered with the listener, and the addresses the listener is monitoringHELP Lists all available lsnrctl commands, or if a command is specified,
shows help information about that command
Trang 9TABLE 9.2: COMMONLY USED LISTENER CONTROL (LSNRCTL) COMMANDS
SET Lists the available parameters that can be passed to the SET command,
or if passed a parameter, modifies the setting of the parameterSHOW Lists the available parameters that can be passed to the SHOW com-
mand, or if passed a parameter, shows the setting of the parameterCHANGE_PASSWORD Sets an encrypted password for the listener
SERVICES Provides detailed information about the services registered with the
listenerTRACE Turns on tracing for the listenerVERSION Shows the current lsnrctl version
Configuring the Net8 Client
The Net8 client might be an application running on a PC or a database that requestsinformation from another database through a database link The Net8 client resolvesconnect identifiers to connect descriptors through a net service name identified by aknown name resolution method, as discussed in the “Naming Methods” section, ear-lier in this chapter Here, we will discuss the local naming method and basic Net8client configuration
Local naming resolves service names to network addresses by using informationconfigured in the tnsnames.ora file that is stored locally on each client node Before adatabase server can receive connections from clients, the clients must have a
tnsnames.orafile with service names that map to the service addresses listed in thedatabase server’s listener.ora file You configure the client by creating a list of ser-vice names (which are aliases for database network addresses) and addresses of net-work destinations (database server names or IP addresses) in the tnsnames.ora file
In the tnsnames.ora file, the net service names are mapped to database networkaddresses contained in a connect descriptor A connect descriptor contains the loca-tion of the listener through a protocol address and the service name of the database
to which to connect Clients and servers that are clients of other servers use this netservice name when making a connection to an application
Here is the basic syntax for a net service name entry in the tnsnames.ora file:
<net service name>=
(description=
CONFIGURING NET8
P A R TII
Trang 10(connect_data=
(service_name=<service name>)
))
For each connect identifier referenced by a Net8 client, a matching net servicename entry should be listed in the tnsnames.ora file to allow the client to make theproper connection Listing 9.2 illustrates how a connect identifier is mapped to a con-nect descriptor through the net service name toffee
Listing 9.2: Mapping a Connect Identifer to a Connect Descriptor in the tnsnames.ora File
toffee=
(description=
(address=(protocol=tcp)(host=oregano)(port=1521))(connect_data=
(service_name=toffee.cafecandy.com))
)
In the event that a service name represents more than one instance, you may tify a specific instance in the connect descriptor This is particularly useful if you areusing Oracle Parallel Server (OPS) Listing 9.3 shows an example that specifies theinstance name, which matches the INSTANCE_NAME parameter in the init.ora file
(instance_name=toffee)(service_name=toffee.cafecandy.com))
)
Client Load Balancing
If you have configured multiple listeners for a service, you can configure the Net8
client to randomize connection requests to the listeners through a feature called client
Trang 11load balancing This feature causes the Net8 client to randomly select which listener it
will attempt to connect with To enable client load balancing, you define two col addresses and set the LOAD_BALANCE parameter in the net service name descrip-tion, as shown in Listing 9.4
proto-Listing 9.4: Using Client Load Balancing
toffee=
(description=
(load_balance=on)(address=(protocol=tcp)(host=oregano)(port=1521))(address=(protocol=tcp)(host=thyme)(port=1521))(connect_data=
(service_name=toffee.cafecandy.com))
)
Enabling Connect Time Failover
If you have configured multiple listeners for a service, you can configure the Net8client to fail over from one listener to the other if a connection request to the first lis-tener fails You may use this option with or without client load balancing To enableconnect time failover, you define two protocol addresses and set the FAILOVER param-eter in the net service name description Listing 9.5 shows an example of enablingload balancing and connect time failover
Listing 9.5: Enabling Connect Time Failover
toffee=
(description=
(load_balance=on)(failover=on)(address=(protocol=tcp)(host=oregano)(port=1521))(address=(protocol=tcp)(host=thyme)(port=1521))(connect_data=
(service_name=toffee.cafecandy.com))
)
Using Transparent Application Failover
Transparent Application Failover (TAF) is a runtime failover method that enables a Net8
client to reestablish connection to a service through the same listener, or through analternate listener if the first connection fails Optionally, you can have TAF resume a
CONFIGURING NET8
P A R TII
Trang 12SELECT statement The failover works transparently to the user TAF is especially ful for high-availability architectures such as OPS and Oracle Fail Safe (discussed inChapter 25).
use-TAF is different from connect time failover Connect time failover handles ing initial connections TAF is concerned with established connections You may useTAF along with the connect time failover and client load balancing features described
redirect-in the previous sections
NOTE TAF works only with services registered with the listener through service nameregistration Static configuration of a service name with a listener will disable TAF
TAF is implemented by adding the FAILOVER_MODE parameter to the CONNECT_DATA portion of the connect descriptor The general syntax of the FAILOVER_MODEparameter is:
failover_mode=
(backup=<backup connection ID>) (type=<failover type>)
(method=<failover method>) (retries=<number of retries> ) (delay=<wait time between retries> )
FAILOVER_MODE takes the following parameters:
• The BACKUP parameter specifies a connect identifier for the backup connection
• The TYPE parameter specifies the type of failover Three types are possible:
• SESSION, so a failed session will reconnect
• SELECT, so a failed session will reconnect and resume SELECT statements inprogress at the time of session failure
• NONE, which is the default and explicitly disables TAF
• The METHOD parameter specifies the method of failover Two methods are possible:
• BASIC will establish failover connection at the time of failover
• PRECONNECT will preestablish idle failover connection to the backupserver
Trang 13Listing 9.6: Enabling Basic Failover
toffee=
(description=
(address=(protocol=tcp)(host=oregano)(port=1521))(address=(protocol=tcp)(host=thyme)(port=1521))(connect_data=
(service_name=toffee.cafecandy.com)(failover_mode=
(type=select)(method=basic))
))
Preconnect Failover
When you use the PRECONNECT method of TAF, Net8 establishes both the initialconnection and an idle failover connection to a backup instance This configuration
is faster than basic failover, at the cost of additional overhead In the example shown
in Listing 9.7, TAF is configured to preestablish a backup connection to the net servicename orange and will fail over to that connection should the primary session openedwith the net service name toffee fail
Listing 9.7: Enabling Preconnect Failover
toffee=
(description=
(address=(protocol=tcp)(host=oregano)(port=1521))(connect_data=
(service_name=toffee.cafecandy.com)(failover_mode=
CONFIGURING NET8
P A R TII
Trang 14))orange=
(description=
(address=(protocol=tcp)(host=oregano)(port=1521))(connect data=
(service_name=orange.cafecandy.com))
)
Connection Retry
When you use the RETRIES parameter, Net8 will attempt to reconnect to a serviceuntil a connection is reestablished or the retry limit is reached In the example shown
in Listing 9.8, TAF will retry the connection 20 times before failure
Listing 9.8: Enabling Connection Retries
toffee=
(description=
(address=(protocol=tcp)(host=oregano)(port=1521))(connect_data=
(service_name=toffee.cafecandy.com)(failover_mode=
(type=select)(method=basic)(retries=20))
))
Using the Net8 Configuration Assistant
You might have noticed that there is a lot of manual work to the configuration ofNet8 One slip of the finger, one misplaced parenthesis, and you are in a world ofhurt Oracle provides a somewhat simpler method of maintaining your Net8 configu-rations through the use of the Net8 Configuration Assistant This graphical utilityoffers the following options for configuring Net8:
Trang 15• The Listener Configuration allows you to create, update, remove, or rename anOracle listener This option is valid only for a system on which the databaseserver is running; it is not used on clients
• The Naming Methods (Oracle Names) Configuration option allows you to figure Net8 naming methods You can choose from the naming methodsdescribed in the “Naming Methods” section earlier in this chapter
con-• The Local Net Service Name Configuration option allows you to maintain alocal copy of the tnsnames.ora file
• The Directory Service Access Configuration option is used to configure access to
an LDAP directory server Choose this option if you are using Oracle DirectoryNaming or Oracle Advanced Security
Once you have selected the type of Net8 configuration you wish to complete, justfollow the prompts, and the Net8 Configuration Assistant will complete the Net8configuration for you
Using Oracle’s Multithreaded Server (MTS) Option
Net8 connections are established using two different models: the dedicated servermodel or the multithreaded server (MTS) model With the dedicated server model, thelistener starts a server process dedicated to the client session and passes the connec-tion to that server process
With MTS, the listener passes the connection to a dispatcher, which supports tiple client sessions concurrently Each session is bound to a virtual circuit, which is aunit of memory used by the dispatcher to manage that session The dispatcher placesthe virtual circuit in a queue when communication from the client arrives An idleshared server process picks up the virtual circuit from the queue and services therequest Because any individual client session is relatively idle, this architecture allows
mul-a smmul-all pool of server processes to hmul-andle mul-a lmul-arger number of client sessions mul-and mul-alsoconsumes less memory on the host
NOTE When an Oracle instance configured for MTS is started and a listener to supportthe service is running, each dispatcher is registered with the listener Registration can take
up to a minute If a client session request is received before the dispatchers are registeredwith the listener, the listener may assign a dedicated server process
USING ORACLE’S MULTITHREADED SERVER (MTS) OPTION
P A R TII
Trang 16You should use MTS only if your application is using technology that mandates it(like Enterprise JavaBeans) or if you have reached your scalability limits in terms ofprocess counts or possibly virtual memory With MTS, you need fewer processes, thuscontext switching is cheaper and the total virtual memory size is a little lower (butthe SGA is much larger) This means that MTS can let you support more users on asystem that is already running at capacity, but increasing that capacity is normally abetter solution.
Configuring MTS
MTS is configured for an Oracle instance using the MTS_DISPATCHERS parameter inthe init.ora file for the instance This is the only required parameter for configuringMTS; all of the other MTS parameters are optional
The following is the basic syntax for MTS_DISPATCHERS:
mts_dispatchers=”(<attribute>=<value>)[(<attribute>=<value>)… ]”
At a minimum, the MTS_DISPATCHERS parameter must set one attribute: theaddress, description, or protocol attribute These and the other, optional, attributesavailable for MTS_DISPATCHERS are described in Table 9.3
TABLE 9.3: MTS_DISPATCHERS ATTRIBUTES
Attribute Description
address Specifies the network protocol address of the endpoint on which the
dis-patchers listen This attribute must be set if the description or protocolattribute is not specified
description Specifies the network description of the endpoint on which the dispatchers
listen, including the network protocol address This attribute must be set ifthe address or protocol attribute is not specified
protocol Specifies the network protocol for which the dispatcher generates a listening
endpoint This attribute must be set if the address or description attribute isnot specified
connections Specifies the maximum number of network connections to allow for each
dispatcher
dispatchers Specifies the initial number of dispatchers to start The number of dispatchers
does not change dynamically but must be incremented with the ALTER TEM command, so be sure to configure enough dispatchers for your system
Trang 17TABLE 9.3: MTS_DISPATCHERS ATTRIBUTES (CONTINUED)
Attribute Description
listener Specifies a listener alias with which the PMON process will register
dis-patcher information Refer to the “Registering Services” section earlier in thischapter for information about registering with a nondefault listener
multiplex Enables connection concentration
pool Enables connection pooling
service Specifies the service name to register with the listener By default, MTS will
use the service_names setting
session Specifies the maximum number of sessions to allow for each dispatcher
ticks Specifies the size of a network tick in seconds The value set is multiplied by
the pool time-out value to get the total connection pool time-out The default
is 15 seconds Oracle recommends a tick size of about 1 second for a fastnetwork and about 3 to 4 seconds for a slow network
For example, to set up MTS on the TCP/IP protocol with 20 initial dispatchers, youwould add the following line to your init.ora file:
mts_dispatchers=”(protocol=tcp)(dispatchers=20)”
Other MTS parameters can be used to tune the performance of MTS The followingparameters are optional:
• MTS_MAX_DISPATCHERS specifies the maximum number of MTS dispatchers
• MTS_SERVER specifies the number of MTS shared server processes to be started
at instance startup
• MTS_MAX_SERVERS specifies the maximum number of MTS shared servers
• MTS_CIRCUITS specifies the maximum number of MTS virtual circuits
• MTS_SESSIONS specifies the maximum number of MTS sessions to allow
TI P When configuring MTS, you may also need to adjust the LARGE_POOL_SIZE andSESSIONS parameters The LARGE_POOL_SIZE parameter specifies the size of the largepool, in bytes The SESSIONS parameter specifies the maximum number of sessions avail-able to the Oracle instance
USING ORACLE’S MULTITHREADED SERVER (MTS) OPTION
P A R TII
Trang 18Viewing MTS Information
Oracle provides some V$ views that offer useful information about MTS For example,the V$DISPATCHER view shows information about dispatcher processes The V$MTS,V$SGA, and V$SGASTAT views provide information that may be useful for tuningMTS Table 9.4 describes the MTS views
TABLE 9.4: MTS VIEWS
V$DISPATCHER Provides information on the dispatcher processes,
including name, network address, status, varioususage statistics, and index number
V$DISPATCHER_RATE Provides rate statistics for the dispatcher processesV$QUEUE Contains information on the multithread message
queuesV$SHARED_SERVER Contains information on the shared server processesV$CIRCUIT Contains information about virtual circuits, which are
user connections to the database through ers and servers
dispatch-V$MTS Contains information for tuning MTSV$SGA Contains size information about various system
global area (SGA) groupsV$SGASTAT Shows detailed statistical information about the SGAV$SHARED_POOL_RESERVED Lists statistics to help tune the reserved pool and
space within the shared pool
Managing MTS on the Client
You may optionally configure a client to use only dedicated or shared servers usingthe server parameter in the CONNECT_DATA portion of the connect descriptor in thetnsnames.orafile If a shared server is requested but not available, the connectionrequest fails In the example shown in Listing 9.9, the connect descriptor for toffee isset up to use only dedicated servers, while orange is configured to use only sharedservers
Trang 19))orange=
(description=
(address=(protocol=tcp)(host=thyme)(port=1521))(connect_data=
(service_name=orange.cafecandy.com)(server=shared)
))
Using Oracle Names
Oracle Names is a distributed directory service made up of a system of integrated OracleNames servers that provide name-to-address resolution for each Net8 service on thenetwork Oracle Names simplifies Net8 setup and administration in complex, distrib-uted computing environments
How Oracle Names Works
Clients configured to use Oracle Names refer connection requests to an Oracle Namesserver The Oracle Names server resolves the service name provided by the client to anetwork address and returns that information to the client The client can then usethat address to connect to the service
Oracle Names employs administrative regions An administrative region is a logical
entity for organizing Net8 services Each administrative region consists of a collection
of one or more Oracle Names servers that administer services for that region istrative regions are transparent to clients in that Oracle Names servers forward nameresolution requests from clients in foreign administrative regions to the proper OracleNames server An administrative region can span multiple domains Domain names
Admin-USING ORACLE NAMES
P A R TII
Trang 20in Oracle exist independently of network domains, although you may follow thesame domain naming conventions to ease administration
Oracle Names includes three features to improve network performance and ease ofadministration:
• Dynamic service registration
• Client discovery of Names servers
• Name resolution optimization Let’s look at each of these features in a bit more detail
Service Registration
Net8 services can register themselves with a Names server, and their addresses aremade available to all the other Names servers in the region Upon startup, a Net8 ser-vice looks for a Names server with which to register This process is as follows:
• If a service has a sqlnet.ora file, it looks for the NAMES.PREFERRED_SERVERparameter If the parameter exists, it registers with the first Names server listed
• If there is no sqlnet.ora file, it looks for a Names server with a well-knownaddress The well-known Names server address on a TCP/IP network is a hostaliased to oranamesrvr0, oranamesrvr1, and so on, using port 1575
• If it can’t find a well-known address, the Oracle Installer prompts the user toprovide a Names server address
NOTE Administrators can also register services manually using namesctl Using this ity is discussed a bit later in this chapter
util-Once the service is registered, its address is made available to all other Namesservers in the region The address information is shared in one of two ways: throughservice replication or through an Oracle Names database In service replication, ser-vice information is stored in a Names server’s cache and is instantly replicated to thecaches of all other Names servers in the region If an Oracle database is used as theregistration repository, the registration information is stored in the database, andfrom there is accessible to all the Oracle Names version 8 servers in the region
Client Discovery of Names Servers
By referring to a list of Oracle Names servers, a client or another Oracle Names server
can contact an Oracle Names server This process of creating the list is called discovery.