Thursday, July 25, 2019

Difference Between Local Listener and Remote Listener

Difference Between Local Listener and Remote Listener


LOCAL_LISTENER is a listener that is running on the same machine as this instance.

REMOTE_LISTENER is a listener that is not running on the same machine as this instance.

Local Listener and Remote Listener concept comes with ORACLE RAC where a single database has multiple instances.

Consider an example of 2 Node RAC Database which is having below components.

TWO Nodes: Node1 and Node2
Two Listeners: listener LSNR1 on Node1 and listener LSNR2 on Node2
Two Instances: instance heart1 on Node1 and instance heart2 on Node2. Database Name is heart.
As per the above information, currently listener LSNR1 is running on Node1 where instance heart1 is present. Then LSNR1 is the Local Listener for heart1 instance as LSNR1 present on the same node where heart1 is running and LSNR2 is the Remote Listener for heart1 instance as LSNR2 is running on different node as the database instance heart1.

Same way, listener LSNR2 is the Local Listener for heart2 instance as LSNR2 present on the same node where heart2 is running and LSNR1 is the Remote Listener for heart2 instance as LSNR1 is running on different node as the database instance heart2.

For Example in RAC, SCAN listeners are remote listeners.

Remote Listener connects to all instances with all listeners so that instances can spread their load balance advisories to all listeners. Listener uses the advisories to decide which instance should service client request. If listener 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 is called as Server Side Load balancing.

No comments:

Post a Comment