Client-side load balancing is defined in your client connection definition (tnsnames.ora
file, for example) by setting the parameter LOAD_BALANCE=ON
. When you set this parameter to ON
, Oracle Database randomly selects an address in the address list, and connects to that node's listener. This balances client connections across the available SCAN listeners in the cluster.
If you configured SCAN for connection requests, then client-side load balancing is not relevant for those clients that support SCAN access. When clients connect using SCAN, Oracle Net automatically balances the load of client connection requests across the three IP addresses you defined for the SCAN, unless you are using EZConnect.
The SCAN listener redirects the connection request to the local listener of the instance that is least loaded (if -clbgoal
is set to SHORT
) and provides the requested service. When the listener receives the connection request, the listener connects the user to an instance that the listener knows provides the requested service. To see what services a listener supports, run the lsnrctl services
command.
When clients connect using SCAN, Oracle Net automatically load balances client connection requests across the three IP addresses you defined for the SCAN, unless you are using EZConnect.
If you are using clients that do not support SCAN (for example, the client version is pre-Oracle Database 11g release 2 (11.2)), then, to use SCAN you must change the client tnsnames.ora
to include the SCAN VIPs, and set LOAD_BALANCE=ON
to balance requests across the VIPs. For example:
Sales.example.com=(DESCRIPTION= (ADDRESS_LIST=(LOAD_BALANCE=ON)(FAILOVER=ON) (ADDRESS=(PROTOCOL=TCP)(HOST=172.22.67.192)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=172.22.67.193)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=172.22.67.194)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=salesservice.example.com)) ))
Note:
If your database is not Oracle Database 11g release 2 (11.2), or later, and you want to use SCAN, then you must add SCAN VIPs to the REMOTE_LISTENER
parameter to enable correct listener cross-registration.
See Also:
Oracle Database Reference for more information about the REMOTE_LISTENER
parameter