Skip navigation.

Managing WebLogic Platform Database Resources

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

Using WebLogic Platform with Oracle RAC

This section presents:

 


Overview of Oracle Real Application Clusters

The Oracle Real Application Clusters (RAC) feature is a software option you can add to an Oracle 9i or 10g database to enable multiple database instances to access the same database (storage) simultaneously via cluster technology. The benefits of using Oracle RAC are:

 


Configuring WebLogic Platform to Use Oracle9i or 10g RAC

BEA supports Oracle9i and 10g Real Application Clusters (RAC) for use with WebLogic Platform 8.1 SP5. A WebLogic Platform domain configured with Oracle9i or 10g RAC supports the use of WebLogic JDBC MultiPools and global (XA) transactions with connection pool failover and load balancing.

To use WebLogic Platform with Oracle RAC (9i or 10g), you must meet specific configuration requirements for both systems. The configuration requirements for WebLogic Platform are provided in this section. The configuration requirements for Oracle RAC include clustering software and a shared storage solution. To find out how to set up hardware and software required for an environment that supports Oracle RAC, see "Using WebLogic Server with Oracle RAC" in Programming WebLogic JDBC:

http://download.oracle.com/docs/cd/E13222_01/wls/docs81/jdbc/oracle_rac.html

Configuration Options

The following configuration options are provided:

MultiPools

WebLogic Platform 8.1 SP5 supports the use of JDBC MultiPools with an Oracle RAC database. A MultiPool is a group of connection pools, but to an application, the characteristics of a MultiPool appear identical to those of a single basic connection pool. Each connection pool in a MultiPool is assigned to a different instance of the same database. If an application cannot obtain a connection from a particular connection pool because database connectivity from the pool is down, WebLogic Platform attempts to obtain a connection from the next connection pool in the MultiPool. Optionally, a MultiPool can be configured to provide load balancing, too.

Depending on whether a MultiPool is configured for load balancing or failover, it may have the attributes defined in the following table.

Table 3-1 MultiPool Attributes

Attribute

Description

AlgorithmType=
"High-Availability" or "Load-Balancing"


With the High-Availability option, connection requests are served by the first available pool in the list. When a connection pool becomes defunct, connection requests are served by the next connection pool in the list.

With the Load-Balancing option, connection requests are distributed among available connection pools.

FailoverRequestIfBusy=
"true"

When invoked with the High-Availability algorithm, this attribute enables failover when all connections in a connection pool are in use.

HealthCheckFrequencySeconds="300"

Controls how often WebLogic Platform checks automatically disabled connection pools in a MultiPool to determine whether connections can be recreated and whether a connection pool can be re-enabled. The default value is 300 seconds.


 

To connect WebLogic Platform to multiple Oracle RAC nodes using MultiPools, you must:

  1. Configure a JDBC connection pool with the Oracle Thin driver for each RAC instance in your RAC cluster.
  2. Configure a MultiPool using the algorithm for load balancing or the algorithm for high availability.
  3. Add all your connection pools to the MultiPool.

A detailed version of this procedure is available in Setting Up MultiPools with Global Transactions.

Note: WebLogic Platform does not support the use of MultiPools with JMS JDBC Stores. If your application makes use of JMS JDBC Stores, you must configure your JMS JDBC Store to use Oracle RAC with connect-time failover. See Using Connect-Time Failover.

Connect-Time Failover

If MultiPools cannot be used in your application (for example, when you use a JMS JDBC Store, which does not support the use of MultiPools) and if load balancing is not required, you can configure your connection pools to use connect-time (driver-level) failover. If, under such circumstances, a RAC instance becomes unavailable, you can use the connect-time failover feature of the Oracle Thin driver to handle connection failover. In such a configuration, whenever WebLogic Platform tests a connection and the connection fails, the driver replaces the failed connection with a new one. Then the driver determines which RAC instance to use, based on instance availability.

To connect WebLogic Platform to multiple Oracle RAC nodes using connection pools configured for connect-time failover, configure a JDBC connection pool for each RAC instance in your RAC cluster with the Oracle Thin driver. A detailed version of this procedure is available in Using Connect-Time Failover.

Global Transactions

WebLogic Platform supports global (XA) transactions and the two-phase commit protocol for enterprise applications. A global transaction updates multiple resources, such as databases, in a coordinated manner.

The two-phase commit protocol is a method of coordinating a single transaction across two or more resources. It guarantees data integrity by ensuring that transactional updates are either committed in all of the participating resources, or fully rolled back out of all resources. When updates are rolled back, the state of the relevant resources reverts to the state in which those resources were running before the transaction. In other words, either all the participating resources are updated, or none of them are updated.

In contrast, a local (non-XA) transaction is one that is committed to a single resource.

Setting Up MultiPools with Global Transactions

Note: WebLogic Platform 8.1 SP5 is certified to support Multipools with XA only on Oracle RAC.

This section provides information about the following topics:

Methods of Configuring MultiPools with Global Transactions

WebLogic Platform gives you a choice of several methods for configuring Oracle RAC to use global transactions. Table 3-2 summarizes the methods for which instructions are provided later in this chapter.

Table 3-2 Configuration Procedures

To...

Use...

Create a domain that uses Oracle RAC

One of the following methods:

  • Configure some parameters with the Configuration Wizard, and then manually edit the resulting config.xml file. For more information, see Creating XA Domains that Use Oracle RAC in Creating WebLogic Configurations Using the Configuration Wizard.

Upgrade an existing Platform XA domain for Oracle RAC use

WLST Offline script—If you already have a platform domain set up with XA resources, you can use a WLST Offline script to RAC-enable that domain. For information about configuring an XA domain, see the XA guidelines in Creating XA Domains Using Configuration Templates in Creating WebLogic Configurations Using the Configuration Wizard. For information about updating a domain to use Oracle RAC, see Updating an Existing XA Domain to Use Oracle RAC.


 

In addition, you may configure these components through other tools, such as the Administration Console, the weblogic.Admin command-line utility, or a JMX program. Instructions for these methods are not provided here.

WebLogic JDBC Components that Must Be Configured for Oracle RAC

WebLogic Platform gives you the option of configuring Oracle RAC to use global transactions by defining and configuring the following WebLogic JDBC components:

The following procedure describes the configuration parameters you must define in order to connect WebLogic Platform to multiple Oracle RAC nodes using MultiPools with global transactions:

  1. Define XA connection pools. For each connection pool, specify values for the connection pool name, driver name, DBMS name, DBMS host name, DBMS port, user name, and user password. To make sure the values you specify for dbname1, dbname2, dbhost1, dbhost2, user_name, and user_password are appropriate for your Oracle database setup, ask your database administrator to supply them.
  2. Table 3-3 shows some sample values. Here dbname1 and dbhost1 represent the name of instance 1 of the database and the name of its host machine, respectively. dbname2 and dbhost2 represent the name of instance 2 of the database and the name of its host machine.

    Table 3-3 Sample Values for Connection Pools

    Name

    Driver Name

    DBMS

    Name

    DBMS

    Host

    DBMS

    Port

    User Name

    User Password

    portalPool1

    oracle.jdbc.xa.client.OracleXADataSource

    dbname1

    dbhost1

    1521

    user_name

    user_password

    portalPool2

    oracle.jdbc.xa.client.OracleXADataSource

    dbname2

    dbhost2

    1521

    user_name

    user_password

    cgPool1

    oracle.jdbc.xa.client.OracleXADataSource

    dbname1

    dbhost1

    1521

    user_name

    user_password

    cgPool2

    oracle.jdbc.xa.client.OracleXADataSource

    dbname2

    dbhost2

    1521

    user_name

    user_password

    bpmArchPool1

    oracle.jdbc.xa.client.OracleXADataSource

    dbname1

    dbhost1

    1521

    user_name

    user_password

    bpmArchPool2

    oracle.jdbc.xa.client.OracleXADataSource

    dbname2

    dbhost2

    1521

    user_name

    user_password


     
  3. Assign connection pools to MultiPools, as shown in Table 3-4.
  4. Table 3-4 Assignments of Connection Pools to MultiPools

    Assign these Connection Pools...

    To this MultiPool...

    portalPool1, portalPool2

    portalMultiPool

    cgPool1, cgPool2

    cgMultiPool

    bpmArchPool1, bpmArchPool2

    bpmArchMultiPool


     
  5. Assign JDBC data sources to a MultiPool or a connection pool, as shown in Table 3-5.
  6. Table 3-5 Assignment of Data Sources

    Assign this data source...

    To this MultiPool or Connection Pool...

    portalFrameworkPool

    portalMultiPool

    cgDataSource

    cgMultiPool

    bpmArchDataSource

    bpmArchMultiPool

    p13n_trackingDataSource

    cgJMSPool-nonXA

    p13nDataSource

    cgJMSPool-nonXA

    cgDataSource-nonXA

    cgJMSPool-nonXA


     

Rules for Connection Pools within a MultiPool

The following rules apply to the XA connection pools within a MultiPool:

Required Attributes of Connection Pools within a MultiPool

For each connection pool within a MultiPool, the following attributes must be set:

Sample config.xml Code

The following code provides an example of how two connection pools, a MultiPool, and an associated data source are configured in a config.xml file:

<JDBCConnectionPool 
CapacityIncrement="1"
CountOfRefreshFailuresTillDisable= "1"
CountOfTestFailuresTillFlush="1"
DriverName="oracle.jdbc.xa.client.OracleXADataSource"
InitialCapacity="5"
KeepXAConnTillTxComplete="true"
MaxCapacity="100"
Name="cgPool1"
PasswordEncrypted="{3DES}lBifoTsg8fc="
Properties="user=user_name"
RefreshMinutes="1"
SupportsLocalTransaction="true"
Targets="cgServer"
TestConnectionsOnReserve="true"
TestTableName="dual"
URL="jdbc:oracle:thin:@dbhost1:1521:dbname1"
XARetryDurationSeconds="300"
XASetTransactionTimeout="true"
XATransactionTimeout="302"/>
<JDBCConnectionPool 
CapacityIncrement="1"
CountOfRefreshFailuresTillDisable= "1"
CountOfTestFailuresTillFlush="1"
DriverName="oracle.jdbc.xa.client.OracleXADataSource"
InitialCapacity="5"
KeepXAConnTillTxComplete="true"
MaxCapacity="100"
Name="cgPool2"
PasswordEncrypted="{3DES}lBifoTsg8fc="
Properties="user=user_name"
RefreshMinutes="1"
SupportsLocalTransaction="true"
Targets="cgServer"
TestConnectionsOnReserve="true"
TestTableName="dual"
URL="jdbc:oracle:thin:@dbhost2:1521:dbname2"
XARetryDurationSeconds="300"
XASetTransactionTimeout="true"
XATransactionTimeout="302"/>
<JDBCMultiPool 
Name="cgMultiPool"
PoolList="cgPool1,cgPool2"
#The following attribute is valid only for high availability.
FailoverRequestIfBusy="true"
HealthCheckFrequencySeconds="300"
Targets="cgServer"
AlgorithmType="High-Availability"/>
<JDBCTxDataSource 
JNDIName="cgDataSource"
Name="cgDataSource"
EnableTwoPhaseCommit="true"
PoolName="cgMultiPool"
Targets="cgServer"/>

Note: Line breaks are included only for readability.

Using Connect-Time Failover

If MultiPools cannot be used in your application (for example, when you use a JMS JDBC Store, which does not support the use of MultiPools) and if load balancing is not required, you can configure your connection pools to use connect-time failover.

Note: Connection pools cannot be configured with connect-time load balancing in Release 8.1 SP5.

To connect WebLogic Platform to multiple Oracle RAC nodes using connection pools configured for connect-time failover, set up a JDBC connection pool with the Oracle Thin driver for each RAC instance in your RAC cluster. Then configure each connection pool to use connect-time failover, as described in the sections that follow.

When connections are created in the connection pool, the Oracle Thin driver determines which Oracle RAC instance to use. When an application needs a connection, it looks up a data source on the JNDI tree and requests a connection from the data source. In response, the underlying connection pool delivers one of the available connections from the pool.

The following sections describe a configuration in which Oracle RAC's connect-time failover feature is used to handle connection failures. Keep in mind that in some situations, the connect-time failover feature is slow; the amount of time allowed for failover can be equivalent to the amount of time allowed for a TCP time-out. Depending on your environment, this time period may be as long as several minutes.

Attributes of a Connect-Time Failover Configuration

To use this configuration, create JDBC connection pools in your WebLogic domain with the following attributes:

Sample config.xml Code

<JDBCConnectionPool Name="cgJMSPool-nonXA" 
Targets="cgServer"
DriverName="oracle.jdbc.OracleDriver"
URL="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)))"
InitialCapacity="10"
MaxCapacity="100"
CapacityIncrement="1"
Password="user_password"
Properties="user=user_name"
PreparedStatementCacheSize="15"
ConnLeakProfilingEnabled="true"
TestTableName="dual"
TestConnectionsOnReserve="true"
CountOfTestFailuresTillFlush="1" />
<JDBCDataSource Name="cgDataSource-nonXA" 
Targets="cgServer"
JNDIName="cgDataSource-nonXA"
PoolName="cgJMSPool-nonXA" />

Note: Line breaks are included only for readability.

 


Configuring a WebLogic Platform Domain with WLST Offline

To configure a WebLogic Platform domain that includes Oracle RAC, BEA recommends using the WebLogic Server Scripting Tool (WLST) Offline. (The Configuration Wizard GUI does not completely support the configuration of domains that include Oracle RAC.) WLST Offline is a command-line scripting interface for configuring a domain. It consists of two components:

To access WLST Offline, along with usage instructions and examples, go to:

https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=97

The configuration options available in the WLST script are shown in Table 3-6.

Table 3-6 WLST Script Configuration Options

Configuration

Connection Pools

Drivers

MultiPools

Data Sources

MultiPools with XA

portalPool1, portalPool2

oracle.jdbc.xa.client.OracleXADataSource

portalMultiPool

portalFrameworkPool

cgPool1, cgPool2

oracle.jdbc.xa.client.OracleXADataSource

cgMultiPool

cgDataSource

bpmArchPool1, bpmArchPool2

oracle.jdbc.xa.client.OracleXADataSource

bpmArchMultiPool

bpmArchDataSource

Connect-
Time Failover

cgJMSPool-
nonXA

oracle.jdbc.OracleDriver

Not applicable

p13n_trackingDataSource

p13nDataSource

cgDataSource-
nonXA


 

To configure your WebLogic Platform domain by using WLST Offline, complete the following procedure:

  1. In a supported browser, display the WLST Offline script template rac10g_sample_script.py. This script is available at http://download.oracle.com/docs/cd/E13196_01/platform/docs81/db_mgmt/scripts/rac10g_sample_script.py.
  2. In the popup window that is displayed, choose File—> Save As...
  3. Save the contents of the script in a text file.
  4. Note: This script is also available in Appendix A, WebLogic Server Scripting Tool (WLST) Offline File

  5. In your text file, make the changes listed in the following table.
  6. Replace . . .

    With the . . .

    Notes

    All occurrences of BEA_HOME

    Pathname of the directory in which the product is installed

    For example: bea/home

    Value for cmo.setUserName (which is defined in the sample script as user_name)

    Appropriate name for your database account

    Ask your database administrator to provide the name.

    Value for cmo.setPassword (which is defined in the sample script as user_password)

    Appropriate password for your database account

    Ask your database administrator to provide the password.

    All occurrences of the names of RAC database instances specified in the sample script (see HOST=dbname1 and HOST=dbname2)

    Names of the RAC database instances configured in your domain

    Ask your database administrator to provide the RAC configuration settings that are appropriate for your environment.

    All occurrences of the names of RAC instances specified in the sample script (see HOST=dbhost1 and HOST=dbhost2)

    Names of the RAC instances configured in your domain

    Value of the SERVICE_NAME parameter (which is defined in the sample script as SERVICE_NAME=dbservice)

    Name of the database service configured in your environment

    All occurrences of the port numbers

    Port numbers configured in your domain

    Values of

    • setListenAddress

    • setListenPort

    which are defined in the sample script as follows:

    cmo.setListenAddress('10.61.6.134')
    cmo.setListenPort(9101)
    cmo.setListenPort(9102)

    The listener address and port numbers for the administration server


     

    You have now finished making all required changes to the script.

  7. Review all the parameter settings in your completed script and change any settings for which you do not want to use the default values. For example, you may want to use your own password instead of the default password, weblogic.
  8. Run the completed script, following the instructions for WLST Offline at BEA's dev2dev codes samples site:
  9. https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=97

 


Configuring Your Component-Specific Domain to Use Oracle RAC

You can also use the WLST Offline script described in the previous section to create a domain for a component of WebLogic Platform, such as WebLogic Portal, as long as you:

 


Updating an Existing XA Domain to Use Oracle RAC

This procedure is designed to help you upgrade an existing basic (that is, non-Oracle RAC) XA Platform domain created with the Configuration Wizard. To upgrade an existing domain so it can accommodate Oracle RAC, BEA recommends that you run a script created with a tool called WebLogic Server Scripting Tool (WLST) Offline.

Note: The Configuration Wizard GUI cannot be used for this type of upgrade because it does not completely support the configuration of domains that include Oracle RAC.

WLST Offline is a command-line scripting interface for configuring a domain. It consists of two components:

To access WLST Offline, along with usage instructions and examples, go to:

https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=97

The configuration options available in the WLST script are shown in Table 3-7.

Table 3-7 WLST Script Configuration Options

Configuration

Connection Pools

Drivers

MultiPools

Data Sources

MultiPools with XA

portalPool1, portalPool2

oracle.jdbc.xa.client.OracleXADataSource

portalMultiPool

portalFrameworkPool

cgPool1, cgPool2

oracle.jdbc.xa.client.OracleXADataSource

cgMultiPool

cgDataSource

bpmArchPool1, bpmArchPool2

oracle.jdbc.xa.client.OracleXADataSource

bpmArchMultiPool

bpmArchDataSource

Connect-
Time Failover

cgJMSPool-
nonXA

oracle.jdbc.OracleDriver

Not applicable

p13n_trackingDataSource

p13nDataSource

cgDataSource-
nonXA


 

To configure your WebLogic Platform domain by using WLST Offline, complete the following procedure:

  1. In a supported browser, display the WLST Offline script template update_rac10g_sample_script.py. This script is available at http://download.oracle.com/docs/cd/E13196_01/platform/docs81/db_mgmt/scripts/update_rac10g_sample_script.py.
  2. In the popup window that is displayed, choose File—> Save As...
  3. Save the contents of the script in a text file.
  4. Note: This script is also available in WebLogic Server Scripting Tool (WLST) Offline Update File.

  5. In your text file, make the changes listed in the following table.
  6. Replace . . .

    With the . . .

    Notes

    All occurrences of Domain_Path

    Pathname of the domain directory

    For example:

    C:/bea/home/user_projects/domains/platform

    Value for cmo.setUserName (which is defined in the sample script as user_name)

    Appropriate name for your database account

    Ask your database administrator to provide the name.

    Value for cmo.setPassword (which is defined in the sample script as user_password)

    Appropriate password for your database account

    Ask your database administrator to provide the password.

    All occurrences of the names of RAC database instances specified in the sample script (see HOST=dbname1 and HOST=dbname2)

    Names of the RAC database instances configured in your domain

    Ask your database administrator to provide the RAC configuration settings that are appropriate for your environment.

    All occurrences of the names of RAC instances specified in the sample script (see HOST=dbhost1 and HOST=dbhost2)

    Names of the RAC instances configured in your domain

    Value of the SERVICE_NAME parameter (which is defined in the sample script as SERVICE_NAME=dbservice)

    Name of the database service configured in your environment

    All occurrences of the port numbers

    Port numbers configured in your domain


     

    You have now finished making all required changes to the script.

  7. Run the completed script, following the instructions for WLST Offline at BEA's dev2dev code samples site:
  8. https://codesamples.projects.dev2dev.bea.com/servlets/Scarab?id=97

 


Limitations on Using Oracle RAC with Your WebLogic Domain

For information about known limitations on the use of Oracle RAC with WebLogic Platform, see "Using WebLogic Server with Oracle RAC" in Programming WebLogic JDBC:

http://download.oracle.com/docs/cd/E13222_01/wls/docs81/jdbc/oracle_rac.html

 

Skip navigation bar  Back to Top Previous Next