2015년 9월 30일 수요일

jdbc rac url

jdbc rac 설정

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=tst-db1.myco.com)(PORT=1604))
(ADDRESS=(PROTOCOL=TCP)(HOST=tst-db2.myco.com)(PORT=1604)))
(CONNECT_DATA=SERVICE_NAME=mydb1.myco.com)(SERVER=DEDICATED)))


reference 

http://stackoverflow.com/questions/1646630/jdbc-what-is-the-correct-jdbc-url-to-connect-to-a-rac-database


성공과 실패 사례

jdbc:oracle:thin:@1.2.3.4:1521:SID //일반적인 방법, RAC으로 구성된 경우 위와 같은 에러 발생함.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=1.2.3.4)(PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=1.2.3.5)(PORT=1521))
    (FAILOVER=on)(LOAD_BALANCE=on)
)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ZCGS))) //WebLogic 설정인데 오류가 발생함. failover가 description밖으로 나와야 할거 같다.

jdbc:oracle:thin:@(DESCRIPTION=(FAIL_OVER=ON)(LOAD_BALANCE=ON)(ADDRESS_LIST=
    (ADDRESS = (PROTOCOL = TCP) (HOST = 1.2.3.4) (PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP) (HOST = 1.2.3.5) (PORT = 1521))
)(CONNECT_DATA =(SERVICE_NAME = ZCGS)
    (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRY=180)(DELAY=5)))
//검색해서 가져온 설정, 된다.

jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
    (ADDRESS=(PROTOCOL=TCP)(HOST=1.2.3.4) (PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=1.2.3.5) (PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service))) //이것도 된다고 함. 이게 더 나을거 같다.

jdbc:oracle:thin:@1.2.3.4^1.2.3.5:1521:SID //이건 안됨.


http://www.jugpadova.it/articles/2007/04/11/jdbc-url-for-oracle-rac






댓글 없음:

댓글 쓰기

eclipse rcp dialog resize

  Dialog 안에 메소드를 만든다. private void autoResize(){     getShell().layout( true, true);     final Point newSize = getShell().computeSize...