블로그 이미지
윤영식
Frontend Application Architecter, Full Stacker, KnowHow Dispenser and Bike Rider

Publication

Statistics Graph

Recent Comment

'DB Connection FailOver'에 해당되는 글 1

  1. 2013.06.05 [WAS] Oracle DB Pool Connection Clustering
2013.06.05 14:06 Middleware, Cloud/WAS

JBoss 나 WebLogic에서 Oracle을 연결할 때 Oracle이 RAC(Oracle Real Application Clustering)으로 구성이 되어 있다면 이에 맞는 DB Pool 설정을 해야한다 



1. Oracle Clustering Config

  - 환경설정

<connection-url>

jdbc:oracle:thin:@(description=(address_list=(load_balance=on)(failover=on)(address=(protocol=tcp)(host=host1)(port=1521))(address=(protocol=tcp)(host=host2)(port=1521)))(connect_data=(service_name=xxxxsid)(failover_mode=(type=select)(method=basic))))

</connection-url>



2. JBoss Config

  - 환경파일 : <domainName>/deploy/oracle-ds.xml 

 <datasources>

   <local-tx-datasource>

  <jndi-name>cmstDs</jndi-name> 

  <connection-url>

jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST = (LOAD_BALANCE = off)(FAILOVER = on)(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 128.0.0.1)(PORT = 1521)))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = PGTMO)(FAILOVER_MODE =    (TYPE = SELECT)(METHOD = BASIC))))

</connection-url> 

  <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> 

  <user-name>yun</user-name> 

  <password>dowon</password>


  <min-pool-size>30</min-pool-size>

  <max-pool-size>50</max-pool-size>


  <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

  <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>


   <query-timeout>300</query-timeout>

   <background-validation-minutes>5</background-validation-minutes>

   <blocking-timeout-millis>10000</blocking-timeout-millis>


  </local-tx-datasource>

 </datasources>



3. Weblogic Config

  - 환경파일 : <domainName>/config/jdbc/xxxx-jdbc.xml

<?xml version='1.0' encoding='UTF-8'?>

<jdbc-data-source xmlns="http://xmlns.oracle.com/weblogic/jdbc-data-source" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/jdbc-data-source http://xmlns.oracle.com/weblogic/jdbc-data-source/1.2/jdbc-data-source.xsd">

  <name>youngsik-test</name>

  <jdbc-driver-params>

    <url>

jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=OFF)(FAILOVER=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=128.0.0.1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=PGTMO)))

    </url>

    <driver-name>oracle.jdbc.OracleDriver</driver-name>

    <properties>

      <property>

        <name>SendStreamAsBlob</name>

        <value>true</value>

      </property>

      <property>

        <name>user</name>

        <value>MOBICON</value>

      </property>

      <property>

        <name>oracle.net.CONNECT_TIMEOUT</name>

        <value>10000</value>

      </property>

    </properties>

    <password-encrypted>dowon-manse</password-encrypted>

  </jdbc-driver-params>

  <jdbc-connection-pool-params>

    <initial-capacity>1</initial-capacity>

    <connection-creation-retry-frequency-seconds>10</connection-creation-retry-frequency-seconds>

    <test-frequency-seconds>120</test-frequency-seconds>

    <test-connections-on-reserve>true</test-connections-on-reserve>

    <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>

    <seconds-to-trust-an-idle-pool-connection>0</seconds-to-trust-an-idle-pool-connection>

  </jdbc-connection-pool-params>

  <jdbc-data-source-params>

    <jndi-name>jdbc/oracle/yun</jndi-name>

    <global-transactions-protocol>None</global-transactions-protocol>

  </jdbc-data-source-params>

</jdbc-data-source>



<참조>

  - Weblogic DB Configuration 이해하기

  - Oracle Cluster config

  - JBoss Deploy 및 ClassLoader구조와 Hibernate 사용하기 

  - JBoss 5 환경설정 및 튜닝 (필독)

저작자 표시 비영리 변경 금지
신고
posted by peter yun 윤영식
prev 1 next