rac默认全局服务名客户端负载均衡测试
more tnsnames.ora
ractest =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.82)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.81)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = rac)
)
)
lsnrctl status
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "rac" has 1 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Service "racXDB" has 1 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Service "service1_manual" has 1 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Service "service6_cmdline" has 1 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
The command completed successfully
在另外一个节点上
Service "+ASM" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "rac" has 1 instance(s).
Instance "rac2", status READY, has 1 handler(s) for this service...
Service "racXDB" has 1 instance(s).
Instance "rac2", status READY, has 1 handler(s) for this service...
Service "service_cmdline" has 1 instance(s).
Instance "rac2", status READY, has 1 handler(s) for this service...
The command completed successfully
默认tnsnames.ora中的下面2个值都是开启的。
(load_balance=on)
(failover=on)
客户端连接测试;
sqlplus sys/xxx@ractest as sysdba
经过了多次的测试,发现总是连接的rac1,没有随机到rac2上。