The client load balancing feature enables clients to randomize connection requests among the listeners.
Tnsnames Parameter: LOAD_BALANCE
load_balance的值可以设置为：on | off | yes | no | true | false
load_balance=yes|on|true 设置为客户端随机在所提供的listener address中根据Load选择最适合的listener。
load_balance=no|off|false 设置为客户端在所提供的listener address中按次序选择listener，一直到选择到可以连接的Listener。
The (load_balance=yes) instructs SQLNet to progress through the list of listener addresses in a random sequence, balancing the load on the various listeners. When set to OFF, instructs SQLNet to try the addresses sequentially until one succeeds.
Load balancing can be specified for an ADDRESS_LIST or associated with a set of ADDRESSes or set DESCRIPTIONs.
This parameter must be correctly coded in your net service name (connect descriptor).
By default, this parameter is set to ON for DESCRIPTION_LISTs.
This can even be achieved with a single net service name provided you configure
a) Multiple listener addresses within a description
b) Multiple descriptions within a description list
The difference between the two is that while the former will use the same connect data for all the listener addresses, that latter may have separate connect data for each configured listener address. Below, I provide an example of both types of configuration:
Multiple Listener addresses within a description:
If you use ADDRESS_LIST, (load_balance=yes) should be within the (ADDRESS_LIST=) portion. If you do not use ADDRESS_LIST, (load_balance=yes) should be within the (description=) portion.
(2) Client Side Connect-Time failover(客户端连接时故障切换配置)
Tnsnames Parameter: FAILOVER
(failover=on) is default for ADDRESS_LISTs, DESCRIPTION_LISTs, and a set of
DESCRIPTIONs., therefore, you do not have to specify it explicitly.
(3) Server Side Listener Connection Load Balance（服务端监听连接负载均衡）
The listener connection load balancing feature improves connection performance by balancing the number of active connections among multiple dispatchers and instances. In a single-instance environment, the listener selects the least loaded dispatcher to handle the incoming client requests. In an Oracle Real Application Clusters (RAC) environment, connection load balancing also has the capability to balance the number of active connections among multiple instances.
1. Least-loaded node
2. Least-loaded instance
3. Least-loaded dispatcher for that instance (in case of Shared server configuration)
There are two types of server-side load balancing:
Load Based â€” Server side load balancing redirects connections by default depending on node load. From 10.2 onwards you can work this with Load balancing advisory (LBA). This will not be effective for login storms as the connections are already in the listener after which PMON update on the load comes to the listener.
Session Based â€” Session based load balancing takes into account the number of sessions connected to each node and then distributes the connections to balance the number of sessions across the different nodes.
Session count balancing is used when you set a listener parameter, PREFER_LEAST_LOADED_NODE_<listener_name>=OFF (<listener_name> is the actual name of the listener which is different on each node in your cluster and by default is constructed as "listener_<nodename>"). Please be aware that connections bursts (large number of connections initiated very quickly one after another) may not be properly balanced due to statistics update latency.