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 profiles and configure your deployment environment.
The BPMConfig command requires input from a properties file that contains configuration settings for the profiles, deployment environment, 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 profiles and deployment environment. 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 profiles and deployment environment. 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.

In an Advanced-only deployment environment, you need only the Common database. For both Advanced and Advanced-only deployment environments, the Common database has two parts: one is scoped to the cell and the other is scoped to the deployment environment. Both parts can be defined to use CMNDB (which is the default) or they can use separate databases.

Creating the databases before creating the profiles and configuring the deployment environment

To generate the database scripts that can be used to create and configure your databases, you can run the BPMConfig command 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:

    BPM_HOME/BPM/samples/config

  2. Find the sample properties file that most closely represents your target deployment environment and make a copy of this file. For each of the different product configurations, there is a different folder containing sample properties files. For example, for configuring an Advanced, Advanced-only, or Standard deployment environment, there is an advanced, advancedonly, or standard folder containing a set of sample properties files. Within each folder, there is a set of files that is specific to the different database types and configuration environments. The sample properties files are named according to the following format: de_type[-environment_type]-topology-database_type[-suffix], where:
    • de_type can be set to Advanced, AdvancedOnly, or Standard.
    • environment_type can be set to PS for Process Server or PC for Process Center. This variable is not used if de_type is AdvancedOnly.
    • topology can be set to SingleCluster or ThreeClusters.
    • database_type can be set to DB2, DB2zOS, Oracle, or SQLServer.
    • suffix can be set to -WinAuth for an SQL Server database.
    For example, the sample configuration properties file for configuring an Advanced deployment environment with Process Center and a single cluster topology using a DB2 database is named Advanced-PC-SingleCluster-DB2.properties.
  3. Edit the copied properties file and update the values as required to reflect your profile, deployment environment, 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 profiles and deployment environment.
    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 profiles and configure your deployment environment, 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.dmgr.installPath=c:\\IBM\\BPM85.
    • If you are configuring a three-cluster setup that is based on the Advanced or AdvancedOnly template, and you want your deployment environment to include the optional Business Process Archive Manager, include the properties file entries that are described in the topic Configuring Business Process Archive Manager.

    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:
    BPM_HOME/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/DB2/CMNDB
    • /my_bpmscripts_dir/dbscripts/deployment_environment_name/DB2/CMNDB
    • /my_bpmscripts_dir/dbscripts/deployment_environment_name/DB2/BPMDB
    • /my_bpmscripts_dir/dbscripts/deployment_environment_name/DB2/PDWDB
    The number of subdirectories that are generated is dependent on the deployment environment type and 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

Creating the databases after creating the profiles and configuring the deployment environment

When you run the BPMConfig command with the -create -de parameters to create the profiles and configure the network deployment environment, database scripts are generated that are populated with the values from the properties file that you specified. You can use some of these scripts to create the databases if you chose to defer the creation of the database tables.

Before you begin

You must have already run the BPMConfig command to create the profiles and configure the network deployment environment.

Procedure

  1. On the computer where you created the deployment manager profile, navigate to one or more of the following default subdirectories where the SQL database scripts were generated:
    • /dmgr_profile_name/dbscripts/cell_name/DB2/CMNDB
    • /dmgr_profile_name/dbscripts/deployment_environment_name/DB2/CMNDB
    • /dmgr_profile_name/dbscripts/deployment_environment_name/DB2/BPMDB
    • /dmgr_profile_name/dbscripts/deployment_environment_name/DB2/PDWDB

    These directories contain the createDatabase.sql scripts that you can use to create the databases.

    The number of subdirectories that are generated is dependent on the deployment environment type and the number of databases that were defined in the properties file.

  2. For each createDatabase.sql file that was generated, run the following command on your local or remote database server:
      db2 -tvf createDatabase.sql