The ADDRESS section contains the listener protocol address, and the CONNECT_DATA section contains the destination service information. In this example, the destination service is a database service named sales.us.acme.com.

When creating a connect descriptor to an Oracle9i or Oracle8i database service, you must identify the service with the SERVICE_NAME parameter. Optionally, you can identify an instance with the INSTANCE_NAME parameter, as shown in the following:

The values for these parameters come from the SERVICE_NAMES (with an S) and INSTANCE_NAME parameters in the initialization parameter file. The SERVICE_NAMES parameter in the initialization parameter file is typically the global database name, a name comprising the database name and domain name, entered during installation or database creation. For example, sales.us.acme.com has a database name of sales and a domain of us.acme.com. The INSTANCE_NAME parameter in the initialization parameter file defaults to the SID entered during installation or database creation.

When creating a connect a descriptor for an Oracle release 8.0 or version 7 database, you identify the service with the SID parameter. The following example shows a connect descriptor for an Oracle release 8.0 database with a SID of sales:

Note: In future releases, Oracle Names will not be supported as a centralized naming method.

Host Naming

Enables users to connect to an Oracle server by using a host name alias. Host names are mapped to a connect descriptor in an existing names resolution service or a centrally-maintained set of /etc/hosts files.

No client configuration is required to take advantage of this feature. This method is recommended for simple TCP/IP environments.

Typical or Minimal Installation

Oracle Net Configuration Assistant prompts you to configure net service names in the tnsnames.ora file to connect to an Oracle database service.

Custom Installation

Oracle Net Configuration Assistant prompts you to select naming methods to use. If Local is selected, then Oracle Net Configuration Assistant prompts you to configure net service names in a tnsnames.ora file to connect to an Oracle database service.

Configuring the tnsnames.ora File After Installation

You can add net service names to the tnsnames.ora file at any time. To configure the local naming method, perform the following tasks:

If the destination service is Oracle9i or Oracle8i database, then select Oracle8i or later, and enter a service name in the Service Name field. If destination service is an Oracle release 8.0 database, then select Oracle8 or Previous, and enter an Oracle System Identifier for an instance in the Database SID field.

Oracle Corporation recommends that you use the default setting of Database Default for the connection type. If shared server is configured in the initialization parameter file, you can select Dedicated Server to force the listener to spawn a dedicated server, bypassing shared server configuration. If shared server is configured in the initialization parameter file and you want to guarantee the connection always uses shared server, select Shared Server.

Click Test to verify that the net service name works, or click Finish to dismiss the Net Service Name Wizard.

If you click Test, then Oracle Net connects to the database server by using the connect descriptor information you configured. Therefore, the database and the listener must be running for a successful test. If they are not, see "Starting Oracle Net Services Components" to start components before testing. During testing, a Connection Test dialog box appears, providing status and test results. A successful test results in the following message:

The connection test was successful.

If the test was successful, click Close to dismiss the Connect Test dialog box, and proceed to Step 13.

If the test was not successful:

Ensure that the database and listener are running, and then click Test.

Click Change Login to change the username and password for the connection, and then click Test.

If the destination service is an Oracle9i or Oracle8i database, then select Oracle8i or later database or service. If destination service is an Oracle8 release 8.0 database, then select Oracle8 release 8.0 database or service.

Click Next.

Follow the prompts in the wizard and online help to complete net service name creation.

Task 2: Configure TNSNAMES as the First Naming Method

Configure local naming as the first method specified in the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net uses to resolve connect identifiers to connect descriptors.

Task 3: Distribute Configuration

After one client is configured, it is best simply to copy the tnsnames.ora and sqlnet.ora configuration files to the same location on the other clients. This ensures that the files are consistent. Alternatively, you can use Oracle Net Manager or Oracle Net Configuration Assistant on every client.

Task 4: Configure the Listener

Ensure that the listener (located on the server) is configured to "listen on" the same protocol address you configured for the net service name. By default, the listener should already be configured for the TCP/IP protocol on port 1521.

Task 5: Connect to the Database

Clients can connect to the database using the following syntax:

CONNECT username/password@net_service_name

Configuring the Directory Naming Method

With the directory naming method, connect identifiers are mapped to connect descriptors contained in an LDAP-compliant directory server, including Oracle Internet Directory and Microsoft Active Directory. A directory provides central administration of database services and net service names, making it easier to add or relocate services.

Task 1: Configure Directory Usage on Server and Clients

Before a directory naming entry can be created to a directory, you must complete directory usage configuration with the Select the directory server you want to use, and configure the directory server for Oracle usage option in Oracle Net Configuration Assistant. Likewise, before a directory naming entry can be looked up by a client, you must complete directory usage configuration with the Select the directory server you want to use option in Oracle Net Configuration Assistant. You can configure directory server usage during or after installation.

Task 2: Create Net Service Name Entries (Optional)

Notes:

Only users that are members of either the OracleNetAdmins or OracleContextAdmins group can create net service name entries in a directory. To add or remove users from the OracleNetAdmins group, see "Adding Users To the OracleNetAdmins Group".

If the destination service is Oracle9i or Oracle8i database, then select Oracle8i or later, and enter a service name in the Service Name field. If destination service is an Oracle release 8.0 database, then select Oracle8 or Previous, and enter an Oracle System Identifier for an instance in the Database SID field.

Oracle Corporation recommends that you use the default setting of Database Default for the connection type. If shared server is configured in the initialization parameter file, you can select Dedicated Server to force the listener to spawn a dedicated server, bypassing shared server configuration. If shared server is configured in the initialization parameter file and you want to guarantee the connection always uses shared server, select Shared Server.

Click Test to verify that the net service name works, or click Finish to dismiss the Net Service Name Wizard.

If you click Test, then Oracle Net connects to the database server by using the connect descriptor information you configured. Therefore, the database and the listener must be running for a successful test. If they are not, see "Starting Oracle Net Services Components" to start components before testing. During testing, a Connection Test dialog box appears, providing status and test results. A successful test results in the following message:

The connection test was successful.

If the test was successful, click Close to dismiss the Connect Test dialog box, and proceed to Step 12.

If the test was not successful:

Ensure that the database and listener are running, and then click Test.

Click Change Login to change the username and password for the connection, and then click Test.

Task 3: Configure LDAP as the First Naming Method

Configure directory naming as the first method specified in the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net uses to resolve connect identifiers to connect descriptors.

Task 4: Configure the Listener

Ensure that the listener (located on the server) is configured to listen on the same protocol address configured for the net service name. By default, the listener is configured to listen on the TCP/IP protocol, port 1521.

Task 5: Connect to the Database

Clients that are configured with a default directory entry that matches the directory location of the database service or net service name can connect to the database using the following syntax:

CONNECT username/password@connect_identifier

Clients that are configured with a default directory entry that does not match the entry's directory location cannot use the connect identifier in the connect string. Instead, these connections require the entry's distinguished name or its absolute name.

Modifying Connectivity Information for Database Service Entries

Note:

Only users that are members of either the OracleNetAdmins or OracleContextAdmins group can modify network information for a database service in a directory. To add or remove users from these groups, see "Adding Users To the OracleNetAdmins Group".

When database registration with the directory completes, Database Configuration Assistant creates a database service entry in the directory. By default, this entry contains network route information that includes the location of the listener through a protocol address. You can re-create this information, if it has been removed, or modify the existing network route information.

To create or modify network route information for a database service:

Start Oracle Net Manager on a computer that was used to configure directory usage for Oracle usage:

Creating Net Service Aliases

Notes:

Only users that are members of either the OracleNetAdmins or OracleContextAdmins group can create or modify net service alias entries in a directory. To add or remove users from the OracleNetAdmins group, see "Adding Users To the OracleNetAdmins Group".

To create or access net service aliases, ensure that the Oracle home is upgraded to 9.2.

Net service aliases are not supported using Microsoft Active Directory.

Net service aliases in a directory server enable clients to refer to a database service or a net service name by an alternative name. For example, a net service alias of salesalias can be created for a net service name of sales. When salesalias is used to connect to a database, as in CONNECT scott/tiger@salesalias, it will actually resolve to and use the connect descriptor information for sales.

There are two main uses of net service aliases:

Use a net service alias as a way for clients to refer to a database service or net service name by another name.

Use a net service alias in one Oracle Context for a database service or net service name in a different Oracle Context. This enables a database service or net service name to be defined once in the directory server, but referred to by clients that use other Oracle Contexts.

Configuring the Oracle Names Method

Note:

In future releases, Oracle Names will not be supported as a centralized naming method. Because no new enhancements are being added to Oracle Names, consider using directory naming or migrating an existing Oracle Names configuration to directory naming, as described in Chapter 10, "Exporting Naming Data to a Directory Server". The material presented here is primarily for reference to enable you to maintain your current Oracle Names environment.

Oracle Names simplifies the setup and administration of global, client/server computing networks. Oracle Names makes network address and database link information available to all nodes throughout the network. Each database server network address is identified with a simple service name. Client applications then can request a database connection with that name rather than a lengthy address. Oracle Names shields users and applications from changes to the network infrastructure. It provides for centralized administration of network service names.

Task 1: Consider Oracle Names Options

You need service registration data replicated continuously among Oracle Names servers, or want all Oracle Names servers within a region to store their registration data in an Oracle database.

You need support for one or more administrative region. An administrative region is a collection of Oracle Names servers in one or more domains, a grouping of network objects, such as databases. Networks with multiple administrative regions must have one root administrative region and one or more delegated administrative regions. Delegated administrative regions contain the domains and Oracle Names server addresses in any alternate regions which act as direct child regions of the root.

Task 2: Install Necessary Components

Oracle Names on its own computer that is designated as the Oracle Names server

Oracle Net Services on the clients

Oracle Net Services on the database server

Important:

The Oracle Universal Installer does not install the $ORACLE_HOME/network/names directory on UNIX operating systems. This directory is necessary for successful configuration. If it does not exist, you must manually create it.

Task 3: Create an Oracle Names Server

How an Oracle Names server is created depends upon how you want region data stored. You can have the data:

Stored in tables, called a region database, in an Oracle database accessible to Oracle Names servers

When information is added to an Oracle Names server, the information is stored in the database and in the Oracle Names server checkpoint files. If the database is unavailable, the information in these files is used.

Saved to checkpoint files and replicated among Oracle Names servers

When information is added to an Oracle Names server, the information is stored in checkpoint files, and then replicated to the other Oracle Names servers.

By default, the checkpoint files are stored in $ORACLE_HOME/network/names on UNIX operating systems, and ORACLE_HOME\network\names on Windows NT. Table 9-3 describes the checkpoint files.

Table 9-3 Oracle Names Checkpoint Files

Checkpoint File Name

Description

ckpcfg.ora

Contains a backup copy of the configuration parameters stored in the ONRS_CONFIG table in the region database

ckpcch.ora

Contains all current non-authoritative data that has been retrieved and cached from remote regions and has not expired yet

ckptop.ora and ckpdom.ora

These files contain all authoritative data for the region. The ckptop.ora file defines the domains in the administrative region and the Oracle Names servers authoritative for each domain. The ckdom.ora file contains the authoritative data for each domain.

If the Oracle Names server uses a region database, then these files serve as a copy of the region data in the tables as of the last reload. This data is used when the Oracle Names server starts if the database is inaccessible.

If the Oracle Names server is not using the database, these files are its only persistent storage and are loaded by the Oracle Names server at startup. The Oracle Names server considers the data in these file to be current if there are no other Oracle Names servers in the region. The files are kept current as of the last update to the region.

The following sections cover both modes, as well as a default Oracle Names server that requires no configuration:

Whichever method you select, Oracle Corporation recommends that you create more than one Oracle Names server for the network, in case one should go down.

Default Oracle Names Server

An Oracle Names server can run without any configuration. Its name defaults to ONAMES_host if its name is configured in the names.ora file. The protocol address defaults to TCP/IP, port 1575 on the local host.

If the NAMES.DOMAINS parameter is not configured in the names.ora file, the Oracle Names server assumes authority for the root domain.

Run the namesini.sql script located in $ORACLE_HOME/network/admin on UNIX operating systems and ORACLE_HOME\network\admin\names on Windows NT. This script creates the tables needed by Oracle Names to store information. Optionally, run namesupg.sql to upgrade old tables.

Click plus (+) from the toolbar, or choose Edit > Create from the menu bar.

The Names Wizard starts.

The wizard guides you through the creation and configuration process, prompting for:

A unique Oracle Name Server name

A protocol address for the Oracle Names server

If you select TCP/IP, then Oracle Corporation recommends using the default and officially registered port of 1575 for the Oracle Names server.

A choice to store information in a database or replicate information among Oracle Names servers

(Click Use a region database.)

A protocol address for a database's listener

If you select TCP/IP, then Oracle Corporation recommends using the default and officially registered port of 1521 for the listener.

Database user ID, password, and service name or SID

Whether or not this Oracle Names server is in the root administrative region

If you specify that this Oracle Names server is in the root administrative region, configuration completes.

If you specify that this Oracle Names server is not in the root administrative region, it assumes that this Oracle Names server is in a delegated administrative region. The wizard then prompts you for the local administrative region's domain name and the address of an Oracle Names server in the root administrative region before completing.

When the wizard completes, the following message appears:

A Names Server, onames_server, has been created with default settings. Use the Configure Server section to modify the default configuration.

Choose File > Save Network Configuration.

Repeat Steps 2 through 4 to create additional Oracle Names servers in a region. Oracle Net Manager does not support creation of multiple Oracle Names servers on one computer.

Oracle Net Manager creates a names.ora file with the following settings:

Oracle Names server name (NAMES.SERVER_NAME)

Oracle Names server listening protocol address (NAMES.ADDRESSES)

Database information (NAMES.ADMIN_REGION)

Root administrative region information (NAMES.DOMAIN_HINTS)

Domains in this administrative region (NAMES.DOMAINS)

The names.ora file is created in the $ORACLE_HOME/network/admin directory on UNIX operating systems and the ORACLE_HOME\network\admin directory on Windows NT.

A names.ora file follows with annotations of content:

#Oracle Names server name. The name should include the name of the domain
this Oracle Names server is in.
NAMES.SERVER_NAME=namesvr2.us.acme.com
#Oracle Names server listening protocol address
NAMES.ADDRESSES=
[(ADDRESS_LIST=]
(ADDRESS=(PROTOCOL=tcp)(HOST=namesrv2-server)(PORT=1575))
[(ADDRESS=...))][)]
#Database repository information
NAMES.ADMIN_REGION=
(REGION=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=sales.us.acme.com))
(USERID=system)
(PASSWORD=password)
(NAME=local_region)
(REFRESH=86400)
(RETRY=60)
(EXPIRE=600))
#If an Oracle Names server is in a delegated administrative region, identify
the address of an Oracle Names server in the root administrative region.
NAMES.DOMAIN_HINTS=
(HINT_DESC=
(HINT_LIST=
(HINT=
(NAME=namesvr1)
(ADDRESS=(PROTOCOL=tcp)(HOST=namesvr1-server)(PORT=1575))
# Specify the domain controlled by this region and the time to live (TTL).
If this is the root administrative region, specify NAME=(null) or NAME=. to
identify the root domain.
NAMES.DOMAINS=
(DOMAIN=
(NAME=us.acme.com)
(MIN_TTL=86400))

Administering Multiple Domains

If you want the region to administer more than one domain, specify the additional domains in the NAMES.DOMAINS parameter with Oracle Net Manager:

In the navigator pane, expand Oracle Names Servers.

Select the Oracle Names server.

From the list in the right pane, select Configure Server.

Click the Domains tab.

Enter the domain name in the Domain Name field and time-to-live information, and then click Add.

Repeat Step 5 for each additional domain.

Choose File > Save Network Configuration.

In the following example, NAMES.DOMAINS contains a listing for the root (value of null), com, acme.com, and hq.acme.com domains. all the domain precedent to hq.acme.com must be defined in order to define hq.acme.com.

Click plus (+) from the toolbar, or choose Edit > Create from the menu bar.

The Names Wizard starts.

The wizard guides you through the creation and configuration process, prompting you for:

A unique Oracle Name Server name

A listening protocol address for the Oracle Names server

If you select TCP/IP, then Oracle Corporation recommends using the default and officially registered port of 1575 for the Oracle Names server.

A choice to store information in a database or replicate information among Oracle Names servers

(Click Don't use a region database.)

Verification that this is the first Oracle Names server in the region

If this is not the first Oracle Names server in the region, the wizard then prompts you to discover the other Oracle Names servers or to specify the address of another Oracle Names server in the region.

Verification that this Oracle Names server is in the root administrative region

If you specify that this Oracle Names server is in the root administrative region, configuration completes.

If you specify that this Oracle Names server is not in the root administrative region, it assumes that this Oracle Names server is in a delegated administrative region. The wizard then prompts you for the local administrative region's domain name and the address of an Oracle Names server in the root administrative region before completing.

When the wizard completes, the following message appears:

A Names Server, onames_server, has been created with default settings. Use the Configure Server section to modify the default configuration.

Choose File > Save Network Configuration.

Repeat Steps 2 through 4 to create additional Oracle Names servers in a region. Oracle Net Manager does not support creation of multiple Oracle Names servers on one computer.

Oracle Net Manager creates a names.ora file with the following settings:

Oracle Names server name (NAMES.SERVER_NAME)

Oracle Names server listening protocol address (NAMES.ADDRESSES)

Root administrative region information (NAMES.DOMAIN_HINTS)

Domains in this administrative region (NAMES.DOMAINS)

The names.ora file is created in the $ORACLE_HOME/network/admin directory on UNIX operating systems and the ORACLE_HOME\network\admin directory on Windows NT.

A names.ora file follows with annotations of content:

#Oracle Names server name. The name should include the name of the domain
this Oracle Names server is in.
NAMES.SERVER_NAME=namesvr2.us.acme.com
NAMES.ADDRESSES=
[(ADDRESS_LIST=]
(ADDRESS=(PROTOCOL=tcp)(HOST=namesrv2-server)(PORT=1575))
[(ADDRESS=...))]
[)]
#If an Oracle Names server is in a delegated administrative region, identify
the address of an Oracle Names server in the root administrative region.
NAMES.DOMAIN_HINTS=
(HINT_DESC=
(HINT_LIST=
(HINT=
(NAME=namesrv1)
(ADDRESS=(PROTOCOL=tcp)(HOST=namesrv1-svr)(PORT=1575))
# Specify the domain controlled by this region and the time to live (TTL).
If this is the root administrative region, you must have NAME= (null) to
identify the root domain properly.
NAMES.DOMAINS=
(DOMAIN=
(NAME=us.acme.com)
(MIN_TTL=86400))

Administering Multiple Domains

If you want the region to administer more than one domain, specify the additional domains in the NAMES.DOMAINS parameter with Oracle Net Manager:

In the navigator pane, expand Oracle Names Servers.

Select the Oracle Names server.

From the list in the right pane, select Configure Server.

Click the Domains tab.

Enter the domain name in the Domain Name field and time-to-live information, and then click Add.

Repeat Step 5 for each additional domain.

Choose File > Save Network Configuration.

In the following example, NAMES.DOMAINS contains a listing for the root (value of null), com, acme.com, and hq.acme.com domains. all the domain precedent to hq.acme.com must be defined in order to define hq.acme.com.

The Discover command produces an .sdns.ora file in $ORACLE_HOME/network/names on UNIX operating systems or a sdns.ora file in ORACLE_HOME\network\names on Windows. This file contains the names and addresses of the Oracle Names servers.

If an Oracle Names server does not respond, a dialog prompts you for another Oracle Names server address. If you know the network address of a particular Oracle Names server, enter it.

Start the second Oracle Names server, following Step 1.

For each Oracle Names server added to the region, repeat Steps 2-3.

Start the first Oracle Names server in the region:

namesctl
NAMESCTL> START

From the second Oracle Names server, discover the first Oracle Names server.

namesctl
NAMESCTL> REORDER_NS

The REORDER_NS command produces an .sdns.ora file in $ORACLE_HOME/network/names on UNIX operating systems or a sdns.ora file in ORACLE_HOME\network\names on Windows. This file contains the name and address of the first Oracle Names server.

If an Oracle Names server cannot be found, and you know the network address of a particular Oracle Names server, enter the address at the prompt. For example:

Discover Oracle Names servers by dynamically creating an .sdns.ora file in $ORACLE_HOME\network\names on UNIX operating systems, and sdns.ora file in ORACLE_HOME\network\names on Windows operating systems. This file contains the order of names and addresses of the Oracle Names server(s) to contact. Client computers read this file to find the addresses of Oracle Names servers to contact.

Preferred Oracle Names servers take precedence over the Oracle Names servers configured in the .sdns.ora or sdns.ora file.

The Discover command produces an .sdns.ora file in $ORACLE_HOME/network/names on UNIX operating systems or a sdns.ora file in ORACLE_HOME\network\names on Windows. This file contains the names and addresses of the Oracle Names server(s). This file is read to find the addresses of Oracle Names servers.

If an Oracle Names server does not respond, a dialog prompts you for another Oracle Names server address. If you know the network address of a particular Oracle Names server, enter it.

Discover the other Oracle Names servers:

namesctl
NAMESCTL> REORDER_NS

The REORDER_NS command produces an .sdns.ora file in $ORACLE_HOME/network/names on UNIX operating systems or a sdns.ora file in ORACLE_HOME\network\names on Windows. This file contains the names and addresses of the Oracle Names server(s). This file is read to find the addresses of Oracle Names servers.

If an Oracle Names server cannot be found, and you know the network address of a particular Oracle Names server, enter the address at the prompt. For example:

If you want Oracle Names to be the first method to reconcile net service names, set the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file in the following manner:

In the navigator pane, expand Local > Profile.

From the list in the right pane, select Naming.

Click the Methods tab.

From the Available Methods list, select ONAMES, and then click the right-arrow.

From the Selected Methods list, select ONAMES, and then use the Promote button to move the selection to the top of the list.

Choose File > Save Network Configuration.

The sqlnet.ora file should contain an entry that lists onames first in the NAMES.DIRECTORY_PATH parameter:

NAMES.DIRECTORY_PATH=(onames, tnsnames, hostname)

You may configure additional features for clients that use Oracle Names. Table 9-4 describes the client sqlnet.ora file settings for Oracle Names.

Table 9-4 Client Settings In sqlnet.ora for Oracle Names

Oracle Net Manager Field

sqlnet.ora Parameter

Description

Default Domain

NAMES.DEFAULT_DOMAIN

Indicates the domain name space from which the client most often requests an Oracle Names server. When set, this name is automatically appended to any unqualified name in an Oracle Names request. Oracle Net sets the default domain to NULL by default.

Maximum Wait Each Attempt

NAMES.INITIAL_RETRY_
TIMEOUT

Specifies how long a client waits for a response from an Oracle Names server before reiterating the request to another Oracle Names server. Oracle Net waits for 15 seconds by default.

Attempts Per Names Server

NAMES.REQUEST_RETRIES

Specifies the number of times a client attempts to iterate through the list of Oracle Names servers before allowing the operation to fail. Oracle Net attempts to iterate through the list of Oracle Names servers once before allowing the operation to fail by default.

Maximum Open Connections

NAMES.MAX_OPEN_
CONNECTIONS

Specifies how many connections an Oracle Names client may have open at one time. Oracle Net enables a client to have 10 connections open at any one time by default. This default value should be sufficient for almost all situations.

Initial Preallocated Requests

NAMES.MESSAGE_POOL_
START_SIZE

Enables you to preallocate an initial number of messages in a client's message pool. These messages may be used for future requests to Oracle Names servers. Oracle Net allocates 10 messages in the pool by default. This default value should be sufficient for almost all situations.

To add or configure these features:

In the navigator pane, expand Local > Profile.

From the list in the right pane, select Naming.

Click the Oracle Names tab.

Enter data for the options indicated in the table on the previous page.

Choose File > Save Network Configuration.

Task 5: (Optional) Configure Client Caches

To avoid clients sending requests to Oracle Names server for name lookups, you can create a client cache process local to the client. A client cache:

Optimizes response time for clients by putting their most frequently referenced name and address definitions closer to them

Reduces the request load on existing Oracle Names servers

The most optimal environment for the client cache is a large multiuser computer where the users are running a particular Oracle client application. Clients on a single-user computer with wide-ranging interests in the databases will also derive some benefit from a cache.

A client cache involves running a local Oracle Names cache process on the client. The client cache has no authoritative data but uses the discovery list file (.sdns.ora or sdns.ora) to find Oracle Names server in the local region. Requests from clients are forwarded to the Oracle Names server, and the results are cached by the cache process so that subsequent requests for that object can be answered directly by the cache process

In a sense, the client cache is a client version of the Oracle Names server. The client cache is distinguished from an Oracle Names server in the following ways:

It is not authoritative for any administrative region

It uses a protocol address that is local to the computer. By default this address is(ADDRESS=(PROTOCOL=ipc)(KEY=onames)).

Its parameter are configured in the sqlnet.ora file rather than the names.ora file

Different executable named onrsd that is smaller in size and functionality

The client cache does not require anything beyond what is usually present in sqlnet.ora file or the discovery list file (.sdns.ora or sdns.ora). However, many of the parameters from names.ora file can also be set in sqlnet.ora for the client cache.

On Windows NT, the client cache may also be started through the Control Panel:

Select Services icon in the Control Panel window.

Select the OracleHOME_NAMEClientCache service.

Click Start.

In the Services window, click Close.

The START_CLIENT_CACHE command starts a client cache process. The client cache process finds a list of the local Oracle Names servers in static list of preferred Oracle Names server in the sqlnet.ora file or in the discovery list file (.sdns.ora or sdns.ora) the first time it runs. Afterwards, it relies on its cache checkpoint file if restarted. Once the client cache has contact with the local region server(s), it will begin to cache data on all local servers, various foreign servers, and all the data it has been asked to find.

Administering a Client Cache

Once configuration is complete, administration for a client cache is essentially the same as it ia for an Oracle Names server, that is, you can use the Oracle Names Control utility commands to control and administer the client cache.

As described in Table 3-7, an Oracle Names server stores many kinds of information, including database locations, Oracle Names server locations, net service names, aliases, and global database links. If you would like to store any of the following kinds of information, you must register it using either Oracle Net Manager or the Oracle Names Control utility:

Registration needs to occur with only one Oracle Names server in an administrative region. The other Oracle Names servers see the information if data is stored in a region database, or the information is propagated to other Oracle Names if you chose not to use a region database.

Net Service Names

Oracle Corporation advises creating a net service name for each service. If a net service name is not created, a user trying to connect to a database service must pass the database service name to make a connection. Rather than provide this information to your end users, create a net service name for the service.

To create a net service name, use either Oracle Net Manager or Oracle Names Control utility:

Note: Additional addresses can be created by choosing plus (+) at the bottom of the Address tab.

Enter a destination service. If the destination service is an Oracle9i or Oracle8i database, then enter the service name in the Service Name field. If destination service is prior to Oracle8i, then select Oracle8 Release 8.0 Compatible Identification, and enter its SID in the SID field.

If you have been using local naming as your configuration method and want to migrate to an Oracle Names configuration, you can upload the net service name information used in the tnsnames.ora file to an Oracle Names server. To load information from a local naming configuration file into an Oracle Names server, use either Oracle Net Manager or Oracle Names Control utility:

A global database link that is the same as the global database name is automatically registered with an Oracle Names server. Any client in the network can use a global database link to access an object in a database. For example, if the global database name is sales.us.acme.com, a global database link of sales.us.acme.com is created and registered with an Oracle Names server. A client can then use sales.us.acme.com to perform a SELECT statement on a table, for example:

Unless you want to specify username and password credentials, no additional configuration is required to use the default global database link. To define a username and password for the default global database link, or create a new global database link:

Adding Link Qualifiers

While one global database link for each database is recommended, there is no limit on the number of link qualifiers that may be added. Link qualifiers are appended to global database links to a provide alternate settings for the database username and password credentials. For example, a link qualifier of fieldrep can be appended to sales.us.acme.com. A connection to a remote database with the global database link and link qualifier would be:

SQL> SELECT * FROM emp@sales.us.acme.com@fieldrep

Link qualifiers are primarily for older Oracle database environments where multiple database links are used to get to the different schemas in the database. Rather than use multiple database links, multiple link qualifiers can be created for a database link. Multiple link qualifiers enable the global database links to comply with the GLOBAL_NAMES=true setting in the initialization parameter file. This setting checks to ensure that the global database link (between the @ signs) is the same as the global database name.

To create a global link qualifier for a global database link, use Oracle Net Manager. The Oracle Names Control utility does not support creation of link qualifiers.

Aliases

You can create aliases for almost any type of object stored in an Oracle Names server. An alias is an alternative name for an object. It stores the name of the object it is referencing. When a client requests a lookup of an alias, Oracle Names completes the lookup as if it was actually the entry it is the referenced. For example, an alias of db1alias can be created for an object named db1. When db1alias is used to connect to a database service, as in CONNECT scott/tiger@db1alias, it will actually resolve to and use the connect descriptor information for db1.

There are two main uses of aliases:

Use an alias as a way for clients to refer to a network object by another name.

Use an alias in one domain for an object in another domain. This enables that database service or net service name to be defined once in Oracle Names, but used out of other domains

Enter the alias in the Alias field and the actual name of the object in the Canonical Name field.

Click Execute.

Choose File > Save Network Configuration.

Task 8: Delegate Domains to Delegated Administrative Regions

Each Oracle Names server is responsible for being able to forward a client request to:

At least one domain level down the domain hierarchy toward an object's authoritative administrative region

The root administrative region if the requested object is another branch of the Oracle Names hierarchy

If delegated administrative regions are configured, the upper-level administrative region must delegate subdomains to the delegated administrative regions. If domain delegation is not done, then the Oracle Names servers in the upper-level administrative region assume authority over all subdomains.

To delegate a domain, use either Oracle Net Manager or Oracle Names Control utility:

A domain hint contains the name of the domain and at least one address of an Oracle Names server in that domain. This enables an Oracle Names server to forward the client requests to a specific address, reducing network traffic.

It is necessary for all Oracle Names servers in delegated administrative regions to be configured with a domain hint to an Oracle Names server in the root administration region. This enables an Oracle Names server to forward requests anywhere outside their own subtrees, because all name lookups can be found by forwarding through the root. If a domain hint to the root administrative region is not specified, then the local Oracle Names server will be unable to forward requests to other regions.

If you want to forward requests directly to other administrative regions, configure additional domain hints. Without additional hints, initial requests to remote regions will route through the root Oracle Names server in the region. Domain data will be cached for all regions in the forward chain by all Oracle Names servers in the forward chain. Subsequent requests may then be sent directly to the appropriate region.

To configure a domain hint, manually configure the names.ora file with the NAMES.DOMAIN_HINTS parameter. The syntax for this parameter follows:

The HINT_LIST specifies the list of Oracle Names servers to forward the initial set of queries for the domains listed in the DOMAIN_LIST. A hint contains the name and address of an Oracle Names server in the remote administrative region. The Oracle Names server caches the results of those queries in its memory. If the queries fail, the Oracle Names servers listed in the HINT_LIST will not be cached and the local Oracle Names server continues to run without information about the root administrative region. The HINT_LIST should include enough Oracle Names servers to guarantee that the local Oracle Names server can resolve the query for the root or other Oracle Names servers.

Example: Domain Hint for the Root Administrative Region

In the following example, NAMES.DOMAIN_HINTS contains a domain hint for Oracle Names server rootsvr.com that is located in the root domain of the remote administrative region. The DOMAIN parameter is left null, meaning that the hint is for the root domain.

Configuring the Host Naming Method

In environments where simple connectivity is desired, host naming can eliminate the need for service name lookup in the tnsnames.ora files. However, for large or complex environments where advanced features such as connection pooling, external procedure calls, or Heterogeneous Services, which require additional connect information, are desired, host naming is not suitable. In these cases, another naming method is recommended.

The host naming method is available for TCP/IP network environments only. With host naming, clients use an alias for the service name in connect string to connect to the database.

Clients can connect to a server using host naming if the following conditions are met:

Oracle Net Services software installed on both the client and database service

Oracle TCP/IP protocol support on both the client and database service

An IP address translation mechanism, such as Domain Name System (DNS) or a centrally maintained TCP/IP hosts file, to resolve names

Task 1: Configure the Listener with the Database Service Information

Oracle9i or Oracle8i

If the database can find the listener, then information about the database service is dynamically registered with the listener during service registration, including the service name. The listener is found if:

The default listener named LISTENER running on TCP/IP, port 1521 is running

Oracle8 Release 8.0 or Previous

If the database is an Oracle8 release 8.0 database or Oracle7 database, then database information is registered with the listener through the listener.ora file. For these databases, statically configure the SID_LIST_listener_name section to include the GLOBAL_DBNAME parameter, as shown next:

Task 2: Configure HOSTNAME as the First Naming Method

Configure host naming as the first method specified in the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net can use to resolve connect identifiers to connect descriptors.

Network Information Service (NIS)

Organizations and corporations already using NIS as part of their systems infrastructure have the option to store net service names and addresses in NIS, using NIS external naming.

When a user gives a command such as

sqlplus scott/tiger@payroll

(where payroll is an Oracle service) NIS external naming on the node running the client program (or database server acting as a client program) contacts an NIS server located somewhere in the network, and passes the net service name to the NIS server. The NIS server resolves the net service name into a Oracle Net address and returns this address to the client program (or server acting as a client program). The client program then uses this address to connect to the Oracle database.

A computer that acts as an NIS server runs a program called ypserv, which handles name requests. The ypserv program stores different types of data in special files called maps. For example, passwords are stored in a map called passwd.byname. Oracle database service names are stored in a map called tnsnames.

When a user issues a connect string, NIS external naming uses an RPC call to contact the ypserv program and passes the Oracle net service name payroll and the name of the map--tnsnames. The ypserv program looks in the tnsnames map for the name payroll and its corresponding value, which is the address for the net service name. The address is returned to the client, and the client program (or server acting as a client program) uses this address to contact the database server.

Task 1: Configure NIS Servers to Support the NIS External Naming

Before configuring servers to support the NIS external naming, make sure that NIS is configured and running on the NIS servers that need to resolve Oracle database net service names. Consult your NIS documentation for specifics.

Adding the "tnsnames" Map to the Existing Set of NIS Maps

Keep a copy of the tnsnames.ora file, preferably in $ORACLE_HOME/network/admin directory. You may need to use this file again later to load net service names into the NIS map.

Convert the contents of the tnsnames.ora file to a tnsnames map using the tns2nis program.

Note:

The tns2nis program is supplied with NIS External Naming on the Oracle Universal Installer tape or disk.

For example, run tns2nis on the command line with one argument:

tns2nis tnsnames.ora

The tns2nis program reads the tnsnames.ora file from the current directory. (If tnsnames.ora file is not located in the current directory, you can use a full path name to specify its location--for example, /etc/tnsnames.ora or $ORACLE_HOME/network/admin/tnsnames.ora).

The "tnsnames" map is then written into the current working directory.

Copy tnsnames to the NIS server, if it is not already there.

Install the tnsnames map using makedbm, which is an NIS program.

Note:

This step should be performed by the person in charge of NIS administration.

The makedbm program converts the tnsnames map into two files that the NIS server can read. The location of these files is operating system specific.

See Also:

Oracle operating system-specific documentation for details

For example, to generate and install a tnsnames map on the Solaris Operating System, as the root user, enter the following at the command line:

# makedbm tnsnames /var/yp/'domainname'/tnsnames

Verifying that the "tnsnames" Map Has Been Properly Installed

You can test the NIS server to see if the map has been installed properly by typing a command with the format:

ypmatch net_service_name tnsnames

For example, you might enter:

ypmatch payroll.com tnsnames

This returns the length of the address (in characters) followed by the address; for example:

Task 2: Configure Clients

To configure clients, configure NIS as the first method specified in the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file. This parameter specifies the order of naming methods Oracle Net can use to resolve connect identifiers to connect descriptors.