Dynamic registration in Oracle

Service registration allows processes, such as an Oracle database, to identify their available services to the listener, which then acts as a port mapper for those services. The listener uses the dynamic service information about the database and instance received through service registration.

Dynamic service registration is configured in the database initialization file. It does not require any configuration in the listener.ora file. However, listener configuration must be set to listen on the ports named in the database initialization file, and must not have parameters set that prevent automatic registration, such as COST parameters.

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.

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"][,...];

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=''

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.

The listener should be resolvable by tnsping

Suppose you have a listener named listener2 listening on port 1530

  • Ensure that you create an entry in tnsnames.ora which we will use in the parameter LOCAL_LISTENER
listener2=

(DESCRIPTION =

(ADDRESS = (PROTOCOL=tcp)(HOST=localhost)(PORT=1530)))
<ul>
  • On the host where the local listener resides, configure the listener.ora file with the protocol address of the listener.
    • 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=listener2;
    

    Dynamic registration is done by the database by the background process LREG.

    Listener Registration Process (LREG)

    The listener registration process (LREG) registers information about the database instance and dispatcher processes with the Oracle Net Listener (see “The Oracle Net Listener”). When an instance starts, LREG polls the listener to determine whether it is running. If the listener is running, then LREG passes it relevant parameters. If it is not running, then LREG periodically attempts to contact it.

    If the listener is not running when an instance starts, then the LREG process cannot register the service information. LREG attempts to connect to the listener periodically, but it may take up to 60 seconds before LREG registers with the listener after it has been started. To initiate service registration immediately after the listener is started, use the SQL statement ALTER SYSTEM REGISTER. This statement is especially useful in high availability configurations.

    Sourced from Oracle Documentation.

    Leave a comment