Regular backups and data checks
Scheduling backups and data checks on a regular basis is important. Your site must have a schedule in place to periodically check data for damage and consistency. You must also check storage structures for efficient use, and gather information to tune your Db2 subsystem for optimal performance.
Specifically, schedule the following activities:
- Take frequent backups to prepare for potential recovery situations. You must regularly take full or incremental image copies of Db2 data structures and Db2 subsystem structures.
- Use the CHECK utility periodically or after a conditional
restart or recovery to ensure data consistency and to ensure
that data is not damaged. A conditional restart lets you skip a portion
of log processing during Db2 restart.
- The CHECK DATA utility checks table spaces for violations
of referential and check constraints and reports that information.
You must run CHECK DATA after a conditional restart or a point-in-time
recovery on all table spaces in which parent and dependent tables
might not be synchronized. You can also run CHECK DATA to:
- Check the consistency between a LOB table space or XML table space and its base table space.
- Check the validity of the contents of an XML table space.
- The CHECK INDEX utility tests whether indexes are consistent with the data that they index. You must run CHECK INDEX after a conditional restart or a point-in-time recovery on all table spaces with indexes that might not be consistent with the data. You must also use CHECK INDEX before running CHECK DATA to ensure that the indexes that CHECK DATA uses are valid.
- The CHECK DATA utility checks table spaces for violations
of referential and check constraints and reports that information.
You must run CHECK DATA after a conditional restart or a point-in-time
recovery on all table spaces in which parent and dependent tables
might not be synchronized. You can also run CHECK DATA to:
- Run the REORG utility when data needs to be organized and balanced in index spaces and table spaces.
- Use the RUNSTATS utility to gather statistics about Db2 objects. Db2 uses these statistics to select the most efficient access path to data.