Plans for recovery of indexes
You can use the REBUILD INDEX utility or the RECOVER utility to recover Db2 indexes to currency.
The REBUILD INDEX utility reconstructs the indexes by reading the appropriate rows in the table space, extracting the index keys, sorting the keys, and then loading the index keys into the index. The RECOVER utility recovers indexes by restoring an image copy or system-level backup and then applying the log. It can also recover indexes to a prior point in time.
You can use the REBUILD INDEX utility to recover any index, and you do not need to prepare image copies or system-level backups of those indexes.
To use the RECOVER utility to recover indexes, you must include the following actions in your normal database operation:
- Create or alter indexes by using the SQL statement ALTER INDEX with the option COPY YES before you backup and recover them using image copies or system-level backups.
- Create image copies of all indexes that you plan to recover or take system-level backups by using the BACKUP SYSTEM utility.
The COPY utility makes full image copies or concurrent copies of indexes. Incremental copies of indexes are not supported. If full image copies of the index are taken at timely intervals, recovering a large index might be faster than rebuilding the index.