Managing WebLogic Platform Database Resources
This appendix contains the WebLogic Server Scripting Tool (WLST) Offline file that you can use to update a WebLogic Platform domain. For more information about this file and how to download it using a browser, see Updating an Existing XA Domain to Use Oracle RAC. The file is listed in this appendix for the convenience of those who are unable to download it using a browser.
#============================================================================
# Read Domain
#============================================================================
print "opening domain 'platform'"
readDomain('Domain_Path')
setOption('ReplaceDuplicates','false')
cd('Server/cgServer')
cmo.setStdoutDebugEnabled(1)
cmo.setStdoutSeverityLevel(64)
#============================================================================
# Create JDBC Connection Pools and MultiPools
#============================================================================
#Create JDBCConnectionPool-cgPool1
print "creating cgPool1"
create('cgPool1','JDBCConnectionPool')
cd('JDBCConnectionPool/cgPool1')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setInitialCapacity(5)
set('KeepXAConnTillTxComplete','true')
cmo.setMaxCapacity(50)
cmo.setUserName('user_name')
cmo.setPassword('user_password')
set('CountOfTestFailuresTillFlush',1)
set('CountOfRefreshFailuresTillDisable',1)
set('RefreshMinutes',1)
set('ShrinkPeriodMinutes',15)
set('ShrinkingEnabled','true')
set('SupportsLocalTransaction','true')
set('Targets','cgServer')
set('TestConnectionsOnRelease','false')
set('TestConnectionsOnReserve', 'true')
cmo.setURL('jdbc:oracle:thin:@dbhost1:1521:dbname1')
set('XARetryDurationSeconds',300)
set('XASetTransactionTimeout','true')
set('TestConnectionsOnCreate', 'true')
set('XATransactionTimeout',302)
#Create JDBCConnectionPool-cgPool2
print "creating cgPool2"
cd ('/')
create('cgPool2','JDBCConnectionPool')
cd('JDBCConnectionPool/cgPool2')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setInitialCapacity(5)
set('KeepXAConnTillTxComplete','true')
cmo.setMaxCapacity(50)
cmo.setUserName('user_name')
cmo.setPassword('user_password')
set('CountOfTestFailuresTillFlush',1)
set('CountOfRefreshFailuresTillDisable',1)
set('RefreshMinutes',1)
set('ShrinkPeriodMinutes',15)
set('ShrinkingEnabled','true')
set('SupportsLocalTransaction','true')
set('Targets','cgServer')
set('TestConnectionsOnRelease','false')
set('TestConnectionsOnReserve', 'true')
cmo.setURL('jdbc:oracle:thin:@dbhost2:1521:dbname2')
set('XARetryDurationSeconds',300)
set('XASetTransactionTimeout','true')
set('TestConnectionsOnCreate', 'true')
set('XATransactionTimeout',302)
#Create JDBCConnectionPool-portalPool1
print "creating portalPool1"
cd ('/')
create('portalPool1','JDBCConnectionPool')
cd('JDBCConnectionPool/portalPool1')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setInitialCapacity(5)
set('KeepXAConnTillTxComplete','true')
cmo.setMaxCapacity(50)
cmo.setUserName('user_name')
cmo.setPassword('user_password')
set('CountOfTestFailuresTillFlush',1)
set('CountOfRefreshFailuresTillDisable',1)
set('RefreshMinutes',1)
set('ShrinkPeriodMinutes',15)
set('ShrinkingEnabled','true')
set('SupportsLocalTransaction','true')
set('Targets','cgServer')
set('TestConnectionsOnRelease','false')
set('TestConnectionsOnReserve', 'true')
cmo.setURL('jdbc:oracle:thin:@dbhost1:1521:dbname1')
set('XARetryDurationSeconds',300)
set('XASetTransactionTimeout','true')
set('TestConnectionsOnCreate', 'true')
set('XATransactionTimeout',302)
#Create JDBCConnectionPool-portalPool2
print "creating portalPool2"
cd ('/')
create('portalPool2','JDBCConnectionPool')
cd('JDBCConnectionPool/portalPool2')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setInitialCapacity(5)
set('KeepXAConnTillTxComplete','true')
cmo.setMaxCapacity(50)
cmo.setUserName('user_name')
cmo.setPassword('user_password')
set('CountOfTestFailuresTillFlush',1)
set('CountOfRefreshFailuresTillDisable',1)
set('RefreshMinutes',1)
set('ShrinkPeriodMinutes',15)
set('ShrinkingEnabled','true')
set('SupportsLocalTransaction','true')
set('Targets','cgServer')
set('TestConnectionsOnRelease','false')
set('TestConnectionsOnReserve', 'true')
cmo.setURL('jdbc:oracle:thin:@dbhost2:1521:dbname2')
set('XARetryDurationSeconds',300)
set('XASetTransactionTimeout','true')
set('TestConnectionsOnCreate', 'true')
set('XATransactionTimeout',302)
#Create JDBCConnectionPool-bpmArchPool1
print "creating bpmArchPool1"
cd ('/')
create('bpmArchPool1','JDBCConnectionPool')
cd('JDBCConnectionPool/bpmArchPool1')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setInitialCapacity(5)
set('KeepXAConnTillTxComplete','true')
cmo.setMaxCapacity(50)
cmo.setUserName('user_name')
cmo.setPassword('user_password')
set('CountOfTestFailuresTillFlush',1)
set('CountOfRefreshFailuresTillDisable',1)
set('RefreshMinutes',1)
set('ShrinkPeriodMinutes',15)
set('ShrinkingEnabled','true')
set('SupportsLocalTransaction','true')
set('Targets','cgServer')
set('TestConnectionsOnRelease','false')
set('TestConnectionsOnReserve', 'true')
cmo.setURL('jdbc:oracle:thin:@dbhost1:1521:dbname1')
set('XARetryDurationSeconds',300)
set('XASetTransactionTimeout','true')
set('TestConnectionsOnCreate', 'true')
set('XATransactionTimeout',302)
#Create JDBCConnectionPool-bpmArchPool2
print "creating bpmArchPool2"
cd ('/')
create('bpmArchPool2','JDBCConnectionPool')
cd('JDBCConnectionPool/bpmArchPool2')
cmo.setDriverName('oracle.jdbc.xa.client.OracleXADataSource')
cmo.setInitialCapacity(5)
set('KeepXAConnTillTxComplete','true')
cmo.setMaxCapacity(50)
cmo.setUserName('user_name')
cmo.setPassword('user_password')
set('CountOfTestFailuresTillFlush',1)
set('CountOfRefreshFailuresTillDisable',1)
set('RefreshMinutes',1)
set('ShrinkPeriodMinutes',15)
set('ShrinkingEnabled','true')
set('SupportsLocalTransaction','true')
set('Targets','cgServer')
set('TestConnectionsOnRelease','false')
set('TestConnectionsOnReserve', 'true')
cmo.setURL('jdbc:oracle:thin:@dbhost2:1521:dbname2')
set('XARetryDurationSeconds',300)
set('XASetTransactionTimeout','true')
set('TestConnectionsOnCreate', 'true')
set('XATransactionTimeout',302)
#Create JDBCMultiPool-cgMultiPool
print "creating cgMultiPool"
cd ('/')
create('cgMultiPool','JDBCMultiPool')
cd('JDBCMultiPool/cgMultiPool')
set('PoolList','cgPool1,cgPool2')
set('Targets','cgServer')
#The following attribute is valid only for high availability.
set('FailoverRequestIfBusy','true')
set('HealthCheckFrequencySeconds',300)
#===========================================================================
# This MultiPool is configured for High Availability. To configure for
# Load Balancing, comment out the following line and uncomment the line
# after it.
#===========================================================================
set('AlgorithmType','High-Availability')
#set('AlgorithmType','Load-Balancing')
#Create JDBCMultiPool-portalMultiPool
print "creating portalMultiPool"
cd ('/')
create('portalMultiPool','JDBCMultiPool')
cd('JDBCMultiPool/portalMultiPool')
set('PoolList','portalPool1,portalPool2')
set('Targets','cgServer')
#The following attribute is valid only for high availability.
set('FailoverRequestIfBusy','true')
set('HealthCheckFrequencySeconds',300)
#===========================================================================
# This MultiPool is configured for High Availability. To configure for
# Load Balancing, comment out the following line and uncomment the line
# after it.
#===========================================================================
set('AlgorithmType','High-Availability')
#set('AlgorithmType','Load-Balancing')
#Create JDBCMultiPool-bpmArchMultiPool
print "creating bpmArchMultiPool"
cd ('/')
create('bpmArchMultiPool','JDBCMultiPool')
cd('JDBCMultiPool/bpmArchMultiPool')
set('PoolList','bpmArchPool1,bpmArchPool2')
set('Targets','cgServer')
#The following attribute is valid only for high availability.
set('FailoverRequestIfBusy','true')
set('HealthCheckFrequencySeconds',300)
#============================================================================
# Modify Existing Datasources
#============================================================================
print "Modifying existing datasources"
cd('/')
cd('JDBCTxDataSources/portalFrameworkPool')
cmo.setPoolName('portalMultiPool')
set('Targets','cgServer')
cd('/')
cd('JDBCTxDataSources/bpmArchDataSource')
cmo.setPoolName('bpmArchMultiPool')
set('Targets','cgServer')
cd('/')
cd('JDBCTxDataSources/cgDataSource')
cmo.setPoolName('cgMultiPool')
set('Targets','cgServer')
#============================================================================
# Create JDBC connection pools for Connect-Time Failover
#============================================================================
cd ('/')
cd ('JDBCConnectionPool')
nonXApools = 'cgJMSPool-nonXA',
for pool in nonXApools:
print "configuring non-XA pool '" + pool + "'"
cd (pool)
cmo.setDriverName('oracle.jdbc.OracleDriver')
cmo.setUserName('user_name')
cmo.setPassword('user_password')
cmo.setURL('jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=
(PROTOCOL=TCP)(HOST=dbhost1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost2)
(PORT=1521))(FAILOVER=on)(LOAD_BALANCE=off))(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=dbservice)))')
cmo.setTestConnectionsOnReserve(1)
cmo.setCountOfTestFailuresTillFlush(1)
cmo.setTestTableName('dual')
cmo.setInitialCapacity(5)
cmo.setMaxCapacity(5)
cd ('..')
#============================================================================
# Write and Close Domain
#============================================================================
cd ('/')
updateDomain()
closeDomain()
exit()