Configuring the Local Naming Method

The local naming method adds network service names to the tnsnames.ora file. Each network service name maps to a connect descriptor.

The following example shows the network service name sales mapped to the connect descriptor contained in DESCRIPTION. The DESCRIPTION section contains the protocol address and identifies the destination database service. In this example, the protocol is TCP/IP and the port is 1521.

Example 8-1 Connector Descriptor with Host Name

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

The following example shows a valid tnsnames.ora entry to connect to a host identified with an IPv6 address and a port number of 1522.

Example 8-2 Connect Descriptor with IPv6 Address

salesdb =
  ( DESCRIPTION =
    ( ADDRESS=(PROTOCOL=tcp)(HOST=2001:0db8:1:1::200C:417A)(PORT=1522) )
    ( CONNECT_DATA =
        (SERVICE_NAME=sales.example.com) )
  )

You can configure local naming during or after installation, as described in the following sections:

Related Topics

Configuring the tnsnames.ora File During Installation

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

Configuring the tnsnames.ora File After Installation

You can add network service names to the tnsnames.ora file at any time after installation.

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

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

Task 1 Configure Net Services Names

To configure the network services names, use one of the following methods:

Each method provides similar functionality. However, Oracle Net Manager has more configuration options for the sqlnet.ora file.

Task 2 Configure Local Naming 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 configure the local naming method as the first naming method, use one of the following methods:

Each method provides the same functionality.

Local Naming Configuration using Oracle Enterprise Manager Cloud Control

The following procedure describes how to specify local naming as the first naming method using Oracle Enterprise Manager Cloud Control:

  1. Access the Net Services Administration page in Oracle Enterprise Manager Cloud Control.

    See Also: “Accessing the Net Services Administration Page”

  2. SelectNetwork Profile from the Administer list.

  3. Click Go.

  4. Select Naming Methods.

  5. Select TNSNAMES from the Available Methods list.

  6. Click Move to move the selection to the Selected Methods list.

  7. Use the Promote button to move TNSNAMES to the top of the list.

  8. Click OK.

Local Naming Configuration using Oracle Net Manager

The following procedure describes how to specify local naming as the first naming method using Oracle Net Manager:

  1. Start Oracle Net Manager.

    See Also: “Using Oracle Net Manager to Configure Oracle Net Services”

  2. In the navigator pane, select Profile from the Local menu.

  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 Save Network Configuration from the File menu.

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

    NAMES.DIRECTORY_PATH=(tnsnames, EZCONNECT)

Task 3 Copy the Configuration to the Other Clients

After one client is configured, 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 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 configured for the network service name. By default, the listener is configured for the TCP/IP protocol on port 1521.

See Also: Configuring and Administering Oracle Net Listener for listener configuration details

Task 5 Connect to the Database

Clients can connect to the database using the following syntax:

CONNECT username@net_service_name