在Linux环境下实现Oracle数据库负载均衡,主要有以下几种方案:
crsctl命令创建集群,配置监听器和服务名,启用负载均衡策略(如CLB_GOAL=SERVICE_TIME)。tnsnames.ora文件中配置多个节点地址,设置LOAD_BALANCE ON实现随机连接分发。RACDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=TCP)(HOST=node1_ip)(PORT=1521))
(ADDRESS = (PROTOCOL=TCP)(HOST=node2_ip)(PORT=1521))
)
(CONNECT_DATA = (SERVICE_NAME=racdb)(SERVER=DEDICATED))
)
listener.ora中配置多个节点地址,启用负载均衡功能。注意事项:
SERVER_PREFERENCE)。参考资料: