기본 콘텐츠로 건너뛰기

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






댓글

이 블로그의 인기 게시물

윈도우 톰캣 네트워크 드라이버 잡기

윈도우 톰캣 네트워크 드라이버 설정(windows tomcat network driver setting) TOMCAT_HOME/conf/server.xml 의 Host 노드 아래 경로 추가     <Context path="/resources" docBase="//192.168.200.100/cifs/pds" /> 서버스 재구동 하면 다음 메시지 뜸 SEVERE [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing docBase for context [/resources] java.io.IOException: 사용자 이름 또는 암호가 올바르지 않습니다 at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428) at java.io.File.getCanonicalPath(File.java:618) at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:593) at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:744) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)...

Jsp 서버 아이피 확인

한줄버전 <% String svrIP =  InetAddress.getLocalHost() .getHostAddress(); %> <%@ page language="java" import="java.net.InetAddress" %> InetAddress inet = InetAddress.getLocalHost(); String svrIP = inet.getHostAddress(); Reference http://yoontaesub.egloos.com/m/1925800

윈도우 톰캣 버전확인

cmd 창을 연 후 cd C:\Program Files\Apache Software Foundation\Tomcat 8.0\bin version.bat 실행 ======================================================== Using CATALINA_BASE:   "C:\Program Files\Apache Software Foundation\Tomcat 8.0" Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Tomcat 8.0" Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.0\temp" Using JRE_HOME:        "C:\Program Files\Java\jdk1.8.0_91" Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Tomcat 8.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.0\bin\tomcat-juli.jar" Server version: Apache Tomcat/8.0.33 Server built:   Mar 18 2016 20:31:49 UTC Server number:  8.0.33.0 OS Name:        Windows Server 2012 R2 OS Version:     6.3 Architecture:   amd64 JVM Version:    1.8.0_91-b14 JVM Vendor:     Oracle Corporation ...