State database

You follow these steps to create dynamic database tables in the State database. The scripts are stored in a user-defined location. This location is defined during the setting of the Schema Generator configuration in the WebSphere® Business Monitor administrative console.

The Database Definition Language (DDL) script needed for creating the dynamic database tables in the State database is stored in the state.ddl file on the root directory. To deploy the scripts, complete the following steps:
  1. Open the DB2® Command Window. On UNIX®, If the shell environment is configured, you can invoke the DB2 command line processor.
  2. Change the path to the location of the script file.
  3. Back up the State database before you deploy a new business measures model.
  4. Run the command db2 terminate. This ensures that any previous background processes which may be using a different code page value will not be used and that a new background process will be used to process this request.
  5. Set the DB2CODEPAGE environment variable to 1208. The DB2 command line processor will by default interpret any character data using the current code page. The generated state.ddl however contains UTF-8 characters that will be corrupted unless the DB2CODEPAGE environment variable is set to 1208.
    1. On the UNIX operating system.
      • Usingsh, ksh, bash type shells, run the command export DB2CODEPAGE=1208.
      • Using csh, tsch type shells, run the command setenv DB2CODEPAGE 1208.
    2. On the Windows® operating system, run the command set DB2CODEPAGE=1208.
  6. Connect to the State database by running the command db2 connect to <State_DB_Name>.
  7. Run the command db2 +c –stvf state.ddl > state.log. This runs the script and saves a log file that records the transactions for troubleshooting purposes. Check the log file for any errors before you decide to commit or rollback. If a rollback is required, run the command db2 rollback to undo the actions. If no errors occurred, run the command db2 commit to commit the changes.
  8. Disconnect from the State database after running the script with the command db2 disconnect <State_DB_Name>.
  9. Run the command db2 terminate to terminate the background processes.

Copyright IBM Corporation 2005, 2006. All Rights Reserved.