Skip Headers

Oracle9i Net Services Administrator's Guide
Release 2 (9.2)

Part Number A96580-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page Go to next page
View PDF

9
Configuring Naming Methods

This chapter describes how to configure connectivity information for client connections to the database server.

This chapter contains these topics:

Naming Method Configuration Overview

To connect to a service, clients use a connect identifier in the connect string to connect to a service. The connect identifier can be a connect descriptor or a simple name that maps to a connect descriptor. The connect descriptor contains:

A simple name is resolved to a connect descriptor by a naming method. Naming method configuration consists of the following steps:

  1. Select a naming method.
  2. Map connect descriptors to simple names.
  3. Configure clients to use the naming method.

About Connect Descriptors

A connect descriptor is comprised of one or more protocol addresses of the listener and connect data information for the destination service.

The following example shows a connect descriptor mapped to simple name called sales:

sales=
 (DESCRIPTION= 
  (ADDRESS= (PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
  (CONNECT_DATA= 
     (SERVICE_NAME=sales.us.acme.com)))

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:

sales=
 (DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)) 
  (CONNECT_DATA= 
     (SERVICE_NAME=sales.us.acme.com)
     (INSTANCE_NAME=sales)))

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.

See Also:

"Database Service and Database Instance Identification"

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:

sales=
 (DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521)) 
  (CONNECT_DATA= 
     (SID=sales)))

Naming Methods

Table 9-1 describes the naming methods that Oracle Net supports.

Table 9-1  Naming Methods
Naming Method Description

Local Naming

Resolves a net service name stored in a tnsnames.ora file stored on a client

Local naming is most appropriate for simple distributed networks with a small number of services that change infrequently.

See Also: "Configuring the Local Naming Method"

Directory Naming

Resolves a database service name, net service name, or net service alias stored in a centralized LDAP-compliant directory server

See Also: "Configuring the Directory Naming Method"

Oracle Names

Resolves a database or alias objects stored in an Oracle Names server

See Also: "Configuring the Oracle Names Method"

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.

See Also: "Configuring the Host Naming Method"

External Naming

Resolves service information stored in an a third-party naming service

See Also: "Configuring External Naming Methods"

See Also:

"Naming"

Configuring the Local Naming Method

The local naming method adds net service names to the tnsnames.ora file. Each net service name maps to a connect descriptor. The example a net service name mapped to a connect descriptor:

sales=
(DESCRIPTION= 
  (ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))
  (CONNECT_DATA= 
     (SERVICE_NAME=sales.us.acme.com)))

In this example, the net service name sales is mapped to the connect descriptor contained in DESCRIPTION. DESCRIPTION contains the protocol address and identifies the destination database service.

You can configure local naming during or after installation, as described in these topics:

Configuring the tnsnames.ora File During Installation

Oracle Net Configuration Assistant enables you to configure net service names for clients. Oracle Universal Installer launches Oracle Net Configuration Assistant after software installation. The configuration varies depending on the installation mode.

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:

Task 1: Configure Net Service Names

Task 2: Configure TNSNAMES as the First Naming Method

Task 3: Distribute Configuration

Task 4: Configure the Listener

Task 5: Connect to the Database

Note:

The underlying network connection must be operational before attempting to configure connectivity with Oracle Net.

Task 1: Configure Net Service Names

To configure with the local naming method, use either of the following tools:

Oracle Net Manager

To configure net service names in the tnsnames.ora file with Oracle Net Manager:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Local > Service Naming.
  3. Click plus (+) from the toolbar, or choose Edit > Create from the menu bar.

    The Welcome page of the Net Service Name Wizard appears.

  4. Enter any name in the Net Service Name field.

    You can qualify the net service name with the client's domain. The net service name is automatically domain qualified if the sqlnet.ora file parameter NAMES.DEFAULT_DOMAIN is set.

    See Also:

    "Configuring a Default Domain for Clients"

  5. Click Next.

    The Protocol page appears.

  6. Select the protocol on which the listener is configured to listen. Note that this protocol must also be installed on the client.
  7. Click Next.

    The Protocol Settings page appears.

  8. Enter the appropriate parameter information for the selected protocol in the fields provided.

    See Also:

    Oracle9i Net Services Reference Guide for protocol parameter settings



  9. Click Next.

    The Service page appears.

  10. Select a release, enter a destination service, and optionally, select a database connection type.

    Text description of netwiz4.gif follows.

    Text description of the illustration netwiz4.gif

    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.

    See Also:

    "About Connect Descriptors" for further information about the service name string to use

    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.

    See Also:

    Chapter 14, "Configuring Shared Server" for further information about shared server configuration

  11. Click Next.

    The Test page appears.

  12. 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:

    1. Ensure that the database and listener are running, and then click Test.
    2. Click Change Login to change the username and password for the connection, and then click Test.
  13. Click Finish to dismiss the Net Service Name Wizard.
  14. Choose File > Save Network Configuration.

    See Also:
Oracle Net Configuration Assistant

To configure net service names in the tnsnames.ora file with Oracle Net Configuration Assistant:

  1. Start Oracle Net Configuration Assistant.

    See Also:

    "Oracle Net Configuration Assistant"

    The Welcome page appears.

  2. Select Local Net Service Name Configuration, and then click Next.

    The Net Service Name Configuration page appears.

  3. Click Add, and then click Next.

    The Net Service Name Configuration, Database Version page appears.

  4. 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.
  5. Click Next.
  6. 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.

To specify local naming as the first naming method:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Local > Profile.
  3. From the list in the right pane, select Naming.
  4. Click the Methods tab.
  5. From the Available Methods list, select TNSNAMES, and then click the right-arrow button.
  6. From the Selected Methods list, select TNSNAMES, and then use the Promote button to move the selection to the top of the list.
  7. Choose File > Save Network Configuration.

    The sqlnet.ora file updates with the NAMES.DIRECTORY_PATH parameter, listing tnsnames first:

    NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname)
    

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.

See Also:

Chapter 12, "Configuring and Administering the Listener" for listener configuration details

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.

A database service entry is created with Database Configuration Assistant during installation; net service name and net service alias entries can be created with Oracle Net Manager. To modify Oracle Net attributes of a database service entry and the net service name entries, use Oracle Net Manager.

Clients configured to access the directory can use these entries to connect to the database.

This section contains these topics:

Directory Naming Method Configuration Steps

To configure the directory naming method, perform the following tasks:

Task 1: Configure Directory Usage on Server and Clients

Task 2: Create Net Service Name Entries (Optional)

Task 3: Configure LDAP as the First Naming Method

Task 4: Configure the Listener

Task 5: Connect to the Database

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.

See Also:

Chapter 8, "Setting Up Directory Server Usage" for further information about configuring directory server usage

Task 2: Create Net Service Name Entries (Optional)


Notes:

You can configure clients to use a net service name rather than the database service entry created by Database Configuration Assistant.

To create a net service name in a directory server:

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

    See Also:

    "Configuring Directory Usage After Installation" for instructions on using the Select the directory server you want to use, and configure the directory server for Oracle usage option

    "Starting Oracle Net Manager" for instructions on using Oracle Net Manager

  2. In the navigator pane, expand Directory > Service Naming.
  3. Click plus (+) from the toolbar, or choose Edit > Create from the menu bar.

    The Welcome page of the Net Service Name Wizard appears.

  4. Enter any name in the Net Service Name field.
  5. Click Next.

    The Protocol page appears.

  6. Select the protocol on which the listener is configured to listen. Note that this protocol must also be installed on the client.
  7. Click Next.

    The Protocol Settings page appears.

  8. Enter the appropriate parameter information for the selected protocol in the fields provided.

    See Also:

    Oracle9i Net Services Reference Guide for protocol parameter settings



  9. Click Next.

    The Service page appears.

  10. Select a release, enter a destination service, and optionally, select a database connection type.

    Text description of netwiz4.gif follows.

    Text description of the illustration netwiz4.gif

    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.

    See Also:

    "About Connect Descriptors" for further information about the service name string to use

    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.

    See Also:

    Chapter 14, "Configuring Shared Server" for further information about shared server configuration

  11. Click Next.

    The Test page appears.

  12. 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:

    1. Ensure that the database and listener are running, and then click Test.
    2. Click Change Login to change the username and password for the connection, and then click Test.
  13. Click Finish to dismiss the Net Service Name Wizard.

    See Also:

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.

To specify directory naming as the first naming method:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Local > Profile.
  3. From the list in the right pane, select Naming.
  4. Click the Methods tab.
  5. From the Available Methods list, select LDAP, and then click the right-arrow button.
  6. From the Selected Methods list, select LDAP, and then use the Promote button to move the selection to the top of the list.
  7. Choose File > Save Network Configuration.

    The sqlnet.ora file updates with the NAMES.DIRECTORY_PATH parameter, listing ldap first:

    NAMES.DIRECTORY_PATH=(ldap, tnsnames, onames, hostname)
    

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.

See Also:

Chapter 12, "Configuring and Administering the Listener" for listener configuration details

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.

See Also:

Modifying Connectivity Information for Database Service Entries


Note:

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:

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

    See Also:

    "Configuring Directory Usage After Installation" for instructions on using the Select the directory server you want to use, and configure the directory server for Oracle usage option

    "Starting Oracle Net Manager" for instructions on using Oracle Net Manager

  2. In the navigator pane, expand Directory > Service Naming.
  3. Select the database service. The right pane displays the current destination service name.
  4. In the Address Configuration box, click plus (+).

    A new Address tab appears.

  5. Select a protocol, and then enter the appropriate parameter information for the selected protocol in the fields provided.

    See Also:

    Oracle9i Net Services Reference Guide for protocol parameter settings

  6. In the right pane, click Apply.

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.
  • You can export existing alias objects from an Oracle Names server. See Chapter 10, "Exporting Naming Data to a Directory Server".
  • 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:

To create a net service alias:

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

    See Also:

    "Configuring Directory Usage After Installation" for instructions on using the Select the directory server you want to use, and configure the directory server for Oracle usage option

    "Starting Oracle Net Manager" for instructions on using Oracle Net Manager

  2. In the navigator pane, expand Directory > Service Naming > Aliases.
  3. Click plus (+) from the toolbar, or choose Edit > Create from the menu bar.

    The Create Alias dialog box appears.

    Text description of alias1.gif follows.

    Text description of the illustration alias1.gif

  4. In the Net Service Alias field, enter a name for the alias.
  5. In the Net Service Name or Database Service box, enter the information in the fields described in Table 9-2.
    Table 9-2  Net Service Name/Database Service Box Fields
    Field Description

    Oracle Context

    Specify the Oracle Context of the database service or net service name by selecting one from the list or entering one in the field.

    Name

    Specify the DN of the database service or net service name by selecting one from the list or entering one in the field.

  6. Click Create.

    The Aliases folder updates with the created net service alias.

    Text description of alias2.gif follows.

    Text description of the illustration alias2.gif

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.


See Also:

Oracle9i Database Migration for the procedures for upgrading previous release of Oracle Names to 9i

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.

Configuring Oracle Names involves these tasks:

Task 1: Consider Oracle Names Options

Task 2: Install Necessary Components

Task 3: Create an Oracle Names Server

Task 4: Configure Clients and Database Servers To Use Oracle Names Servers

Task 5: (Optional) Configure Client Caches

Task 6: Configure the Listener

Task 7: Register Data with the Oracle Names Server

Task 8: Delegate Domains to Delegated Administrative Regions

Task 9: Specify Domain Hints to Forward Requests to Remote Oracle Names Servers

Task 10: Connect to the Database

Task 1: Consider Oracle Names Options

Prior to creating an Oracle Names server, you must decide whether:

Task 2: Install Necessary Components

Ensure that the following are installed:

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:

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.

If you would like to use this Oracle Names server, proceed to "Task 2: Discover Oracle Names Servers".

Create Tables in a Database

To store service data in an Oracle database, perform the following tasks:

Task 1: Configure the Database Server

To configure the database server:

  1. Start the database if it is not currently running; otherwise, go to Step 2.

    See Also:

    "Task 4: Start the Database"

  2. Connect to the database as the SYSTEM user:
    SQL> CONNECT system/password
    
    

    where password is MANAGER for the SYSTEM user account by default.

  3. Create a user that can create tables.
    1. Create user. In the following example syntax, the default tablespace is users and the temporary tablespace is temp:
      CREATE USER user
      IDENTIFIED BY password
      DEFAULT TABLESPACE users
      TEMPORARY TABLESPACE temp;
      
      
      
    2. Grant the user the ability to connect to the database:
      GRANT CREATE SESSION TO user;
       
      
    3. Grant the user the ability to update tables in the users tablespace:
      GRANT RESOURCE users TO user; 
      
      
      
    4. Grant the ability to create synonyms in the user's schema:
      GRANT CREATE SYNONYM TO user; 
      
    See Also:

    Oracle9i Database Administrator's Guide for further information about creating users

  4. 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.
    SQL> CONNECT user/password
    SQL> @oracle_home/network/admin/namesini.sql;
    
Task 2: Create Oracle Names Servers

For each computer where Oracle Names is installed and where you want an Oracle Names server, create an Oracle Names server from Oracle Net Manager.

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Oracle Names Servers.
  3. 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.

  4. Choose File > Save Network Configuration.
  5. 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:

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))
See Also:

Oracle9i Net Services Reference Guide for names.ora file parameters

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:

  1. In the navigator pane, expand Oracle Names Servers.
  2. Select the Oracle Names server.
  3. From the list in the right pane, select Configure Server.
  4. Click the Domains tab.
  5. Enter the domain name in the Domain Name field and time-to-live information, and then click Add.
  6. Repeat Step 5 for each additional domain.
  7. 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.

NAMES.DOMAINS=
 (DOMAIN_LIST=
 (DOMAIN=
  (NAME=)
  (MIN_TTL=86400))
 (DOMAIN=
  (NAME=com)
  (MIN_TTL=86400))
 (DOMAIN=
  (NAME=acme.com)
  (MIN_TTL=86400))
 (DOMAIN=
  (NAME=hq.acme.com)
  (MIN_TTL=86400)))
Task 3: Start the Oracle Names Server

To start the Oracle Names server, use either Oracle Net Manager or Oracle Names Control utility:

Use Oracle Net Manager... Use Oracle Names Control utility...
  1. In the navigator pane, expand Oracle Names Servers.
  2. Select the Oracle Names server.
  3. From the list in the right pane, select Manage Server.
  4. Click the Control tab.
  5. Click Start.
  6. Click Apply.

    The following message appears:

    Server started successfully.
    

    On Windows NT, a service called OracleHOME_NAMENamesonames_server is created.

From the operating system command line, enter:

namesctl

If the following error messages appear, ignore them.

NNL-00024: warning: no preferred names 
servers in SQLNET.ORA
NNL-00018: warning: could not contact 
default name server

NAMESCTL> START

The START command loads the Oracle Names server into memory and tells it to begin executing. At startup, the Oracle Names server loads its configuration and data.

On Windows NT, a service called OracleHOME_NAMENamesonames_server is created

Checkpoint Files/Replicated Updates

To replicate data among Oracle Names server in checkpoint files, perform these tasks:

Task 1: Create an Oracle Names Server

For each computer where Oracle Names is installed and where you want an Oracle Names server, create an Oracle Names server from Oracle Net Manager:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Oracle Names Servers.
  3. 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.

  4. Choose File > Save Network Configuration.
  5. 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:

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))
See Also:

Oracle9i Net Services Reference Guide for names.ora file parameters

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:

  1. In the navigator pane, expand Oracle Names Servers.
  2. Select the Oracle Names server.
  3. From the list in the right pane, select Configure Server.
  4. Click the Domains tab.
  5. Enter the domain name in the Domain Name field and time-to-live information, and then click Add.

  6. Repeat Step 5 for each additional domain.
  7. 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.

NAMES.DOMAINS=
 (DOMAIN_LIST=
 (DOMAIN=
  (NAME=)
  (MIN_TTL=86400))
 (DOMAIN=
  (NAME=com)
  (MIN_TTL=86400))
 (DOMAIN=
  (NAME=acme.com)
  (MIN_TTL=86400))
 (DOMAIN=
  (NAME=hq.acme.com)
  (MIN_TTL=86400)))
Task 2: Discover Oracle Names Servers

After all the Oracle Names servers are created, have each Oracle Names server, except the first one in the region, discover the other Oracle Names servers in a region.

To discover other Oracle Names servers, use either Oracle Net Manager or Oracle Names Control utility:

Use Oracle Net Manager... Use Oracle Names Control utility...
  1. Start the first Oracle Names server in the region:

    a. In the navigator pane, expand Oracle Names Servers.

    b. Select the Oracle Names server.

    c. From the list in the right pane, select Manage Server.

    d. Click the Control tab.

    e. Click Server Operations, and then click Start.

    f. Click Apply to start the Oracle Names server. The following message appears:

    Server started successfully.

  2. From the second Oracle Names server, discover the first Oracle Names server. Choose Command > Discover Oracle Names Servers. The following message appears:
    Discovered Oracle Names Server in the 
    region. Please exit the tool and start 
    again.
    

    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.

  3. Start the second Oracle Names server, following Step 1.
  4. For each Oracle Names server added to the region, repeat Steps 2-3.
  1. Start the first Oracle Names server in the region:
    namesctl
    NAMESCTL> START
    
    
  2. 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:

    NAMESCTL> reorder_ns  
    (ADDRESS=(PROTOCOL=tcp)(HOST=mail-server)(
    PORT=1575))
    
  3. Start the second Oracle Names server in the region:
    NAMESCTL> START
    
    
  4. Connect to the first Oracle Names server in the region, and query for the second Oracle Names server to make sure it has registered itself.
    NAMESCTL> QUERY onames_server
    
    
  5. For each Oracle Names server added to the region, repeat Steps 2-4.
See Also:

"About Discovery"

Task 4: Configure Clients and Database Servers To Use Oracle Names Servers

To configure client and database server computers to use Oracle Names servers:

  1. Create a list of Oracle Names servers to contact, using one of the following methods:
    • Create a static list of preferred Oracle Names server in the sqlnet.ora file, as described in "Configuring Preferred Oracle Names Servers".
    • 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.

    See Also:

    "About Discovery" for a description of discovery

    To create an .sdns.ora file or an sdns.ora file, use either Oracle Net Manager or Oracle Names Control utility:

    Use Oracle Net Manager... Use Oracle Names Control utility...
    1. Start Oracle Net Manager.

      See Also: "Starting Oracle Net Manager"

    2. Choose Command > Discover Oracle Names Servers.

      The following message appears:

      Discovered Oracle Names Server 
      in the region. Please exit the 
      tool and start again.
      

      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:

    NAMESCTL> REORDER_NS 
    (ADDRESS=(PROTOCOL=tcp)(HOST=mail-ser
    ver)(PORT=1575))
    
  2. 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:
    1. In the navigator pane, expand Local > Profile.
    2. From the list in the right pane, select Naming.
    3. Click the Methods tab.
    4. From the Available Methods list, select ONAMES, and then click the right-arrow.
    5. From the Selected Methods list, select ONAMES, and then use the Promote button to move the selection to the top of the list.

    6. 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)
    
  3. 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:

    1. In the navigator pane, expand Local > Profile.
    2. From the list in the right pane, select Naming.
    3. Click the Oracle Names tab.
    4. Enter data for the options indicated in the table on the previous page.
    5. 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:

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:

Creating a Client Cache

To create and start a client cache:

  1. Ensure discovery of Oracle Names servers has been performed, as described in "Task 4: Configure Clients and Database Servers To Use Oracle Names Servers". The information gathered during discovery is used for the client's cache.
  2. (Optional) Configure additional parameters in the sqlnet.ora file.

    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.

    See Also:

    Oracle9i Net Services Reference Guide for names.ora file parameters for more information about names.ora file parameters

  3. Create and start the client cache on the client.
    namesctl
    NAMESCTL> START_CLIENT_CACHE
    
    

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

    1. Select Services icon in the Control Panel window.
    2. Select the OracleHOME_NAMEClientCache service.
    3. Click Start.
    4. 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.

See Also:

Oracle9i Net Services Reference Guide for a complete list of administrative commands

Starting and Stopping the Client Cache

In terms of starting and stopping, the client cache behaves essentially the same as an Oracle Names server, except that is usually accessible locally through an IPC protocol address.

Starting the client cache requires the START_CLIENT_CACHE command rather than the START command.

Stopping the client cache requires specifying the protocol address of the client cache with the SET SERVER command or the STOP command:

namesctl
NAMESCTL> SET SERVER (ADDRESS=(PROTOCOL=ipc)(KEY=onames))
NAMESCTL> STOP
namesctl
NAMESCTL> STOP (ADDRESS=(PROTOCOL=ipc)(KEY=onames))

On Windows NT, stopping the OracleHOME_NAMEClientCache service stops caching for all Oracle Names servers.

Verifying the Client Cache is Working

To verify that the client cache is working, query an Oracle Names server from the client as follows:

namesctl
NAMESCTL> SET SERVER onames_server

If the client cache process does not find an Oracle Names server, every query it receives will fail with the following error message:

NNC-00419: authoritative server is unreachable

The STATUS command shows how many requests the client cache has received, how many of those were forwarded, and how many items are cached. For example:

namesctl
NAMESCTL> STATUS
     Version banner is "Oracle Names Client Cache for Solaris: Version 9.0...

     Server name:                              ""
     Server has been running for:              2 minutes 39.92 seconds
     Request processing enabled:               yes
     Request forwarding enabled:               yes
     Requests received:                        53
     Requests forwarded:                       2
     Foreign data items cached:                4

...

Task 6: Configure the Listener

If you are not using your operating system's primary protocol, configure the listener with listening protocol addresses.

See Also:

Chapter 12, "Configuring and Administering the Listener" for listener configuration details

Task 7: Register Data with the Oracle Names Server

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.

After registering these kinds of information, you should query them, as described in "Testing Network Objects with Oracle Net Manager or Oracle Names Control Utility".

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:

Use Oracle Net Manager... Use Oracle Names Control utility...
  1. Start Oracle Net Manager.

    See Also: "Starting Oracle Net Manager"

  2. In the navigator pane, expand Oracle Names Servers.
  3. Select an Oracle Names server.
  4. From the list in the right pane, select Manage Data.
  5. Click the Net Service Names tab.
  6. Click Add.
  7. Enter the net service name in the Service Name field.

    You can qualify the net service name with the client's domain. The net service name is automatically domain qualified if the sqlnet.ora file parameter NAMES.DEFAULT_DOMAIN is set.

  8. Select the protocol the listener is configured to listen on.
  9. Enter the appropriate protocol information for the selected protocol in the fields provided.

    See Also: Oracle9i Net Services Reference Guide for protocol parameter settings

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

  10. 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.

    Note: If you want to configure advanced CONNECT_DATA options besides the destination service, click Advanced.

  11. Click Execute.
  12. Choose File > Save Network Configuration.

From the operating system command prompt, enter:

namesctl
NAMESCTL> REGISTER net_service_name -d 
(description=[(address_list=](address= 
...)(connect_data=(service_name|sid=...)))[)] 

For example, to register a net service name of sales with a default TCP/IP protocol address, enter the following:

NAMESCTL> REGISTER sales -d 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sale
s-server)(PORT=1521))(CONNECT_DATA=(SERVICE_
NAME=sales.us.acme.com)))

You can qualify the net service name with the client's domain. The net service name is automatically domain qualified if the sqlnet.ora file parameter NAMES.DEFAULT_DOMAIN is set.

Note: The connect descriptor cannot contain any spaces.

See Also:

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:

Use Oracle Net Manager... Use Oracle Names Control utility...
  1. Start Oracle Net Manager.

    See Also: "Starting Oracle Net Manager"

  2. In the navigator pane, expand Oracle Names Servers.
  3. Select an Oracle Names server.
  4. From the list in the right pane, select Manage Data.
  5. Click the Net Service Names tab.
  6. Click Load.
  7. Enter the path for your current master local naming configuration file in the File field.
  8. Click Execute.
  9. Choose File > Save Network Configuration.

From the operating system command line, enter:

namesctl
NAMESCTL> LOAD_TNSNAMES tnsnames.ora

Global Database Links and Database Qualifiers

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:

SQL> SELECT * FROM emp@sales.us.acme.com
See Also:

Oracle9i Database Administrator's Guide for further information about how database links are used

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:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Oracle Names Servers.
  3. Select an Oracle Names server.
  4. From the list in the right pane, select Manage Data.
  5. Click the Links tab.
  6. Select Add.
  7. Enter the global database link in the DB Link Name field.

    Note:

    If the GLOBAL_NAMES initialization parameter has been set to true in the initialization parameter file, the name entered must be the same as the global database name.

  8. Enter valid username and password credentials for the database in the User and Password fields.
  9. Choose Execute.
  10. If you want to use a link qualifier, see "Adding Link Qualifiers".
  11. Choose File > Save Network Configuration.

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.

  1. Follows Steps 1 through 8 in the procedure in "Global Database Links and Database Qualifiers".
  2. Click DB Qualifiers.
  3. Click Create Qualifier.

    The Database Qualifier dialog box appears:

    Text description of dbqualif.gif follows.

    Text description of the illustration dbqualif.gif

  4. Enter a name for the link qualifier, valid username and password credentials, and then click OK.

    The link qualifier is added to the DB Qualifiers list box:

    Text description of dbqualia.gif follows.

    Text description of the illustration dbqualia.gif

  5. Repeat Steps 3 and 4 for each link qualifier you want to add.
  6. Click Execute.
  7. Choose File > Save Network Configuration.

To verify that a global database link and link qualifier is working correctly, perform a SELECT statement on a table the user is authorized for:

SQL> SELECT * FROM  table@db_link;
SQL> SELECT * FROM  table@db_link@link_qualifier;

For example:

SQL> SELECT * FROM EMP@sales.us.acme.com;
SQL> SELECT * FROM EMP@sales.us.acme.com@fieldrep;
See Also:

Oracle9i Database Administrator's Guide

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:

To create an alias, use Oracle Net Manager:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Oracle Names Servers.
  3. Select an Oracle Names server.
  4. From the list in the right pane, select Manage Data.
  5. Click the Aliases tab.
  6. Select Add.
  7. Enter the alias in the Alias field and the actual name of the object in the Canonical Name field.
  8. Click Execute.
  9. 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:

    Use Oracle Net Manager... Use Oracle Names Control utility...
    1. Start Oracle Net Manager.

      See Also: "Starting Oracle Net Manager"

    2. In the navigator pane, expand Oracle Names Servers.
    3. Select an Oracle Names server in the upper-level region.
    4. From the list in the right pane, select Manage Data.
    5. Click the Topology tab.
    6. Click Delegate Domain.
    7. Enter the name of the subdomain in the Domain Name field.
    8. Enter the Oracle Names server that serves the domain in the Names Server Name field, and its protocol address in the Names Server Address field.

      See Also: Oracle9i Net Services Reference Guide for more information about protocol syntax needed for address information

    9. Click Execute.
    10. Choose File > Save Network Configuration.

    Create and register an alias with the Oracle Names server:

    namesctl
    NAMESCTL> DELEGATE_DOMAIN domain onames_server 
    (ADDRESS=...)
    
    

    Note: The protocol address cannot contain any spaces.

    See Also: Oracle9i Net Services Reference Guide for more information about protocol syntax needed for address information

    For example, to delegate domain us.acme.com serviced by namesrv3.us.acme.com, enter the following:

    NAMESCTL> DELEGATE_DOMAIN us.acme.com 
    namesrv3.us.acme.com 
    (ADDRESS=(PROTOCOL=tcp)(HOST=namesrv3-server)(
    PORT=1575))
    
    


Task 9: Specify Domain Hints to Forward Requests to Remote Oracle Names Servers

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:

NAMES.DOMAIN_HINTS=
 (HINT_DESC=
   (HINT_LIST=
    (HINT=(NAME=onames_server)(ADDRESS=...)))
   (DOMAIN_LIST=
    (DOMAIN=domain)))

Note:

Specify the root domain with a dot (.) or a null value.


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.

NAMES.DOMAIN_HINTS=
 (HINT_DESC=
   (HINT_LIST=
    (HINT=
      (NAME=rootsvr.com)
      (ADDRESS=(PROTOCOL=tcp)(HOST=root-server)(PORT=1575))))
   (DOMAIN_LIST=
    (DOMAIN=)))

When the local Oracle Names server is started:

  1. It reads the NAMES.DOMAIN_HINTS parameter. For each domain listed in the DOMAIN_LIST, it calls the Oracle Name server listed in the HINT_LIST and queries for all Oracle Names servers in the domain.
  2. Based on the time-to-live (TTL) of the answer, the local Oracle Names server sets up queries that are automatically issued before the remote Oracle Names server data expires.

Example: Domain Hint for Multiple Oracle Names Servers

The following example shows a hint to query two domains, the root domain and the us.acme.com domain, for Oracle Names servers rootsvr.com and namesvr.us.acme.com.

NAMES.DOMAIN_HINTS=
 (HINT_DESC=
   (HINT_LIST=
    (HINT=
     (NAME=rootsvr.com)
     (ADDRESS=(PROTOCOL=tcp)(HOST=root-server)(PORT=1575)))
    (HINT=
     (NAME=namesrv.us.acme.com)
     (ADDRESS=(PROTOCOL=tcp)(HOST=hr-server)(PORT=1575))))
   (DOMAIN_LIST=
    (DOMAIN=)
    (DOMAIN=us.acme.com)))

In this query, the local Oracle Names server:

  1. Sends a query for the root administrative region, using the addresses given in the HINT.
  2. Sends a query for the us.acme.com domain, using the same addresses from the HINT descriptor.

Task 10: Connect to the Database

Clients can connect to the database using the following syntax:

CONNECT username/password@net_service_name
CONNECT username/password@database_service

Removing an Oracle Names Server

To remove an Oracle Names server:

  1. Undefine an Oracle Names server and its authoritative domain with the Oracle Names Control utility's UNREGISTER_NS command. From the command line, enter:
    namesctl
    NAMESCTL> UNREGISTER_NS {onames_server}{domain}
    
    
    

    For example, to unregister a Oracle Names server named namesrv1 in domain us.acme.com, enter the following:

    NAMESCTL> UNREGISTER_NS  namesrv1.us.acme.com us.acme.com
    
    
  2. If it is running, stop the Oracle Names server. Use either Oracle Net Manager or the Oracle Names Control utility.

    Use Oracle Net Manager... Use Oracle Names Control utility...
    1. Start Oracle Net Manager.

      See Also: "Starting Oracle Net Manager"

    2. In the navigator pane, expand Oracle Names Servers.
    3. Select the Oracle Names server.
    4. From the list in the right pane, select Manage Server.
    5. Click the Control tab.
    6. Click Stop, and then click Apply to stop the Oracle Names server.

    From the command line, enter:

    namesctl
    
    
    NAMESCTL> STOP
    
    
  3. Remove the names.ora file from the $ORACLE_HOME/network/admin directory on UNIX or the ORACLE_HOME\network\admin directory on Windows NT.
  4. Remove the ckp*.ora file. By default the checkpoint files are stored in the $ORACLE_HOME/network/names directory on UNIX and the ORACLE_HOME\network\names directory on Windows NT.
  5. Reconfigure clients and the database server with the correct list of Oracle Names servers to contact, as well as the preferred naming method.

    See Also:
  6. Restart Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

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:

To configure the host naming method, perform these tasks:

Task 1: Configure the Listener with the Database Service Information

Task 2: Configure HOSTNAME as the First Naming Method

Task 3: Set Up Host Name Resolution Environment

Task 4: Connect to the Database

Task 1: Configure the Listener with the Database Service Information

You must register database service information with the listener. How this registration takes place depends upon the release of the database:

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:

If the database cannot find the listener, then configure the listener.ora file with the GLOBAL_DBNAME parameter, as described in "Oracle8 Release 8.0 or Previous".

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:

SID_LIST_listener=
(SID_LIST=
 (SID_DESC=
  (GLOBAL_DBNAME=sales.us.acme.com)
  (SID_NAMe=db1)
  (ORACLE_HOME=/u01/app/oracle/8.0.5))
See Also:

"Configuring Static Service Information"

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.

To specify host naming as the first naming method:

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Local > Profile.
  3. From the list in the right pane, select Naming.
  4. Click the Methods tab.
  5. From the Available Methods list, select HOSTNAME, and then click the right-arrow button.
  6. From the Selected Methods list, select HOSTNAME, and then use the Promote button to move the selection to the top of the list.
  7. Choose File > Save Network Configuration.

    The sqlnet.ora file updates with the NAMES.DIRECTORY_PATH parameter, listing hostname first:

    NAMES.DIRECTORY_PATH=(hostname, tnsnames)
    

Task 3: Set Up Host Name Resolution Environment

The service name must be resolved through an IP address translation mechanism, such as DNS, NIS, or a centrally-maintained TCP/IP host file, /etc/hosts.

For example, if a service name of sales.us.acme.com for a database exists on a computer named sales-server, the entry in the /etc/hosts file would look like the following:

#IP address of server     host name       alias
144.25.219.146            sales-server    sales.us.acme.com

Note that the domain section of the service name must match the network domain.

Task 4: Connect to the Database

Clients can connect to the database using the alias. Using the example in "Task 3: Set Up Host Name Resolution Environment", the client can use sales.us.acme.com in the connect string:

CONNECT username/password@sales.us.acme.com

If the client and server are in the same domain of us.acme.com, the client needs to enter only sales in the connect string.

Configuring External Naming Methods

External naming refers to the method of resolving a net service name, stored in a non-Oracle naming service, to a network address. External naming services include:

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

To add the tnsnames map to the existing set of NIS maps:

  1. Create a tnsnames.ora file, as specified in "Configuring the Local Naming Method".


    Note:

    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.


  2. 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.

  3. Copy tnsnames to the NIS server, if it is not already there.
  4. 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:

99 (description=(address=(protocol=tcp)
 (host=garlic)(port=1999)))
 (connect_data=(service_name=dirprod)))

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.

  1. Start Oracle Net Manager.

    See Also:

    "Starting Oracle Net Manager"

  2. In the navigator pane, expand Local > Profile.
  3. From the list in the right pane, select Naming.
  4. Click the Methods tab.
  5. From the Available Methods list, select NIS, and then click the right-arrow button.
  6. In the Selected Methods list, select NIS, and then use the Promote button to move the selection to the top of the list.

  7. Choose File > Save Network Configuration.

    The sqlnet.ora file updates with the NAMES.DIRECTORY_PATH parameter, listing nis first:

    NAMES.DIRECTORY_PATH=(nis, hostname, tnsnames)
    

Distributed Computing Environment (DCE) Cell Directory Service (CDS)

See Also:

Oracle Advanced Security Administrator's Guide for instructions about how to configure Cell Directory Services (CDS)