Maintaining the DB2 database
To ensure that the DB2® database works properly, you need to regularly back up your data and perform maintenance actions.
About this task
The configuration of DB2® has a significant impact on performance. You should perform some standard actions to administer the database correctly. If you have DB2® administration professionals, they can monitor the DB2® health and performance. In other cases, you should follow the procedures that are described in this topic to keep your database healthy.
Procedure
- Perform regular backups of the
data that is stored in the database. It is advisable to back up the
database before updating the software catalog or upgrading the server
to facilitate recovery in case of failure.
The backup is created in the current working directory, and the file name contains the instance name and time stamp of the backup procedure (for example: TLMA.0.db2inst1.NODE0000.CATN0000.20101105000715.001).
For more information about database backup strategies, see: Developing a backup and recovery strategy.
- Reorganize the table to match the index and to reclaim
space:
- Keep the statistics up-to-date. By default, DB2® statistics are run automatically. If this
option is disabled, you must manually run the following commands:
What to do next
db2advis
). It helps in finding new
indexes that can improve the database performance. The Design Advisor
uses the output from the DB2® monitors
to suggest the creation of new indexes. The suggestions are based
on the queries that are found in monitors. For more information about
Design Advisor, consult the DB2® documentation: