Creating the exceptions database schema for a Db2 database

You must create the exceptions database schema that stores exception data.

Procedure

  1. Ensure that you are logged in as a user that can run the db2 command and that has access to the scripts.
  2. If the database is remote from the services tier, copy the scripts to the database server host.
  3. Connect to the Db2® terminal.
    • If you are on a Linux® or UNIX operating system, source the db2profile. ~/sqllib/db2profile
    • If you are on Windows, use the db2cmd command. db2cmd -i -w db2clpsetcp
  4. If you are creating the exceptions database in a new Db2 database, rather than in an existing database such as the metadata repository, run this command to create the database:
    db2 -tf esdb_db_creation.sql
  5. To create the database schema and table spaces, enter the following commands:
    db2 -tf esdb_tablespace_creation.sql
    db2 -tf esdb_permissions_schema_creation.sql
  6. Connect to the database with the exceptions database user so the user owns the objects:
    db2 connect to DBNAME user DBUSER using password
    where DBNAME is the name of the database, DBUSER is the exceptions database repository user, and password is the user's password.
  7. Create the tables:
    db2 -tf esdb_table_creation.sql
  8. Test the connection with the following command:

    On Linux or UNIX:

    RepositoryAdmin.sh -tc -rn ESDB -cn ESDB
    On Windows:
    RepositoryAdmin.bat -tc -rn ESDB -cn ESDB

    If the connection fails, verify that you ran the database creation scripts correctly. Repeat the database creation process if necessary.