Creating the exceptions database schema for a Db2 database
You must create the exceptions database schema that stores exception data.
Procedure
- Ensure that you are logged in as a user that can run the db2 command and that has access to the scripts.
- If the database is remote from the services tier, copy the scripts to the database server host.
- 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
- If you are on a Linux® or UNIX operating system, source the
- 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
- 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
- Connect to the database with the exceptions database user
so the user owns the objects:
where DBNAME is the name of the database, DBUSER is the exceptions database repository user, and password is the user's password.db2 connect to DBNAME user DBUSER using password
- Create the tables:
db2 -tf esdb_table_creation.sql
- Test the connection with the following command:
On Linux or UNIX:
On Windows:RepositoryAdmin.sh -tc -rn ESDB -cn ESDB
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.