Create DB2 tables for schedulers
Before you begin
This task requires you to configure a database and make it available. See the "Creating DB2 databases for schedulers" topic for more information.
Overview
This topic describes how to create tables for scheduler on DB2 databases, using data definition language (DDL) or structured query language (SQL) files.
Procedure
- Open a DB2 command-line window.
- Verify that you have administrator rights for the database system.
- Create the table space and schema.
- Analyze the results of your experiences during development and system testing. The size of your database depends on many factors. 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.
- Using a text editor, edit the following scripts according to the instruction at the top of each file.
Note: When setting the table prefix, capitalize all characters.
%WAS_HOME%\Scheduler\createTablespaceDB2.ddl, %WAS_HOME%\Scheduler\createSchemaDB2.ddl, %WAS_HOME%\Scheduler\dropSchemaDB2.ddl, and %WAS_HOME%\Scheduler\dropTablespaceDB2.ddl.- Verify that you are attached to the correct instance. Check the environment variable DB2INSTANCE.
- To connect to the database, scheddb, for example, and enter the command:
db2 connect to scheddb- Create the table space. Enter the following command
Verify that the script output contains no errors. If there were any errors, one can drop the table space using the following scriptdb2 -tf createTablespaceDB2.ddldropTablespaceDB2.ddl- To create the schema (tables and indices), in the DB2 command line processor, enter the command db2 -tf createSchemaDB2.ddl. Verify that the script output contains no errors. If there were any errors, use the following file to drop the schema
dropSchemaDB2.ddl- Verify that the DB2_RR_TO_RS DB2 flag is set to YES to avoid deadlocks. Restart the DB2 instance to activate the change, if needed.
Result
The DB2 tables and schema for the scheduler exist.
Related Tasks
Creating DB2 databases for schedulers
See Also
DB2 tuning parameters
Vendor-specific data sources minimum required settings