DB2 databases

If you are using the DB2 database, consider the following when setting up the Rule Execution Server database.

Creating a DB2 database for Linux on z Systems™

The existing DB2® installation is assumed to have automatic storage and a 32 K buffer pool with the default ID of BP32K. To create a DB2 database, you must have DB2 administrator rights. For more information, consult your DB2 database administrator or the DB2 documentation, in particular about creating databases and other related tasks such as CREATE DATABASE command.

Enter the following commands:

su {DB2AdminName}
db2
CREATE DATABASE {RESDBName}

To set up the database, you can use the Rule Execution Server console or you can run the SQL scripts that are provided in <InstallDir>/executionserver/databases. A readme file in this directory provides more information about the scripts.

Creating a DB2 database on z/OS

You must first install DB2 and set the appropriate rights on the database, and then customize JCL.
  1. Check that you have a supported DB2 for z/OS® version.
  2. Check that you have DB2 Administrator authority to CREATE a database and CREATE & UPDATE tables.

For more information, consult your DB2 database administrator or the DB2 documentation, in particular about creating databases and other DB-related tasks such as CREATE DATABASE command.

After you have customized the JCL variables for your configuration, you can submit the jobs to create a database for Rule Execution Server.

Customize the JCL as indicated in the comments within each PDSE member, before you run them on the z/OS system. You can customize the JCL either by using a manual search-and-replace or by using an ISPF macro.

On the z/OS computer where DB2 is installed, run the following JCL scripts to create the RULEAPP tables, XOM table, EXECUTION_TRACES tables, and grant authority to the tables. This task is typically a database administrator's task. ++DB2USER++ is the user ID to access DB2.
  1. InstallDir/executionserver/jcl/HBRDSCDB.jcl
  2. InstallDir/executionserver/jcl/HBRDSXOM.jcl
  3. InstallDir/executionserver/jcl/HBRDSCTR.jcl
  4. InstallDir/executionserver/jcl/HBRDSGRN.jcl
  5. InstallDir/executionserver/jcl/HBRDSDCR.jcl

Running SQL scripts to create a DB2 schema

The script that creates the DB2 database schema is named repository_db2.sql. You can also create the database schema for Decision Warehouse by running the script trace_db2.sql. If you are storing the Java™ XOM in the database, you must create these tables by running the xomrepository_db2.sql script.

When you use DB2, the scripts that create the Rule Execution Server database tables are written for databases that use automatic storage.
Important: Users who work with DB2 on z/OS as the back-end database for the rules at run time must apply a fix to a database storage overflow problem. This fix is particularly important for the Decision Warehouse trace table, which can contain a lot of high-volume LOB data. You can find information about this fix on the IBM® support web site.
The following constraints apply:
  • BP32K is the buffer pool that is expected in SYSCAT.BUFFERPOOLS. If BP32K is not there, you can use the existing buffer pool or create a new buffer pool named BP32K. Use the following command to query SYSCAT.BUFFERPOOLS for the existing buffer pool:
    Select * from SYSCAT.BUFFERPOOLS
    Otherwise, use the following command to create a buffer pool named BP32K:
    CREATE BUFFERPOOL BP32K SIZE 2000 PAGESIZE 32K
  • You must update the trace_db2.sql script and select the custom option in the Installation Settings wizard to run it. Modify the following line in the script to specify storage for tablespace:
    CREATE TABLESPACE RESDWTS PAGESIZE 32K BUFFERPOOL BP32K;
    Here is an example of the tablespace specification in the script:
    CREATE  TABLESPACE RESDWTS PAGESIZE 32K  MANAGED BY Database  USING [ FILE 'C:\DB2\Container.file' 640 ] BUFFERPOOL  BP32K;
  • You might have to further modify the script, depending on your database settings.

To create the DB2 schema using the provided SQL scripts:

  1. Connect to the Rule Execution Server database:
    CONNECT TO{RESDBName}
    QUIT
  2. Navigate to the directory <ODM_InstallDir>/executionserver/databases.
  3. Run the following command to create the Rule Execution Server tables:
    db2 -tvf repository_db2.sql
  4. Run the following command to create the Decision Warehouse tables:
    db2 -tvf trace_db2.sql
  5. Run the following command to create the Java XOM tables:
    db2 -tvf xomrepository_db2.sql
  6. Disconnect from the database:
    db2 DISCONNECT {RESDBName}
  7. Exit the {DB2AdminName} UserID:
    EXIT