db2ckrst - Check incremental restore image sequence command
Queries the database history and generates a list of timestamps for the backup images that are required for an incremental restore. A simplified restore syntax for a manual incremental restore is also generated.
Authorization
None
Required connection
None
Command syntax
Command parameters
- -d database name
- Specifies the alias name for the database that will be restored.
- -t timestamp
- Specifies the timestamp for a backup image that will be incrementally restored.
- -r
- Specifies the type of restore that will be executed. The default is database. If tablespace is chosen and no table space names are given, the utility looks into the history entry of the specified image and uses the table space names listed to do the restore.
- -n tablespace name
- Specifies the name of one or more table spaces that will be restored. If a database restore type is selected and a list of table space names is specified, the utility will continue as a table space restore using the table space names given.
- -h | -u | -?
- Displays help information. When this option is specified, all other options are ignored, and only the help information is displayed.
Examples
db2ckrst -d mr -t 20001015193455 -r database
db2ckrst -d mr -t 20001015193455 -r tablespace
db2ckrst -d mr -t 20001015193455 -r tablespace -n tbsp1 tbsp2
> db2 backup db mr
Backup successful. The timestamp for this backup image is : 20001016001426
> db2 backup db mr incremental
Backup successful. The timestamp for this backup image is : 20001016001445
> db2ckrst -d mr -t 20001016001445
Suggested restore order of images using timestamp 20001016001445 for
database mr.
===================================================================
db2 restore db mr incremental taken at 20001016001445
db2 restore db mr incremental taken at 20001016001426
db2 restore db mr incremental taken at 20001016001445
===================================================================
> db2ckrst -d mr -t 20001016001445 -r tablespace -n userspace1
Suggested restore order of images using timestamp 20001016001445 for
database mr.
===================================================================
db2 restore db mr tablespace ( USERSPACE1 ) incremental taken at
20001016001445
db2 restore db mr tablespace ( USERSPACE1 ) incremental taken at
20001016001426
db2 restore db mr tablespace ( USERSPACE1 ) incremental taken at
20001016001445
===================================================================
Usage notes
The db2ckrst utility will not be enhanced for the rebuilding of a database. Due to the constraints of the history file, the utility will not be able to supply the correct list if several table spaces need to be restored from more than one image.
The database history must exist in order for this utility to be used. If the database history does not exist, specify the HISTORY FILE option in the RESTORE command before using this utility.
If the FORCE option of the PRUNE HISTORY command is used, you can delete entries that are required for automatic incremental restoration of databases. Manual restores will still work correctly. Use of this command can also prevent the db2ckrst utility from being able to correctly analyze the complete chain of required backup images. The default operation of the PRUNE HISTORY command prevents required entries from being deleted. It is recommended that you do not use the FORCE option of the PRUNE HISTORY command.
This utility should not be used as a replacement for keeping records of your backups.
