Creating a DB2 for Linux, UNIX, and Windows database for Business Process Choreographer

Use this task to create a DB2® database for Business Process Choreographer.

Steps for this task

  1. Install DB2 on the server that hosts the database.
  2. Install a DB2 client on:
    • All remote application servers that use a type-2 Java™ Database Connectivity (JDBC) driver to access the database.
    • On the server that hosts the deployment manager, if you use Network Deployment to administer Business Process Choreographer, for example if you are creating a clustered Business Process Choreographer setup.
  3. On the server that hosts your application server, change to the directory where the Business Process Choreographer configuration scripts for your database system are located:
    • On Windows® systems, enter:
      cd install_root\dbscripts\ProcessChoreographer\DB2
    • On UNIX® and Linux® systems, enter:
      cd install_root/dbscripts/ProcessChoreographer/DB2
  4. If your database is on a different server than your application server:
    1. Copy the following SQL scripts to your database server:
      clearSchema.sql
      createDatabase.sql
      createTablespace.sql
      createSchema.sql
      dropSchema.sql
      dropTablespace.sql
    2. Optional: If you want Business Process Choreographer Observer to use the same database as the business process container:
      1. Also copy the following SQL scripts to the same directory on your database server:
        clearSchema_Observer.sql
        createDatabase_Observer.sql
        createSchema_Observer.sql
        createTablespace_Observer.sql
        dropSchema_Observer.sql
        dropTablespace_Observer.sql
      2. Copy the jar file bpcodbutil.jar, from the lib subdirectory of the install_root directory to the same directory on your database server.
    3. Change to the directory where you copied the SQL scripts.
  5. If you want to use an existing database, skip to step 9 to create the table space and schema. Unicode support: Make sure that the database supports Unicode (UTF-8). Without Unicode support, it cannot store all characters that can be handled in Java code, and you can run into code page conversion problems when a client uses an incompatible code page.
  6. Create a DB2 instance on the database server.
  7. If you have a Symmetric Multi-Processor (SMP) server check how many processors can be used by DB2. Check your license:
    • On AIX® systems, enter the command:
      /usr/opt/db2_08_01/adm/db2licm -l
    • On other UNIX or Linux systems, enter the command:
      /opt/IBM/db2/V8.1/adm/db2licm -l
    If necessary, change the number of processor licenses using either the db2clim command or the DB2 License Center.
  8. Create a new database:
    1. Make sure that you use a user ID that has administrator rights for the database system.
    2. If you want to create a non-production database, named BPEDB, for stand-alone development, evaluation, or demonstration purposes, enter the following command:
      db2 -tf createDatabase.sql
      Otherwise you must create the database manually. For a production environment consider using dedicated table space containers and adjusting the DB2 parameters.
    3. Make sure that the script output contains no errors. In some cases, the Call Level Interface (CLI) packages are not bound to the new database. To be sure that the CLI packages are bound to the new database, for a database named BPEDB:
      On Windows systems, enter:
      db2 connect to BPEDB 
      db2 bind %DB2PATH%\bnd\@db2cli.lst blocking all grant public
      On UNIX and Linux systems, enter:
      db2 connect to BPEDB 
      db2 bind $DB2DIR/bnd/@db2cli.lst blocking all grant public
  9. To create the table space and schema:
    1. Analyze the results of your experiences during development and system testing. The size of your database depends on many factors. Processes that run as microflows use very little space. Each process template can require tens or hundreds of kilobytes. If possible, distribute table space containers across different logical disks, and implement an appropriate security policy. Consider the performance implications of your choices for buffer pools and log file settings.
    2. Edit the createTablespace.sql table space creation script according to the instruction at the top of the file.
    3. Make sure that you have administrator rights for the database system. The user ID that you use to create the schema must be the same one that you specify when configuring the data source for the business process container.
    4. Make sure that you are attached to the correct instance. Check the DB2INSTANCE environment variable.
    5. To connect to a database named databaseName, in the DB2 command-line processor, enter the command:
      db2 connect to databaseName
    6. To create the table spaces, enter the command:
      db2 -tf createTablespace.sql
      Make sure that the script output contains no errors. If errors occur, you can drop the table space using the dropTablespace.sql script.
    7. To create the schema (tables, indexes, and views) in the DB2 command-line processor, enter the command:
      db2 -tf createSchema.sql
      Make sure that the script output contains no errors. If you want to drop the schema, use the dropSchema.sql script.
  10. On each application server that remotely accesses the database and on the deployment manager machine if you are creating a clustered setup or if you want to use Network Deployment:
    1. Catalog the database by entering the command:
      db2 catalog database databaseName as databaseAlias at node nodeName
      For more information about cataloging a database refer to the DB2 documentation.
    2. Verify that you can connect to the database by entering the commands:
      db2 connect to databaseName user userID
      db2 connect reset
  11. Optional: If you want Business Process Choreographer Observer to use the same database as the business process container, perform the following actions:
    1. Install the jar file bpcodbutil.jar, which contains UDFs for Business Process Choreographer Observer:
      1. If you are not already connected to the database, connect to it by entering the following command in a DB2 command-line processor:
         db2 connect to databaseName
      2. Install the jar file by entering the following command:
        db2 call sqlj.install_jar('file:/pathURL','BPCODBUTIL')
        where pathURL is a fully qualified URL to the jar file. For example:
        • On Windows platforms, if the jar file is in the directory c:\tmp, you must enter the command:
          db2 call sqlj.install_jar('file:/c:/tmp/bpcodbutil.jar','BPCODBUTIL')
        • On Linux and UNIX platforms, if the jar file is in the directory /tmp, you must enter the command:
          db2 call sqlj.install_jar('file:/tmp/bpcodbutil.jar','BPCODBUTIL')
        Note: If you want to drop the jar file, use the following command:
        db2 call sqlj.remove_jar('BPCODBUTIL')
    2. Create the table space
      1. Edit the createTablespace_Observer.sql script file according to the instruction at the top of the file.
      2. Run the table space creation script file, enter the command:
        db2 -tf createTablespace_Observer.sql
      3. Make sure that the script output contains no errors. If errors occur, you can drop the table space using the dropTablespace_Observer.sql script file.
    3. Create the schema (tables, indexes, and views).
      1. In the DB2 command-line processor, enter the command:
        db2 -tf createSchema_Observer.sql
      2. Make sure that the script output contains no errors. If you want to drop the schema, use the dropSchema_Observer.sql script file.

Result

The database for Business Process Choreographer exists.

What to do next

Continue configuring in the parent topic at step 2.

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)