当前位置:   article > 正文

配置连接池连接Oarcle RAC集群_rac切换连接池连接怎么处理 csdn

rac切换连接池连接怎么处理 csdn


转自:http://blog.163.com/wenming_126@126/blog/static/19654138200722675655592/


只需在url处改为
jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = hostIp1)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = hostIp2)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = hostIp3)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = serviceName)))
即可

URL="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.48.105)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.48.105)(PORT=1522))(FAILOVER=yes)(LOAD_BALANCE=no)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=RACDB)))"

Sample config.xml Code

An example of the connection pools, a WebLogic JDBC MultiPool, and an associated data source in the

config.xml

file would be:

<JDBCConnectionPool

CapacityIncrement="1"

ConnLeakProfilingEnabled="true"

CountOfTestFailuresTillFlush="1"

DriverName="oracle.jdbc.xa.client.OracleXADataSource"

InitialCapacity="5"

KeepXAConnTillTxComplete="true"

MaxCapacity="100"

Name="jdbcXAPool1"

PasswordEncrypted="{3DES}lBifoTsg8fc="

Properties="user=wlsqa"

RefreshMinutes="1" SupportsLocalTransaction="true"

Targets="WLSCluster"

TestConnectionsOnReserve="true"

TestTableName="dual"

URL="jdbc:oracle:thin:@db_server1:1521:SNRAC1"

XAEndOnlyOnce="true"

XARetryDurationSeconds="300"

XASetTransactionTimeout="true"/>

XATransactionTimeout="302"/>

<JDBCConnectionPool

CapacityIncrement="1"

ConnLeakProfilingEnabled="true"

CountOfTestFailuresTillFlush="1"

DriverName="oracle.jdbc.xa.client.OracleXADataSource"

InitialCapacity="5"

KeepXAConnTillTxComplete="true"

MaxCapacity="100"

Name="jdbcXAPool2"

PasswordEncrypted="{3DES}lBifoTsg8fc="

Properties="user=wlsqa"

RefreshMinutes="1"

SupportsLocalTransaction="true"

Targets="WLSCluster"

TestConnectionsOnReserve="true"

TestTableName="dual"

URL="jdbc:oracle:thin:@db_server2:1521:SNRAC2"

XAEndOnlyOnce="true"

XARetryDurationSeconds="300"

XASetTransactionTimeout="true"/>

XATransactionTimeout="302"/>

<JDBCMultiPool

Name="jdbcXAMultiPool1"

PoolList="jdbcXAPool1,jdbcXAPool2"

Targets="WLSCluster"

AlgorithmType="Load-Balancing"/>

<JDBCTxDataSource

JNDIName="jdbcXADataSource1"

Name="jdbcXADataSource1"

PoolName="jdbcXAMultiPool1"

Targets="WLSCluster"/>


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/1006118
推荐阅读
相关标签
  

闽ICP备14008679号