HCL Workload Automation, Version 9.4

Running DB2 maintenance manually

This section describes how to perform the DB2® maintenance process on demand, instead of waiting for DB2 to do it according to its automatic maintenance policy. The process is run by the tool dbrunstats which you can run whenever you need to, without stopping DB2 or interrupting its processing.

To run this tool, follow this procedure:
  1. Locate the DB2 tools: see Locating the DB2 tools.
  2. Check that the user who is going to run the procedure has the appropriate rights (see User permissions for running the DB2 tools)
  3. 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, ProgramsIBM DB2Command Line ToolsCommand Window
  4. Check that the command shell is correctly initialized by issuing the command db2, and checking that the command is recognized.
  5. Issue the command quit to leave the DB2 Processor mode.
  6. From within the shell, change to the directory <TWA_home>/TWS/dbtools7db27scripts for master domain managers, or to the directory <TWA_home>/TDWB/dbtools7db27scripts for dynamic domain managers.
  7. Run the script:
    UNIX
    dbrunstats.sh database [user [password]]
    Windows
    dbrunstats database [user [password]]
    where:
    database
    The name of the database:
    • If you are running this from the computer where the DB2 server is installed, the installed default name is TWS. Supply this value unless you have changed it.
    • If you are running this from the computer where the DB2 client is installed, the installed default name is TWS_DB. 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. At the end (it is not particularly time-consuming) the database performance parameters have been reset to maximize performance.