About Me

My photo
Bangalore, India
I am an Oracle Certified Professional working in SAP Labs. Everything written on my blog has been tested on my local environment, Please test before implementing or running in production. You can contact me at amit.rath0708@gmail.com.

Wednesday, August 21, 2013

Local Listener vs Remote Listener in Oracle RAC

Concept of Local listener and Remote Listener comes with Oracle RAC database where a single database has multiple instances. PFB example to understand the concept of Local Listener and Remote Listener.

Consider a two node RAC database. It has following components :-

1. Two nodes named NODE1 and NODE2
2. Two listeners on both nodes named LISTENER1 on NODE1 and LISTENER2 on NODE2.
3. Two instances of database on both nodes named ORCL1 on NODE1 and ORCL2 on NODE2 and database name is ORCL

Now Listener1 is running on Node1 where database instance Orcl1 is present. Listener1 is considered as Local Listener for Orcl1 instance as its present on the same node where Orcl1 is running and Listener2 is considered as Remote Listener for Orcl1 instance as its running on different node as the database instance Orcl1.

Similarly, Listener2 is considered as Local Listener for Orcl2 instance as its present on the same node where Orcl2 is running and Listener1 is considered as Remote Listener for Orcl2 instance as its running on different node as the database instance Orcl2.

Purpose of Remote Listener is to connect all instances with all listeners so the instances can propogate their load balance advisories to all listeners. Listener uses the advisories to decide which instance should service client request. If listener get to know from advisories that its local instance is least loaded and should service client request then listener passes client request to local instance. If local instance is over loaded then listener can use TNS redirect to redirect client request to a less loaded instance means remote instance. This Phenomenon is also called as Server Side Load balancing.

PFB steps to configure Local and Remote listener configuration for both instances :-

Node1 :-

orcl1.local_listener=(address of listener_host1)
orcl1.remote_listener=(addresses of both listener_host1 and listener_host2)

Node2 :-

orcl2.local_listener=(address of listener_host2)
orcl2.remote_listener=(addresses of both listener_host1 and listener_host2)

Without Configuration of Remote Listener, each listener will only know about its local instance only and it don't have any knowledge about the load of remote instance. Listener will direct the Client request to local instance only whatever may be the load on local instance. Without this configuration we only left with Client Side Load Balancing.

I hope this article helped you.

Regards,
Amit Rath

17 comments:

  1. Thank you,, It helped me understand the remote listener concept

    ReplyDelete
  2. Very good explanation... great job done !

    ReplyDelete
  3. it's nice explanation , well done.!

    ReplyDelete
  4. Nice One...Please let us know about how SCAN listener also and how connection happen through SCAN.

    ReplyDelete
  5. good explanation..keep it up..!!

    ReplyDelete
  6. What will happen if we have a service and configured it to run on one node as preferred and rest as available. Could you please explain for this scenario?

    ReplyDelete
    Replies
    1. Thanks for writing in , If you have configured your service like you mentioned, then the service will only run on your preferred node. If for some reason your preferred node rebooted or abruptly down then the service will fail-over to the available node.

      Hoping I cleared your doubt.

      Thanks
      Amit Rath

      Delete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. Great explanation... appreciated

    ReplyDelete
  9. Well explained!!! You made it very easy to understand. Thanks!

    ReplyDelete
  10. In the remote listener scan hostname name can be mentioned instead of remote listener ?

    ReplyDelete
  11. I have confused with remote listener,now I understood remote listener concept....thx

    ReplyDelete