最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring jdbc - How Oracle ons works after failover - Stack Overflow

programmeradmin1浏览0评论

I am using ons ojdbc8 and ucp version 19.24 My db setup as below 2 sites using Oracle Data Guard Each site has 2 nodes clustered, and has RAC I have enabled ons notifications in db

And ValidateConnectionOnBorrow is true

poolDataSource.setValidateConnectionOnBorrow(true);

poolDataSource.setSQLForValidateConnection("select 1 from dual");

Below is the connection url. Note that the service names are different

jdbc:oracle:thin:@(DESCRIPTION_LIST=(LOAD_BALANCE=off)(FAILOVER=on)(DESCRIPTION=(ENABLE=BROKEN)(CONNECT_TIMEOUT=2)(RETRY_COUNT=2)(RETRY_DELAY=1)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=urlOfCluster1RAC)(PORT=11521)))(CONNECT_DATA=(SERVICE_NAME=DBSERVICE_NAME))) (DESCRIPTION=(ENABLE=BROKEN)(CONNECT_TIMEOUT=5)(RETRY_COUNT=3)(RETRY_DELAY=1)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=urlOfCluster2RAC)(PORT=11521)))(CONNECT_DATA=(SERVICE_NAME=FAILOVER_DBSERVICE_NAME))(Security=(ENCRYPTION_CLIENT=REQUIRED)(ENCRYPTION_TYPES_CLIENT=AES256)(CHECKSUM_CLIENT=REQUIRED)(CHECKSUM_TYPES_CLIENT=SHA1))))

If both nodes in the first site goes down

Does ons keep a record that urlOfCluster1RAC is unavailable and direcly go to urlOfCluster2RAC? Or each connection it tries urlOfCluster1RAC first?

发布评论

评论列表(0)

  1. 暂无评论