8.1 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

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

  • Administrator or runtime installation: Oracle Net Configuration Assistant prompts you to configure network 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 network service names in the tnsnames.ora file to connect to an Oracle Database service.

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

  • Net Services Names Configuration using Oracle Enterprise Manager Cloud Control

    The following procedure describes how to configure network service names in the tnsnames.ora file with Oracle Enterprise Manager Cloud Control:

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

    2. Select Local Naming from the Administer list, and then select the Oracle home that contains the location of the configuration files.

    3. The Local Naming page appears. You may be prompted to log in to the database server.

    4. Click Create Like.

      The Create Net Service Name page appears.

    5. Enter a name in the Net Service Name field.

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

    6. In the Database Information section, configure service support as follows:

      1. Enter a destination service name.

        See Also:

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

      2. Select a database connection type.

        The default setting of Database Default is recommended for the connection type. If dedicated server is configured in the initialization parameter file, then 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, then select Shared Server.

        See Also:

        "Configuring a Shared Server Architecture " for additional information about shared server configuration

    7. In the Addresses section, configure protocol support, as follows:

      1. Click Add.

        The Add Address page appears.

      2. From the Protocol list, select the protocol on which the listener is configured to listen. This protocol must also be installed on the client.

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

        See Also:

        Oracle Database Net Services Reference for additional information about protocol parameter settings

      4. (Optional) In the Advanced Parameters section, specify the I/O buffer space limit for send and receive operations of sessions in the Total Send Buffer Size and Total Receive Buffer Size fields.

        See Also:

        "Configuring I/O Buffer Space " for additional information about buffer space

      5. Click OK.

        The protocol address is added to the Addresses section.

    8. Click OK to add the network service name.

      The network service name is added to the Local Naming page.

    9. Select connect-time failover and client load balancing option for the addresses.

    10. Click OK.

    See Also:

  • Net Services Names Configuration using Oracle Net Manager

    The following procedure describes how to configure network service names in the tnsnames.ora file with Oracle Net Manager:

    1. Start Oracle Net Manager.

    2. In the navigator pane, select Service Naming from Local.

    3. Click the plus sign (+) from the toolbar, or select Create from the Edit menu.

      The Welcome page of the Net Service Name wizard appears.

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

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

    5. Click Next.

      The Protocol page appears.

    6. Select the protocol on which the listener is configured to listen. The 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:

      Oracle Database Net Services Reference for additional information about protocol parameter settings

    9. Click Next.

      The Service page appears.

    10. Enter a destination service name, and optionally, select a database connection type.

      Oracle recommends that you use the default setting of Database Default for the connection type. If dedicated server is configured in the initialization parameter file, then 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, then select Shared Server.

      See Also:

    11. Click Next.

      The Test page appears.

    12. Click Test to verify that the network 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 listener and database must be running for a successful test. If they are not, then see "Starting Oracle Net Listener and the Oracle Database Server" 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, then click Close to close the Connect Test dialog box, and proceed to Step 13.

      If the test was not successful, then do the following:

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

      2. Click Change Login to change the user name and password for the connection, and then click Test.

    13. Click Finish to close the Net Service Name wizard.

    14. Select Save Network Configuration from the File menu.

      See Also:

  • Net Services Names Configuration using Oracle Net Configuration Assistant

    The following procedure describes how to configure network service names in the tnsnames.ora file with Oracle Net Configuration Assistant:

    1. Start 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 Service Name Configuration page appears.

    4. Enter a service name in the Service Name field.

    5. Click Next.

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

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.

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

  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