不同连接串配置在实际生产中的效果测试
生产环境中经常使用的连接串配置总结有4中,在通过客户端使用这4种连接串连接目标集群,总结出如下效果:
1、同个DESCRIPTION 中,存在双IP配置:该连接串默认连接第一个IP地址,只有在第一个IP地址连接不上的情况下才会连接第二个IP地址。
89orcl19c =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.87)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.88)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))
2、在第一种配置基础上加上(LOAD_BALANCE=ON):该连接串基本可以在两个IP地址间平衡连接。
orcl19c =
(DESCRIPTION =
(LOAD_BALANCE=ON)
(FAILOVER=ON)
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.87)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.88)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))
3、两个DESCRIPTION,每个DESCRIPTION含一个IP地址:该连接串基本可以在两个IP地址间平衡连接。
19c =
(DESCRIPTION_LIST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.87)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl)))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.88)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = orcl))))
4、只有一个DESCRIPTION,IP地址为SCANip:该连接串在发起连接时,会根据集群节点负载情况,选择负载较低的节点IP进行连接。
89 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.89)(PORT = 1521))
(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)))