Reorganizing the DB2® database

About this task

Using this tool, the database 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:
  1. Stop WebSphere Application Server Liberty Base and appservman by running the following command:
    conman "stopappserver;wait"
    See Starting and stopping the application server and appservman for full details.
  2. Back up the HCL Workload Automation database. Follow the instructions in the database vendor documentation, as appropriate.
  3. Check that the user who is going to run the procedure has the appropriate rights (see User permissions for running the DB2 tools)
  4. On the DB2 server where you copied the script, open a DB2® shell, as follows:
    UNIX
    Follow these steps:
    1. Issue the command su - db2inst1, or change to the subdirectory sqllib of the home directory of the owner of the DB2® instance (by default db2inst1)
    2. Launch the command . ./db2profile
    Windows
    Select from the Start menu, Programs →; IBM DB2 →; Command Line Tools →; Command Window
  5. Check that the command shell is correctly initialized by issuing the command db2, and checking that the command is recognized.
  6. Issue the command quit to leave the DB2® Processor mode.
  7. From within the shell, browse to the directory where you copied the script.
  8. 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. Supply this value unless you have changed it.
    user
    The DB2® administration user. If this is omitted, the ID of the user running the command will be used.
    password
    The password of the DB2® administration user. If this is omitted, it will be requested interactively.

    The script runs, giving you various messages denoting its progress and successful conclusion.

  9. Restart WebSphere Application Server Liberty Base and appservman by running the following command:
    conman "startappserver;wait"
    See Starting and stopping the application server and appservman for full details.