- For each JDBC data source, create one physical data source pointing to each node in the RAC. For example, for
p13nDataSource, create physical data sources p13nDataSource-1 to p13nDataSource-N, each pointing to one RAC node. Use the WebLogic Server Administration Console to create these data sources.
Alternatively, you could create them by copying and updating the sample jdbc.xml files in the WL_HOME/portal/db/jdbc/oracle_thin directory following the steps below:
1) Copy the dataSourceName-jdbc.xml file to DOMAIN_HOME/config/jdbc directory, and name it dataSourceName-n-jdbc.xml, where n is the sequence number of the n-th RAC node.
2) Edit the file dataSourceName-n-jdbc.xml. Replace @DB_USER@, @DB_USER_PASSWD@, @DB_HOST@, @DB_PORT@ and @DB_NAME@. For @DB_HOST@ and @DB_NAME@, use the hostname and SID of the n-th RAC node.
3) Edit config.xml to add this newly created JDBC data source as a JDBC system resource.
- Create a multi-data source for each of the JDBC data sources, which encompasses the physical data sources created above. For example, create a
p13nDataSource multi-data source which includes p13nDataSource-1 to p13nDataSource-N created above.
If you use the WebLogic Server Administration Console, you would need to first remove the existing data source with the same name, and then create the multi-data source. Also, since the WebLogic Server Administration Console does not provide a way to configure the value of global-transaction-protocol attribute for a multi-data source, you need to manually add the attribute into the corresponding jdbc.xml later.
Alternatively, you could manually edit the corresponding jdbc.xml following the steps below:
1) Open the corresponding jdbc.xml file, delete the jdbc-driver-params element and the jdbc-connection-pool-params element, including all their children elements:
2) Between the jndi-name and the global-transactions-protocol elements, add the following two elements. Determine the value of algorithm-type from Table . The value of data-source-list is a comma-separated list of all the underlying physical data sources.
<algorithm-type>Load-Balancing</algorithm-type>
or
<algorithm-type>Failover</algorithm-type>
<data-source-list>portalDataSourceAlwaysXA-1,
portalDataSourceAlwaysXA-2 </data-source-list>
- An alternative to the manual procedure described above in steps 1 and 2 is WLST scripting. The sample
build.xml, oraracconf.py and oraracconf.py.properties provide an example of how to configure an existing WebLogic Portal domain to point to an Oracle RAC database. These files are listed in Sample WLST Scripts. To use the sample, follow the steps below:
1) Download these files into your DOMAIN_HOME directory.
2) Open the file oraracconf.py.properties. Edit the values in the "Database usernames and passwords" and the "ORACLE RAC configuration" sections to reflect your Oracle RAC environment.
3) Open a command prompt, change current directory to DOMAIN_HOME/bin. Execute the following script:
. ./setDomainEnv.sh (or setDomainEnv.cmd)
4) Execute ant.