Discarding SYSCOPY and SYSLGRNX records
Use the MODIFY utility to delete obsolete records from SYSIBM.SYSCOPY and SYSIBM.SYSLGRNX.
About this task
Procedure
To discard SYSCOPY and SYSLGRNX records:
- Complete the first three steps of the procedure that is
presented in Locating archive log data sets. In
the third step, note the date of the earliest image copy that you
intend to keep. Important: The earliest image copies and log data sets that you need for recovery to the present date are not necessarily the earliest ones that you want to keep. If you foresee resetting the Db2 subsystem to its status at any earlier date, you also need the image copies and log data sets that allow you to recover to that date.
If the most recent image copy of an object is damaged, the RECOVER utility seeks a backup copy. If no backup copy is available, or if the backup is lost or damaged, RECOVER uses a previous image copy. It continues searching until it finds an undamaged image copy or no more image copies exist. The process has important implications for keeping archive log data sets. At the very least, you need all log records since the most recent image copy; to protect against loss of data from damage to that copy, you need log records as far back as the earliest image copy that you keep.
- Run the MODIFY RECOVERY utility to clean up
obsolete entries in SYSIBM.SYSCOPY and SYSIBM.SYSLGRNX.
Pick one of the following MODIFY strategies, based on keyword options, that is consistent with your overall backup and recovery plan:
- DELETE DATE
- With the DELETE DATE keyword, you can specify date of the earliest entry you want to keep.
- DELETE AGE
- With the DELETE AGE keyword, you can specify the age of the earliest entry you want to keep.
- RETAIN LAST
- With the RETAIN LAST keyword, you can specify the number of image copy entries you want to keep.
- RETAIN GDGLIMIT
- If GDG data sets are used for your image copies, you can specify RETAIN GDGLIMIT keyword to keep the number of image copies matching your GDG definition.
- RETAIN LOGLIMIT
- With the RETAIN LOGLIMIT keyword, you can clean up all of the obsolete entries that are older than the oldest archive log in your BOOT STRAP DATA SET (BSDS).
For example, you could enter one of the following commands:
The DELETE DATE option removes records that were written earlier than the given date. You can also specify the DELETE AGE option to remove records that are older than a specified number of days or the DELETE RETAIN option to specify a minimum number of image copies to keep.
MODIFY RECOVERY TABLESPACE dbname.tsname DELETE DATE date
MODIFY RECOVERY TABLESPACE dbname.tsname RETAIN LAST( n )
The RETAIN LAST( n ) option keeps the n recent records and removes the older one.
You can delete SYSCOPY records for a single partition by naming it with the DSNUM keyword. That option does not delete SYSLGRNX records and does not delete SYSCOPY records that are later than the earliest point to which you can recover the entire table space. Thus, you can still recover by partition after that point.
The MODIFY utility discards SYSLGRNX records that meet the deletion criteria when the AGE or DATE options are specified, even if no SYSCOPY records were deleted.
You cannot run the MODIFY utility on a table space that is in RECOVER-pending status.
Even if you take system-level backups, use the MODIFY utility to delete obsolete records from SYSIBM.SYSCOPY and SYSIBM.SYSLGRNX. You do not need to delete the system-level backup information in the bootstrap data set (BSDS) because only the last 85 system-level backups are kept.