Create Region and Cross-Region Scripts for Db2

Attention: This feature is in Early Adopter Product (EAP) release status. We will continue the development of additional features and provide additional interfaces via patch updates and future releases. Please contact Micro Focus SupportLine if you require further clarification.

For Db2 databases, you can use the conventional method of database creation, using ODBC DSNs, as detailed for the other supported database types; but due to the Db2 architecture, it is preferable to create the databases ahead of time, using an SQL script file.

  1. To create a region database script file, on the command line, enter the following command:
    dbfhadmin -script -type:region -provider:db2 -name:<es-name> -file:<script-name.sql> [-existdb:<db-name>|-db:<db-name>]

    where <es-name> is the name of the intended enterprise server region, which must be 8 characters or less (a Db2 restriction).

    Additionally, there are two (mutually exclusive) optional parameters that you can specify: if you are creating the region database to be within an existing Db2 database (for example, you may have one database that holds all datastores, region databases, and a cross-region database), use the -existdb option; if you are creating a new Db2 database, use the -db option to specify the name of the database; if you omit both options, a new database with a default name will be created - the default name for a region database is the value given for the -name option.

    Note: If you omit the -file option, the default name is create_region_db2.sql
  2. To create a cross-region database script file, on the command line, enter the following command:
    dbfhadmin -script -type:crossregion -provider:db2 -file:<script-name.sql> [-existdb:<db-name>|-db:<db-name>]

    Cross-region database names are hard-coded to $XREGN$.

    Additionally, there are two (mutually exclusive) optional parameters that you can specify: if you are creating the cross-region database to be within an existing Db2 database that does not already contain a cross-region database), use the -existdb option; if you are creating a new Db2 database, use the -db option to specify the name of the database; if you omit both options, a new database with a default name will be created - the default name for a cross-region database is $XREGN$.

    Note: If you omit the -file option, the default name is create_crossregion_db2.sql
    Once you have created the script files, use the dbfhadmin utility to run them, and create the required databases.
  3. To create a region database, on the command line, enter the following command:
    dbfhadmin -createdb -file:<script-name.sql> -type:region -provider:db2

    where <script-name.sql> is the name of the script file that was created in an earlier step.

  4. To create a cross-region database, on the command line, enter the following command:
    dbfhadmin -createdb -file:<script-name.sql> -type:crossregion -provider:db2
    Note: If you specify an existing database, it cannot already contain a cross-region database.

Next, you must create or edit a configuration file, so that it contains entries to the region and the cross-region databases.