Creating DB2 databases

You can create the required databases for IBM® Business Process Manager either before or after you run the BPMConfig command with the -create -de parameters to create the stand-alone profile.
The BPMConfig command requires input from a properties file that contains configuration settings for the profile and databases to be created. In this file, the bpm.de.deferSchemaCreation property determines when the databases can be created:
  • If the property is set to false, database tables are automatically created when you run the BPMConfig command to create the stand-alone profile. Therefore, the empty databases must exist before you run the BPMConfig command.
  • If the property is set to true, database table creation is deferred when you run the BPMConfig command to create the stand-alone profile. Therefore, you can create the databases either before or after running the command. You might find it useful to create the databases after running the BPMConfig command because you can use the set of populated scripts, which the command generates, to create the databases and database tables at a time that you choose.

About this task

The default database names are BPMDB for the Process database, PDWDB for the Performance Data Warehouse database, and CMNDB for the Common database. Usually you require the Process database, the Performance Data Warehouse database, and the Common database.

The Process Server and Performance Data Warehouse require their own separate databases and cannot be configured on the same database as the other IBM Business Process Manager components.

Creating the databases before creating the stand-alone profile and database tables

To generate the database scripts that can be used by the BPMConfig command to create and configure your databases, you can run BPMConfig with the -create -sqlfiles parameters, and additionally include the -outputDir parameter to specify a location for the generated scripts. When you run the BPMConfig command with these parameters, it generates the database scripts without configuring your environment.

Before you begin

Prepare the following information:
  • Information about the database configuration that you are designing. This might be a document that describes the general purpose of the database configuration supplied by the database administrator or solution architect. Alternatively, it might be a description of required parameters and properties. This information must include:
    • The location of the databases
    • The user ID and password for authenticating to the database
  • Information about how IBM Business Process Manager and its components have been installed, the database software used, and the properties required by that type of database.
  • An understanding of the profiles that you plan to create, specifically, the functional relationship between the profile types and the databases.
  • Information about the topology pattern to be implemented, and an understanding of how the database design fits into the pattern that you plan to use.

Procedure

  1. On the computer where you installed IBM Business Process Manager, navigate to the following directory where the sample configuration properties files are stored:

    install_root/BPM/samples/config/express

  2. Find the sample properties file that most closely represents your target deployment environment and make a copy of this file. The sample properties files are named according to the following format: de_type[-environment_type]-topology-DB2, where:
    • de_type is set to Express.
    • environment_type can be set to PS for Process Server or PC for Process Center. .
    • topology is set to Standalone.
    For example, the sample configuration properties file for a stand-alone Process Center environment using a DB2 database is named Express-PC-Standalone-DB2.properties.
  3. Edit the copied properties file and update the values as required to reflect your profile and database configuration. When modifying the sample properties file, use the guidance provided within the file for specifying values.
    Tip: You can use this same properties file later when you run the BPMConfig command to create your stand-alone profile.
    Additional considerations:
    • Your modified properties file must use UTF-8 encoding.
    • If you want to automatically create your database tables when you run the BPMConfig command later to create the stand-alone profile, set the bpm.de.deferSchemaCreation property to false.
    • Do not add any custom properties to this file when you perform your modifications or the BPMConfig command will fail when it is run.
    • If you need to use a backslash character (\) in your properties file, for instance when specifying path names or passwords, you must use an escape backslash before it. For example: bpm.de.node.1.installPath=c:\\IBM\\BPM85.

    For more information about the available properties, see the BPMConfig command-line utility topic and the descriptions in the Configuration properties for the BPMConfig command topic.

  4. Run the BPMConfig command on the computer where IBM Business Process Manager is installed, passing it the name of the properties file that you created. For example:
    install_root/bin/BPMConfig -create -sqlfiles /directory_path/my_environment.properties -outputDir /my_bpmscripts_dir

    In this syntax, directory_path/my_environment.properties is the location and name of your customized properties file, and my_bpmscripts_dir is the directory where you want to generate the database scripts.

    The generated scripts include a set of files named createDatabase.sql, which can be used to create the databases. The createDatabase.sql files are generated into the following default locations:
    • my_bpmscripts_dir/dbscripts/cell_name.deployment_environment_name/DB2/CMNDB
    • my_bpmscripts_dir/dbscripts/cell_name.deployment_environment_name/DB2/BPMDB
    • my_bpmscripts_dir/dbscripts/cell_name.deployment_environment_name/DB2/PDWDB
    The number of subdirectories that are generated is dependent on the number of databases that were defined in the properties file.
    Note: These scripts are overwritten if you run the BPMConfig command again.
  5. For each createDatabase.sql file that was generated, run the following command on your local or remote database server:
      db2 -tvf createDatabase.sql
    Tip: In addition to the createDatabase.sql database script, a createDatabase.sh convenience shell script is also generated that you can use instead of directly invoking the createDatabase.sql file.

Creating the databases after creating the stand-alone profile

If you want to use the BPMConfig command to create the stand-alone profile separately from the database tables, you can first run the command with the -create -de parameters to create the profile. Afterwards, you can run the command again with the -create -sqlfiles parameters to generate the database scripts that can be used to create the databases and database tables. The generated database scripts are populated with the values from the properties file that you specified.

Before you begin

You must have already run the BPMConfig command to create the stand-alone profile.

Procedure

  1. Note the location of the properties file that you specified when you ran the BPMConfig command to create the stand-alone profile.
  2. On the computer where you created the stand-alone profile, run the BPMConfig command to generate the database scripts, passing it the name of the properties file. For example:
    install_root/bin/BPMConfig -create -sqlfiles /directory_path/my_environment.properties [-outputDir /my_bpmscripts_dir]

    In this syntax, directory_path/my_environment.properties is the location and name of your customized properties file. (The -outputDir parameter and associated my_bpmscripts_dir value are optional and can be used to specify an alternative directory where you want to generate the database scripts.)

    The generated scripts include a set of files named createDatabase.sql, which can be used to create the databases. The createDatabase.sql files are generated into the following default locations:
    • standalone_profile_root/dbscripts/cell_name.deployment_environment_name/DB2/CMNDB
    • standalone_profile_root/dbscripts/cell_name.deployment_environment_name/DB2/BPMDB
    • standalone_profile_root/dbscripts/cell_name.deployment_environment_name/DB2/PDWDB
    The number of subdirectories that are generated is dependent on the number of databases that were defined in the properties file.
    Note: These scripts are overwritten if you run the BPMConfig command again.
  3. For each createDatabase.sql file that was generated, run the following command on your local or remote database server:
      db2 -tvf createDatabase.sql
    Tip: In addition to the createDatabase.sql database script, a createDatabase.sh convenience shell script is also generated that you can use instead of directly invoking the createDatabase.sql file.