9 Configuring JDBC Active GridLink Data Sources

This chapter describes how to configure the Oracle Communications MetaSolv Solution (MSS) JDBC Active GridLink (AGL) data sources to work in an Oracle Real Application Cluster (RAC) environment for MSS.

About Oracle RAC

Oracle RAC consists of two or more Oracle database instances that run on two or more clustered machines and access a shared storage device using cluster technology. The host machines for the database instances must be linked by a high-speed interconnection to form the cluster and enable communications among the nodes in the cluster.

Note:

For more information on configuring Oracle RAC, your clustering software, your operating system, and storage solution, see the documentation from the respective vendors.

For information using Oracle RAC with Oracle WebLogic servers, refer to the Oracle Fusion Middleware Administering JDBC Data Sources for Oracle Weblogic Server documentation.

Creating the JDBC Active GridLink Data Sources

A single Active GridLink (AGL) data source provides connectivity between WebLogic Server and an Oracle Database service, which may include one or more Oracle RAC clusters. An Oracle Database service represents a workload with common attributes that enables administrators to manage the workload as a single entity. You scale the number of AGL data sources as the number of services increases in the database, independent of the number of nodes in the Oracle RAC clusters.

Note:

MSS supports only the failover algorithm (with remote listener enabled).

You can create JDBC Active GridLink data sources by doing one of the following:

JDBC Data Source Properties

JDBC data source properties include options on the data source identify and the handling of data for the database connection. Before creating data sources, you need to be familiar with this topic. For detailed information on JDBC data sources and their properties, see Fusion Middleware Administering JDBC Data Sources for Oracle WebLogic Server on the Oracle Help Center website at:

http://docs.oracle.com/en/middleware/middleware.html

Manually Creating the JDBC Active GridLink Data Sources

You must create the JDBC Active GridLink data sources manually. By default, the MSS installer creates the multi data sources when the Oracle RAC database is selected. A multi data source provides an ordered list of data sources to use to satisfy connection requests.

To create the JDBC Active GridLink data sources, perform the following tasks in the WebLogic Administration Console:

  • Deleting the existing multi data sources. See "Deleting Multi Data Sources" for more information.

  • Creating the following JDBC Active GridLink data sources:

    • mslvDataSource

    • mslvDbTraceDataSource

    • mslvNoneTxDataSource

    • mslvProcDataSource

    • mslvPSDataSource

    • mslvWSDataSource

    See "Creating Active GridLink Data Sources" for more information.

  • Creating the following persistent stores:

    • mssJMSStore (and point it to mslvPSDatasource)

    • pluginstore (and point it to mslvPSDatasource)

    See "Creating Persistent Stores" for more information.

  • Creating the following JMS servers:

    • mmsJMSServer (and point it to mssJMSStore)

    • pluginJMSServer (and point it to pluginstore)

    See "Creating JMS Servers" for more information.

  • Creating the following JMS modules:

    • mssJMSModule

    • pluginModule

      After you create mssJMSModule and pluginModule, you must create JMS module resources (such as queues and connection factories) and create the subdeployments for those resources. A subdeployment is a process for grouping JMS module resources and targeting them to a server instance or cluster.

    See "Creating JMS Modules" for more information.

Deleting Multi Data Sources

To remove a multi data source, perform the following:

  1. Log in to the WebLogic Server Administration Console.

  2. In the Domain Structure tree, expand Services, and then click Data Sources.

    The Summary of JDBC Data Sources page appears.

  3. Click the Configuration tab.

  4. Select the check box beside each data source that you want to delete and click Delete.

Creating Active GridLink Data Sources

To create an Active GridLink data source:

  1. Log in to the WebLogic Server Administration Console.

  2. In the Domain Structure tree, expand Services, and then click Data Sources.

    The Summary of JDBC Data Sources page appears.

  3. Click New and select GridLink Data Source.

    The JDBC GridLink Data Source Properties page appears.

  4. In the Name field, enter mslvDataSource.

  5. In the JNDI name field, enter the JNDI path to where this data source is bound. By default, the JNDI name is the name of the data source. For example, MSLVPool.

  6. From the Database Driver list, select any one of the following database drivers, depending on the Active GridLink data source that you are creating:

    • When creating mslvDataSource and mslvWSDataSource, select Oracle's Driver (Thin XA) for GridLink Connections Versions:Any.

    • When creating mslvDbTraceDataSource, mslvNoneTxDataSource, mslvProcDataSource, and mslvPSDataSource, select Oracle's Driver (Thin) for GridLink Connections; Versions:Any.

  7. Click Next.

    The Transaction Options page appears.

    For XA drivers, the system automatically selects the Two-Phase Commit protocol for global transaction processing.

    The Supports Global Transactions check box is selected by default.

  8. (For non-XA drivers) If you selected the Supports Global Transactions check box, you must also select any one of the following transaction protocols for this data source:

    • Logging Last Resource

    • Emulate Two-Phase Commit

    • One-Phase Commit

  9. Click Next.

    The GridLink data source connection Properties Options page appears.

  10. Do one of the following:

    • Select Enter individual listener information and click Next.

      The Connection Properties page appears.

      1. In the Service Name field, enter the name of the service.

      2. In the Host and Port field, enter the host and port; separate the host and the port of each listener with a colon.

      3. In the Database User Name field, enter the database user name.

        Table 9-1 lists the GridLink data sources, including the JNDI name, driver class name, and user name that you must specify to create each data source.

        Table 9-1 GridLink Data Sources

        GridLink Data Source JNDI Name Driver Class Name User Name

        mslvDataSource

        MSLVPool

        oracle.jdbc.xa.client.OracleXADataSource

        APP_MSLV

        mslvDbTraceDataSource

        MSLVDbTracePool

        oracle.jdbc.OracleDriver

        APP_MSLV

        mslvNoneTxDataSource

        MSLVNoneTxPool

        oracle.jdbc.OracleDriver

        APP_MSLV

        mslvProcDataSource

        MSLVProcPool

        oracle.jdbc.OracleDriver

        APP_API

        mslvPSDataSource

        MSLVpsPool

        oracle.jdbc.OracleDriver

        APP_MSLV

        mslvWSDataSource

        MSLVwsPool

        oracle.jdbc.xa.client.OracleXADataSource

        APP_INT

      4. In the Password field, enter the password.

      5. In the Confirm Password field, enter the password again to confirm it.

      6. In the Protocol field, enter the protocol. For example, TCP.

      7. In the oracle.jdbc.DRCPConnectionClass field, enter the DRCP connection class.

      8. Click Next.

    • Select Enter complete JDBC URL and click Next.

      1. In the Complete JDBC URL field, enter the JDBC URL.

      2. In the Database User Name field, enter the database user name.

      3. In the Password field, enter the password.

      4. In the Confirm Password field, enter the password again to confirm it.

      5. In the Protocol field, enter the protocol.

      6. In the oracle.jdbc.DRCPConnectionClass field, enter the DRCP connection class.

      7. Click Next.

    The Test GridLink Database Connection page appears, which enables you to test a database connection before the data source configuration is finalized using a table name or SQL statement. If required, you can test additional configuration information using the Properties and System Properties attributes.

  11. Click Next.

    The ONS Client Configuration page appears.

  12. Select the Fan Enabled check box to subscribe to Oracle Fan Events.

  13. In the ONS host and port field, enter the host and port for each ONS node separated by a comma.

  14. If ONS is configured to use the SSL protocol, do the following:

    1. In the ONS Wallet File Directory field, enter the directory of the Oracle wallet file in which the SSL certificates are stored.

    2. In the ONS Wallet Password field, enter and confirm the ONS wallet password.

    3. In the Confirm ONS Wallet Password field, enter the ONS wallet password again to confirm it.

  15. Click Next.

    The Select Targets page appears.

  16. Select the servers or clusters on which you want to deploy the data source and click Next.

  17. Click Finish.

  18. Repeat this procedure to create the remaining Active GridLink data sources: mslvDbTraceDataSource, mslvNoneTxDataSource, mslvProcDataSource, mslvPSDataSource, and mslvWSDataSource.

  19. Proceed with "Tuning the Active GridLink Data Source".

Tuning the Active GridLink Data Source

After you create the Active GridLink data sources, you must tune each data source.

To tune each data source:

  1. Log in to the WebLogic administration console.

  2. In the Domain Structure tree, expand Services, and then click Data Sources.

    The Summary of JDBC Data Sources page is displayed.

  3. Select the target data source (for example, mslvDataSource1).

    The Settings for <DataSource> page is displayed.

  4. Click the Connection Pool tab.

    The Connection Properties are displayed.

  5. Click Advanced to display additional configuration items.

  6. In the Test Table Name field, clear the SQL SELECT 1 FROM DUAL entry and enter SQL ISVALID.

  7. In the Inactive Connection Timeout field, enter 300.

  8. Click Save.

  9. Click Activate Changes.

  10. Repeat steps 3 through 9 to tune each data source.

Creating Persistent Stores

To create a persistent store

  1. Log in to the WebLogic Server Administration Console.

  2. In the Domain Structure tree, expand Services, and then click Persistent Stores.

    The Summary of Persistent Stores page appears.

  3. Click New and select Create JDBCStore.

    The Create a New JDBC Store page appears.

  4. Do the following:

    1. In the Name field, enter mssJMSStore.

    2. From the Target list, select a server instance on which you want to deploy the JDBC store.

    3. From the Data Source list, select mslvPSDataSource.

    4. In the Prefix Name field, specify a prefix that is added to the table name in this JDBC store.

    5. Click Finish.

    6. Repeat this procedure to create the pluginstore persistent store and point it to mslvPSDatasource.

Creating JMS Servers

To create a JMS server

  1. Log in to the WebLogic Server Administration Console.

  2. In the Domain Structure tree, expand Services, then expand Messaging, and then click JMS Servers.

    The Summary of JMS Servers page appears.

  3. Click New.

    The Create a New JMS Server Properties page appears.

  4. Do the following:

    1. In the Name field, enter mssJMSServer.

    2. From the Persistent Store list, select mssJMSStore.

    3. Click Finish.

    4. Repeat this procedure to create the pluginJMSServer JMS server and point it to pluginstore.

Creating JMS Modules

To create a JMS module:

  1. Log in to the WebLogic Server Administration Console.

  2. In the Domain Structure tree, expand Services, then expand Messaging, and then click JMS Modules.

    The Summary of JMS Modules page appears.

  3. Click New.

    The Create JMS System Module page appears.

  4. Do the following:

    1. In the Name field, enter mssJMSModule.

    2. (Optional) In the Descriptor File Name field, enter a name for module's underlying descriptor file.

    3. (Optional) In the Location in the Domain field, enter where you want to place the descriptor for the system module.

  5. Click Next.

    The Targets page appears.

  6. Select the server instance or cluster target on which you want to deploy the JMS module, and then click Next.

    The Add resources to this JMS system module page appears.

  7. Do one of the following:

    • Click Finish.

      The mssJMSModule JMS module is created. You can create the resources for the newly created JMS module later.

    • Select the Would you like to add resources to this JMS system module? and click Finish.

      The mssJMSModule is created and you can now continue adding resources to the newly created JMS module.

      The Setting for mssJMSModule page appears.

  8. On the Configuration tab, click New.

    The Create a New JMS System Module Resource page appears.

  9. Select the type of resource (such as Connection Factory, Queue, Topic, and so on) you want to create and click Next.

  10. Enter the required information for the selected resource, from the Subdeployments list, select (none), and click Finish.

    Note:

    When creating a JMS module resource, do not specify a subdeployment; instead, after creating the JMS resource, edit the resource and then specify a subdeployment for that resource. See "Configuring Subdeployments for JMS Module Resources" for more information.

  11. In the Change Center of the Administration Console, click Activate Changes, which activates these changes.

  12. Repeat this procedure to create the pluginModule JMS module.

Configuring Subdeployments for JMS Module Resources

After the you create the resources for the JMS module, edit the resource, and then specify a subdeployment for that resource.

To configure a subdeployment for a JMS module resource:

  1. Log in to the WebLogic Server Administration Console.

  2. In the Domain Structure tree, expand Services, then expand Messaging, and then click JMS Modules.

    The Summary of JMS Modules page appears.

  3. Click mssJMS module.

    The Settings for mssJMSModule page appears.

  4. On the Configuration tab, under Summary of Resources, click a resource.

    The Settings for resource page is displayed.

  5. Click the Subdeployment tab.

  6. From the Subdeployment list, select a subdeployment.

  7. Click Save.

  8. Repeat this procedure to configure subdeployments for the resources of pluginModule.

Creating JDBC Active Data Sources by Updating the Configuration Files

Creating the JDBC Active GridLink data sources by updating configuration files involves doing the following tasks in the WebLogic Administration Console:

Note:

Before converting Multi Data Sources to Active GridLink Data Sources, you must do the following:

  1. Take a backup of all Multi Data Sources

  2. Take a backup of the config.xml file that is located in the m63domain\config directory, where m63domain is the name of the domain directory you specified during domain configuration.

Encrypting Clear Text Passwords in WebLogic Server Domain Configuration Files

Each Active GridLink data source is represented by a configuration XML file for the RAC domain in the m63domain\config\jdbc directory. For example, mslvWSDataSource-8065-jdbc.xml, mslvProcDataSource-9573-jdbc.xml, and so on.

where:

m63domain is the name of the domain directory you specified during domain configuration.

You must encrypt the clear text passwords in each domain configuration XML file for all the data sources to protect them files from unauthorized access. You encrypt passwords using the java weblogic.security. Encrypt utility, which you must run from within the m63domain folder.

Ensure that you encrypt passwords for the following database users: APP_MSLV, APP_API, and APP_INT.

To encrypt clear text passwords in WebLogic server domain configuration files:

  1. Change directory to your domain's bin folder.

    For example:

    cd MW_HOME\user_projects\domains\m63domain\bin
    
  2. Run the setDomainEnv script. For example, setDomainEnv.cmd (Windows) or setDomainEnv.sh (UNIX/Linux).

  3. Navigate to the m63domain directory and run the java weblogic.security.Encrypt utility. This utility prompts you for a password, and then displays the encrypted password.

    The following is a sample output from running this utility:

    C:\MW_HOME\user_projects\domains\m63domain>java weblogic.security.Encrypt
    Password:
    {3DES}9HWsf87pJTw=
    
  4. Navigate to the in the m63domain\config\jdbc directory.

  5. Copy the encrypted passwords for all the data sources and paste these passwords in the <password> element within the XML file for each data source (mslvWSDataSource, mslvProcDataSource, mslvPSDataSource, mslvNoneTxDataSource, mslvDbTraceDataSource, and mslvDataSource).

Note:

You can generate a new password or you can copy the password from the Multi Data Source backup.

Deleting Multi Data Source Instances from the config.xml File

To delete the multi data sources instances from the config.xml file:

  1. Edit the m63domain\config\config.xml file.

  2. Remove all the instances of multi data sources.

    For example, remove the entries for the following data sources: mslvDataSource1, mslvDbTraceDataSource1,mslvNoneTxDataSource1, mslvProcDataSource1, mslvWSDataSource1, mslvPSDataSource1, mslvDataSource2, mslvDbTraceDataSource2, mslvNoneTxDataSource2, mslvProcDataSource2, mslvWSDataSource2, mslvPSDataSource2, and so on:

    <jdbc-system-resource>
       <name>mslvDataSource1</name>
       <target>RacConfigServer</target>
       <descriptor-file-name>jdbc/mslvDataSource1-0700-jdbc.xml
       </descriptor-file-name>
    </jdbc-system-resource>
    <jdbc-system-resource>
       <name>mslvDbTraceDataSource1</name>
       <target>RacConfigServer</target>
       <de-scriptor-file-name>jdbc/mslvDbTraceDataSource1-8405-jdbc.xml
       </descriptor-file-name>
    </jdbc-system-resource>
    .
    .
    .
    <jdbc-system-resource>
       <name>mslvWSDataSource2</name>
       <target>RacConfigServer</target>
       <descriptor-file-name>jdbc/mslvWSDataSource2-5599-jdbc.xml
       </descriptor-file-name>
    </jdbc-system-resource>
    <jdbc-system-resource>
       <name>mslvPSDataSource2</name>
       <target>RacConfigServer</target>
       <de-scriptor-file-name>jdbc/mslvPSDataSource2-5450-jdbc.xml
       </descriptor-file-name>
    </jdbc-system-resource>
          
    
  3. Save and close the config.xml file.

  4. Restart the application server.

Modifying the Classpath for the WebLogic Server Domain

To update the classpath for the WebLogic domain:

  1. Edit the m63domain\bin\setDomainEnv.cmd file.

  2. Add the path for the ons.jar file to the CLASSPATH environment variable.

    For example:

    set CLASSPATH=%CLASSPATH%;C:\Oracle\Middleware\Oracle_Home\oracle_common\lib\ons.jar;
    
  3. Save and close the file.

Configuring the Connection Pool Parameters

To configure the connection pool parameters:

  1. Navigate to m63domain\config\jdbc the folder.

  2. Edit each XML file for the mslvWSDataSource, mslvDbTraceDataSource, mslvNoneTxDataSource, mslvProcDataSource, mslvPSDataSource, and mslvWSDataSource data sources, and update the <jdbc-connection-pool-params> element as follows:

    <jdbc-connection-pool-params>
        <initial-capacity>10</initial-capacity>
        <max-capacity>100</max-capacity>
        <min-capacity>2</min-capacity>
        <highest-num-waiters>1000</highest-num-waiters>
        <connection-reserve-timeout-seconds>60</connection-reserve-timeout-seconds>
        <test-connections-on-reserve>true</test-connections-on-reserve>
        <inactive-connection-timeout-seconds>14400
        </inactive-connection-timeout-seconds>
        <test-table-name>SQL ISVALID</test-table-name>
        <statement-timeout>0</statement-timeout>
    </jdbc-connection-pool-params>
    
  3. Save and close the XML file for each data source.

Example 9-1 shows sample XML for one data source.

Example 9-1 Sample of One Data Source

<jdbc-data-source>
   <name>DataSourceName</name>
   <datasource-type>AGL</datasource-type>
   <jdbc-driver-params>
      <url>jdbc:oracle:thin:@server:port/DB</url>
      <driver-name>oracle.jdbc.xa.client.OracleXADataSource</driver-name>
      <properties>
         <property>
            <name>user</name>
            <value>user_name</value>
         </property>
      </properties>
      <password-encrypted>password</password-encrypted>
   </jdbc-driver-params>
   <jdbc-connection-pool-params>
      <test-table-name>SQL ISVALID</test-table-name>
   </jdbc-connection-pool-params>
   <jdbc-data-source-params>
      <jndi-name>JNDIName</jndi-name>
      <global-transactions-protocol>TwoPhaseCommit
         </global-transactions-protocol>
   </jdbc-data-source-params>
   <jdbc-oracle-params>
      <fan-enabled>true</fan-enabled>
      <ons-node-list />
      <ons-wallet-file />
      <active-gridlink>true</active-gridlink>
   </jdbc-oracle-params>
</jdbc-data-source>

Note:

Some lines in the example are wrapped for the display.

Tuning JDBC Multi Data Source

For each data source perform the steps in this procedure to tune the data sources.

To tune each data source:

  1. Ensure you are logged into the WebLogic administration console.

  2. In the Domain Structure tree, expand Services, and then click Data Sources.

    The Summary of JDBC Data Sources page is displayed.

  3. Select the target data source (for example, mslvDataSource1).

    The Settings for <DataSource> page is displayed.

  4. Click the Connection Pool tab.

    The Connection Properties are displayed.

  5. Click Lock and Edit.

  6. Scroll down to Initial Capacity and Maximum Capacity.

  7. In the Initial Capacity field, enter 1.

  8. In the Maximum Capacity field, enter 15.

    Note:

    The values of the Initial Capacity and Maximum Capacity fields depend on their particular MSS deployment.

  9. Scroll down to the bottom of the page and click Save.

    The Settings for <DataSource> page is displayed.

  10. Click Advanced to display additional configuration items.

  11. Select the Test Connections On Reserve check box.

  12. Click Save.

    The Settings for <DataSource> page is displayed.

  13. Click the Transaction tab.

    The Transaction Properties are displayed.

  14. Select the Set XA Transaction Timeout check box.

  15. In the XA Transaction Timeout field, enter 3600.

  16. In the XA Retry Duration field, enter 300.

  17. Click Save.

  18. Click Activate Changes.

    The Settings updated successfully message is displayed.

  19. Repeat steps 1 through 18 to tune each data source.