Reorganizing the Db2 database
About this task
Using this script, Db2 physically reorganizes the data tables and indexes, optimizing disk space usage and ease of data access. The process is time-consuming, requires that the database is backed up, and that HCL Workload Automation is stopped. However, at the end you have a database that is completely reorganized.
To reorganize the database, follow this procedure:
- Copy the db2 folder to the database server. This folder contains the scripts and the related .sql files.
- Stop WebSphere Application Server
Liberty and
appservman by running the following command:
See Starting and stopping the application server and appservman for full details.conman "stopappserver;wait" - Back up the HCL Workload Automation database. Follow the instructions in the Db2 documentation, as appropriate.
- Check that the user who is going to run the procedure has the appropriate rights:
- Database administrator permissions
- Full access to and control of the HCL Workload Automation or Dynamic Workload Console installation directory
- On the database server where you copied the script, open a command shell.
- From within the shell, browse to the directory where you copied the script.
- Run the script:
UNIX™-
dbreorg.sh database [user [password]]
Windows™-
dbreorg database [user [password]]
where:- database
- The name of the database. The default name is TWS.
- user
- The database administration user. If this is omitted, the ID of the user running the command is used.
- password
- The password of the database administration user. If this is omitted, it is requested interactively.
The script runs, giving you various messages denoting its progress and successful conclusion.
- Restart WebSphere Application Server
Liberty and
appservman by running the following command:
See Starting and stopping the application server and appservman for full details.conman "startappserver;wait"