Tuesday, April 7, 2009

Remote Listener

Registering Information with a Remote Listener:
A remote listener is a listener residing on one computer that redirects connections to a database instance on another computer. Remote listeners are typically used in an Oracle Real Application Clusters (Oracle RAC) environment. You can configure registration to remote listeners, such as in the case of Oracle RAC, for dedicated server or shared server environments.

Registering Information with a Remote Listener in a Dedicated Server Environment:
In a dedicated server environment, you must enable the PMON background process to register with a remote listener. You achieve this goal by configuring the REMOTE_LISTENER parameter in the initialization parameter file. The syntax of the REMOTE_LISTENER initialization parameter is as follows:

REMOTE_LISTENER=listener_alias

listener_alias is resolved to the listener protocol addresses through a naming method such as a tnsnames.ora file on the database host.

To dynamically update the REMOTE_LISTENER initialization parameter, use the SQL statement ALTER SYSTEM SET. If you set the parameter to null with the statement that follows, then PMON de-registers information with the remote listener with which it had previously registered information, as in the following example:

ALTER SYSTEM SET REMOTE_LISTENER=''

To register information with a remote listener in a dedicated server environment:
On the host where the remote listener resides, configure the listener.ora file with the protocol addresses of the remote listener.
For example, assume that a remote listener listens on port 1521 on host sales2-server.
On the database to which you want requests to be redirected, set the REMOTE_LISTENER parameter in the database initialization parameter file to the alias of the remote listener.

For example, suppose that a database resides on host sales1-server. To redirect requests to the database on sales1-server, you can set the REMOTE_LISTENER parameter in the initialization file for the database on host sales1-server as follows:

REMOTE_LISTENER=listener_sales2

Resolve the listener name alias for the REMOTE_LISTENER setting through a tnsnames.ora file on the database host.

For example, in the tnsnames.ora on sales1-server, you can resolve the remote listener alias listener_sales2 as follows:

listener_sales2=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521))
)

Registering Information with a Remote Listener in a Shared Server Environment:
In a shared server environment, you can use the same registration technique as for a dedicated server environment. Alternatively, you can set the LISTENER attribute of the DISPATCHERS parameter in the initialization parameter file to register the dispatchers with any listener.

The LISTENER attribute overrides the REMOTE_LISTENER parameter. Because the REMOTE_LISTENER parameter and the LISTENER attribute enable PMON to register dispatcher information with the listener, you need not specify both the parameter and the attribute if the listener values are the same.

The syntax of the LISTENER attribute is as follows:
DISPATCHERS="(PROTOCOL=tcp)(LISTENER=listener_alias)"

To register information with a remote listener in a shared server environment:
On the host where the remote listener resides, configure the listener.ora file with the protocol addresses of the remote listener.

For example, assume that a remote listener listens on port 1521 on host sales2-server.
On the database to which you want requests to be redirected, configure the LISTENER attribute of the DISPATCHERS parameter.

For example, suppose that a database resides on host sales1-server. To redirect requests to the database on sales1-server, set the DISPATCHER parameter in the initialization file for the database on host sales1-server as follows:
DISPATCHERS="(PROTOCOL=tcp)(LISTENER=listeners_sales2)"

Resolve the listener name alias for the LISTENER attribute through a tnsnames.ora file on the database host.

For example, in the tnsnames.ora on sales1-server, you can resolve the remote listener alias listener_sales2 as follows:
listeners_sales2=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521))
)

4 comments:

  1. Hello Sisir Kumar Rath, I am Facundo from Argentina.

    I am trying to configure a remote listener, but I can´t configure the listener.ora correctly, for example:

    LISTOID =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sales1-server)(PORT = 1522))
    )
    )
    If I put into HOST sales1-server, the listener doesn´t up:

    Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sales1-server)(PORT=1522)))
    TNS-12545: Connect failed because target host or object does not exist


    If I put into HOST sales2-server, the listener up correctly, but when I tried to connect through TOAD, appear:
    ORA-12519: TNS: no appropiate service handler found, so into tnsnames of sales2-server is:

    INSTANCE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sales1-server)(PORT = 1522))
    )
    (CONNECT_DATA =
    (SID = INSTANCE)
    )
    )

    Otherwise, into sales1-server I have:

    LISTOID =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sales2-server)(PORT = 1522))
    )
    )

    And the parameter REMOTE_LISTENER=LISTOID

    This is all, I have any errors?

    Thanks

    ReplyDelete
  2. Hi Facundo,

    1: Make sure the following is either mentioned in /etc/hosts file or registered in DNS server (Do nslookup) correctly with the corresponding IP address.
    sales1-server
    sales2-server

    2: Make sure the IP address for sales1-server is mounted in sales1-server. Do ifconfig -a

    2: Make sure the IP address for sales2-server is mounted in sales2-server. Do ifconfig -a

    3: Start the listener in sales1-server and sales2-server. Do listener start ListenerName

    4: If you are in sales1-server then the REMOTE_LISTENER parameter should have the listener name which is hosted in sales2-server.

    5: If you are in sales2-server then the REMOTE_LISTENER parameter should have the listener name which is hosted in sales1-server.

    6: Test the connectivity.

    Hope it helps.

    Sorry for delayed response.

    Regards
    Sisir

    ReplyDelete
  3. hi..

    i simply enter the cmd in sqlplus that
    ALTER SYSTEM SET REMOTE_LISTENER='listener_sri';
    but it showed some error in it so i enter the cmd like
    ALTER SYSTEM SET REMOTE_LISTENER='listener_sri scope=spfile;
    that time it got worked
    but again i used the command
    ALTER SYSTEM SET REMOTE_LISTENER='' scope=spfile;
    after that my oracle is not working cant even use the sqlplus prmt, showing error that oracle not found..plz help me

    ReplyDelete
  4. DreamHost is ultimately the best hosting company with plans for any hosting requirments.

    ReplyDelete