9.2.2 Registering Information with a Local Listener

By default, the LREG process registers service information with its local listener on the default local address of TCP/IP, port 1521. If the listener configuration is synchronized with the database configuration, then LREG can register service information with a nondefault local listener or a remote listener on another node. Synchronization occurs when the protocol address of the listener is specified in the listener.ora file and the location of the listener is specified in the initialization parameter file.

To have the LREG process register with a local listener that does not use TCP/IP, port 1521, configure the LOCAL_LISTENER parameter in the initialization parameter file to locate the local listener.

For a shared server environment, you can use the LISTENER attribute of the DISPATCHERS parameter in the initialization parameter file to register the dispatchers with a nondefault local listener. Because the LOCAL_LISTENER parameter and the LISTENER attribute enable LREG to register dispatcher information with the listener, it is not necessary to specify both the parameter and the attribute if the listener values are the same.

LOCAL_LISTENER is a comma-delimited list parameter. If a comma appears in the string, then the entire string must be enclosed in double quotation marks. Set the LOCAL_LISTENER parameter as follows:

ALTER SYSTEM SET LOCAL_LISTENER=["]listener_address["][,...];

For example, if the listener address "ab,cd" is entered, then it resolves to one listener address. If the address is entered as ab,cd, then it resolves to two listener addresses, ab and cd.

For shared server connections, set the LISTENER attribute as follows:

ALTER SYSTEM SET DISPATCHERS="(PROTOCOL=tcp)(LISTENER=listener_address)";

In the preceding command, listener_address is resolved to the listener protocol addresses through a naming method, such as a tnsnames.ora file on the database server.

Note:

  • To dynamically update the LOCAL_LISTENER parameter, use the SQL statement ALTER SYSTEM as follows:

    ALTER SYSTEM SET LOCAL_LISTENER=["]listener_address["][,...]
    

    If you set the parameter to null using the following statement, then the default local address of TCP/IP, port 1521 is assumed:

    ALTER SYSTEM SET LOCAL_LISTENER=''
    
  • The LISTENER attribute overrides the LOCAL_LISTENER parameter. As a result, the SQL statement ALTER SYSTEM SET LOCAL_LISTENER does not affect the setting of this attribute.

In Example 9-1, a database resides on host sales1-server. The listener on this host is named listener_sales1 and is configured to listen on port 1421 instead of port 1521.

Example 9-1 Registering a Local Listener in a Dedicated Server Environment

  1. On the host where the local listener resides, configure the listener.ora file with the protocol address of the listener using Oracle Net Manager.

  2. On the database, set the LOCAL_LISTENER parameter in the database initialization parameter file to the alias of the local listener. For example:

    ALTER SYSTEM SET LOCAL_LISTENER=listener_sales1;
    

    If the database is configured for shared server connections, then you could set the LISTENER attribute as follows:

    ALTER SYSTEM SET DISPATCHERS="(PROTOCOL=tcp)(LISTENER=listener_sales1)";
    
  3. Resolve the listener name alias for the LOCAL_LISTENER setting through a tnsnames.ora file on the database host using a text editor, as follows:

    listener_sales1= 
     (DESCRIPTION = 
      (ADDRESS = (PROTOCOL=tcp)(HOST=sales-server)(PORT=1421)))

    Note:

    • If you are registering a local listener and use Oracle Connection Manager, then do not include (DESCRIPTION = or its closing parenthesis.

    • A network service name entry can be created for the protocol address without the CONNECT_DATA section of the connect descriptor.

See Also: