To enable a DB2® database to optimize queries and find
free space, you can update the database statistics by running the runstats script.
About this task
Updating DB2 database
statistics is recommended on a regular basis, and especially under
any of the following circumstances:
- Events have been deleted from the database, using either the event
deletion interfaces of the event service or the rapid event purge
utility of the default data store plug-in
- A large number of events have been inserted into the database
- Tables have been reorganized using the reorg script
- Indexes have been added or removed from a table
The runstats script is located in the profile_root/event/node_name/server_name or cluster_name/dbscripts/db2
directory.
Procedure
To update
the database statistics, run runstats command: The parameters are as follows:
- db_user
- The database user ID to use. This parameter is required.
- db_password
- The database password. This parameter is optional; if you do not
specify the password on the command line, the DB2 database prompts you for it.