Step 3: Setting up the database

You must setup the database dedicated to Rule Execution Server if you are using database persistence.

About this task

Note: Skip to the next step if you are a beginner using the embedded Derby database.

The database is required so that you can connect the datasource when you deploy the Rule Execution Server management archive in the next step.

Create your database now if it does not already exist, by following the instructions for your database type. For some types of databases, you can also create the database when you establish the connection to the datasource.

After you create the empty database, you can create the Rule Execution Server database schema immediately by running SQL scripts.

Note: You can also create the database schema from the Rule Execution Server console after you deploy the Rule Execution Server management archive.

The scripts that create the database schema and populate the tables are available in <InstallDir>/executionserver/databases.

Use the following scripts:
  • repository_<DatabaseName>.sql - Support for the core RuleApp and ruleset persistence.
  • xomrepository_<DatabaseName>.sql - Support for the XOM libraries and resources persistence.
  • trace_<DatabaseName>.sql - Support for the Decision Warehouse persistence.
The following conditions apply:
Condition on... Description
db2 or db2_os390 schema If you select a db2 or db2_os390 schema, the Decision Warehouse tablespace requires a buffer pool with a page size of 32K. Check the DB2® documentation for information about how to create a 32K buffer pool.
Automatic storage The scripts for creating the Decision Warehouse database on DB2 are written for databases that use automatic storage. If you have not configured your DB2 database to use automatic storage, you must use the SQL script to generate the database schema.
MySQL persistence If you choose to use MySQL as a persistence back end, add or set the following properties in the MySQL configuration file: my.ini on Windows or my.cnf on UNIX operating systems:
sql-mode=STRICT_ALL_TABLES
max_allowed_packet=1073741824

For more information about these settings, see the MySQL reference manual: Server SQL Modes and Server System Variables.

SQL collation The Rule Execution Server database is case sensitive.
To access the database, the database user must secure the following credentials and privileges:
  • The database user name and password

  • Complete privileges on the tables, and a view of the schema (create, insert, delete)

  • Create index privileges

  • On Oracle, create trigger and create sequence privileges

The following example shows how to create a Derby database and then create the database schema.

Procedure

  1. Launch <DerbyInstallDir>/bin/ij.bat (or ij for Linux).
  2. Create the database and connect to it.

    For example, to create the new database c:/resdb as the user resdbUser and connect to it, use the command:

    ij>connect 'jdbc:derby:c:/resdb;user=resdbUser;password=resdbUser;create=true';

  3. Run the scripts that create the database schema and populate the tables: ij> run '<InstallDir>/executionserver/databases/repository_derby.sql';
    Note: If the script is being run for the first time, some warnings related to the drop statements might occur.

    Then, run the other scripts: xomrepository_<DatabaseName>.sql and trace_<DatabaseName>.sql.

  4. Close the ij utility.

    ij> quit;