IBM BPM, V8.0.1, All platforms > Install IBM BPM > IBM BPM Advanced for z/OS: Process Server > Configure IBM BPM Advanced for z/OS: Process Server > Create the databases > Create databases in the DB2 for z/OS subsystem

Create DB2 for z/OS database objects using the DB2 command line processor

When you run the createDB2.sh script, you can choose to run the SQL immediately to create the database objects for the specified database, or you can bypass running the SQL scripts so that you can run them later. If you bypass execution of the SQL, the createDB2.sh script consolidates the SQL statements into two files (z_schema.sql and z_schemaProc.sql) that you can run later by using the DB2 command line processor.

You can also run these .sql files by using any other database tool of your choice, such as SPUFI or DSNTEP2.

Provided that the database scripts are grouped appropriately in the output directories that were specified when you ran the database design tool, you can run the createDB2.sh script once for each instance of a database to be created. In a sysplex environment where the database is not shared across the sysplex, and IBM BPM and DB2 for z/OS are installed on different LPARs, run createDB2.sh on the system that has the installation of DB2 rather than the one that has the installation of IBM BPM.

Important: It is anticipated that the DB2 for z/OS system administrator will run the createDB2.sh script with a user ID that has SYSADM authority, to create the databases and storage groups. On completion, the system administrator can then grant DBADM authority for the IBM BPM databases to the WebSphere administrator.


Procedure

Complete the following steps for each database to create:

  1. In the z/OS system that contains the IBM BPM installation, or the DB2 installation on a different LPAR, access the UNIX System Services command shell. Then change to the directory to which the database scripts were generated.

    For example:

    cd /WebSphere/V8T3Z1/AppServer/profiles/default/dbscripts/S4CELLDB

  2. Run the createDB2.sh script by using the following syntax:

    createDB2.sh -DBAlias alias_name -DBName database_name -DBSto storage_group_name -DBCreate -DBVCat volume_catalog -DBUser DB_user_ID

    where:

    -DBAlias

    Specifies an alias name, which maps to the DB2 server URL, user ID, and password, and which is used to connect to DB2. If you do not specify this parameter when you run the createDB2.sh script, you are prompted for a value.

    -DBName

    Specifies the name of the database to be created.

    -DBSto

    Specifies the storage group name for the volumes that hold the data sets where tables and indexes are stored.

    -DBCreate

    Creates the database.

    -DBVCat

    Specifies the name of the DB2 Virtual Storage Access Method (VSAM) catalog that records information about the data sets.

    -DBUser

    Specifies the user ID of the WebSphere administrator that has database administration authority for the IBM BPM database being created.

    Tip: By omitting the -RunSQL parameter, you bypass the execution of the SQL statements that create the database objects, and instead consolidate the statements into two .sql files.

    For example:

    createDB2.sh -DBAlias DSNXWBD -DBName S4CELLDB -DBSto S4DBSTO -DBCreate -DBVCat DSNV10PP -DBUser S4ADMIN

    For information about all the parameters that are available for the createDB2.sh script and example usage, see createDB2.sh script.

    The z_schema.sql and z_schemaProc.sql files, which hold the consolidated SQL statements, are generated in the directory from which you ran the createDB2.sh script. The z_schemaProc.sql file contains SQL statements for stored procedures, and is generated in addition to z_schema.sql because stored procedures require the "at" sign (@) as a statement termination character when running the command line processor.

  3. Run the DB2 command line processor in batch mode to run the SQL commands in the z_schema.sql file:

    db2 -f / createDB2.sh_path/z_schema.sql

    For example:

    db2 -f /WebSphere/V8T3Z1/AppServer/profiles/default/dbscripts/S4CELLDB/z_schema.sql

    The command line processor reads the data in the file, and processes the commands in the file consecutively.

  4. Run the DB2 command line processor again to run the SQL commands in the z_schemaProc.sql file, and additionally use the -td parameter to define @ as the statement termination character:

    db2 -td@ -f / createDB2.sh_path/z_schemaProc.sql

    For example:

    db2 -td@ -f /WebSphere/V8T3Z1/AppServer/profiles/default/dbscripts/S4CELLDB/z_schemaProc.sql


Results

Each database is created and populated with the required database objects.


What to do next

For a stand-alone configuration, complete the remaining database configuration tasks, if relevant. Then run the bootstrap utility to load the database with system information.

For an ND configuration, complete the remaining database configuration tasks, if relevant. Then start the dmgr server.

Create databases in the DB2 for z/OS subsystem


Related concepts:
Decide on a naming convention for the databases
Decide on schema names and SQL IDs


Related tasks:
Configure the DB2 command line processor
Augmenting stand-alone and ND profiles
Create a database design file and database scripts for a stand-alone profile or deployment environment by using the database design tool
Generate scripts for creating database objects in DB2 for z/OS
Loading the database with system information (stand-alone environment)
Loading the database with system information (ND environment)
Starting the dmgr