与负载均衡配置之前的监听配置请参考
一、客户端的负载均衡
客户端的负载均衡主要是通过为tnsnames.ora增加load_balance=yes条目来实现,下面看看oracle(Note:226880.1)的解释
The client load balancing feature enables clients to randomize connection requests among the listeners. Oracle Net progresses through the list of
protocol addresses in a random sequence, balancing the load on the various listeners. Without client load balancing, Oracle Net progresses through the
list of protocol addresses sequentially until one succeeds. This normally is referred to connect-time load balance.
从上面的描述中可以得知,如果未开启load_balance=yes时,Oracle Net会根据地址列表按顺序来选择一个进行连接,直到连接成功为止。
如果第一个host主机连接失败,在有多个地址的情形下,接下来选择第二个地址连接,依此类推,直到连接成功为止。
当开启了load_balance=yes时,则Oracle Net会从多个地址中随机地选择一个地址进行连接,直到连接成功为止。
注意,此连接方式仅根据地址列表随机选择,并不考虑到各个实例上当前真正连接数量的多少,也即是没有考虑各个节点真实的连接负载情况。
二、服务器与客户端的配置情况
1、服务器端监听器配置