天天看点

rac客户端负载均衡测试

rac默认全局服务名客户端负载均衡测试

more tnsnames.ora 

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