DELETE subcommand syntax options
The following figure shows the DELETE subcommand syntax options and description.
DELETE subcommand option description
You can repeat the DELETE subcommand within the same MODIFY statement. However, you cannot mix it with INSERT, UPDATE, or VERIFY subcommands in the same MODIFY statement.
Use DELETE to remove records from the SYSCOPY or BMCXCOPY table using the options described in this section. Deletions are subject to the following rules.
- If DELETE would create an association between incremental copies and a different full copy, DELETE is not allowed and the return code is 8.
- Unless you specify NOCOPYPEND, COPY-pending status is set after any DELETE operation if the space is not recoverable to the current state.
- Unless you specify NOCOPYPEND, COPY-pending status is set if no copy entries remain in SYSCOPY and at least one row was deleted.
- Unless you specify NOCOPYPEND, COPY-pending status is set if no copy entries exist after an unrecoverable event, such as a REORG LOG NO or a LOAD LOG NO, for the current site type.
- Primary copy entries cannot be deleted unless the corresponding backup entry is also deleted.
- For compatibility with the Db2 MODIFY RECOVERY utility, DSNUM ALL matches any DSNUM in SYSCOPY or BMCXCOPY.
- DSNUM integer matches only rows with DSNUM integer in the space specification.
- Explicit deletions of utility events (except ICTYPE F, I, or Q) are not allowed.
- DELETE is not allowed if it removes an unrecoverable event, such as a REORG LOG NO, and a copy is registered between it and the next unrecoverable event.
Option | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AGE(integer) | DELETE AGE provides compatibility with the Db2 MODIFY RECOVERY utility and allows you to specify age as a criteria for the deletion of SYSCOPY, BMCXCOPY, and SYSLGRNX rows. DELETE AGE deletes all SYSCOPY, BMCXCOPY, and SYSLGRNX rows that are older than specified number of days. SYSLGRNX rows that meet the age deletion criteria specified will be deleted even if no SYSCOPY rows are deleted. integer is the number of days, and can range from 0 to 32767. Rows that are created today are AGE(0), rows that were created yesterday are AGE(1), and so on. If you specify DELETE AGE(1), you are requesting that BMC AMI Copy delete yesterday’s copies, but keep copies for today. Days are the only consideration for AGE. Hours, minutes, and seconds are not considered. (*) deletes all rows, regardless of their age. | ||||||||||||||
AND | AND is a connector option in your deletion criteria. | ||||||||||||||
Column condition list | With DELETE, optionally use the keyword WHERE and a list of SYSCOPY or BMCXCOPY column conditions to specify the deletion criteria. The list specifies the criteria to be used for each column in determining the limits of the deletion. For information about the Column condition list syntax diagram, see MODIFY command syntax diagram. | ||||||||||||||
DATE(integer) | DELETE DATE provides compatibility with the Db2 MODIFY RECOVERY utility and allows you to specify a date as a criteria for the deletion of SYSCOPY or BMCXCOPY rows:
| ||||||||||||||
DSNOTFOUND | With DELETE, optionally use the keywords WHERE DSNOTFOUND to tell MODIFY to delete image copy rows when a cataloged image copy is not found in the ICF catalog. You can use WHERE DSNOTFOUND with DELETE AGE to cleanup up SYSCOPY or BMCXCOPY in a single run as shown in the following examples. | ||||||||||||||
ICFDELETE | When you use DELETE, you can optionally use ICFDELETE to indicate whether to delete information from the ICF catalog. ICFDELETE is applicable only for cataloged image copies. Values of ICFDELETE
| ||||||||||||||
MAXCOPIES(integer) | DELETE MAXCOPIES provides an alternative method for SYSCOPY or BMCXCOPY cleanup by specifying the number of copy entries of any type to be retained in SYSCOPY or BMCXCOPY.
This count is for image copy entries. When the point to begin deleting is found, all SYSCOPY rows of all types for that space are deleted. For table spaces, if incremental copies are orphaned, a message and RC=4 are returned and COPY-pending status is set. Example DELETE MAXCOPIES(3) | ||||||||||||||
MAXFULLCOPIES(integer) | DELETE MAXFULLCOPIES provides an alternative method of SYSCOPY or BMCXCOPY cleanup. You can specify the number of full copy entries to be retained in SYSCOPY or BMCXCOPY.
This count is for full image copy entries. When the point to begin deleting is found, all SYSCOPY rows for all full copies for that space are deleted. Example DELETE MAXFULLCOPIES(3) | ||||||||||||||
MAXRECDAYS(integer) | DELETE MAXRECDAYS provides an alternative method of SYSCOPY or BMCXCOPY cleanup. You can specify the number of whole calendar days that you want to ensure recoverability, and BMC AMI Copy retains that information in SYSCOPY or BMCXCOPY. BMC AMI Copy deletes the SYSCOPY or BMCXCOPY rows that are not needed. Valid values for integer, which represents days, are 0, representing today, through 9999. (A value of 1 represents yesterday.) A day begins at midnight. For example, DELETE MAXRECDAYS(14) ensures recoverability for the last 14 days. MAXRECDAYS operates independently of other WHERE clauses. BMC AMI Copy finds the most recent full copy that is more than integer days old and deletes rows with a lower START_RBA. This processing alleviates problems with invalid associations or orphaned incremental copies. If BMC AMI Copy does not find all the information that it needs to process a MAXRECDAYS specification, it issues the following message: BMC180122I RECOVERY CANNOT BE ASSURED FOR MAXRECDAYS(numberOfDays) reasonForMessage The following table shows values for reasonForMessage and an explanation.
Example DELETE MAXRECDAYS(3) | ||||||||||||||
MAXSNAPS | DELETE MAXSNAPS provides an alternative method of SYSCOPY or BMCXCOPY cleanup. You can specify the number of Snapshot Copies and FlashCopies ('snaps') to retain by DSNUM. When the specified DSNUM limit is reached, any subsequent 'snap' row is deleted. A 'snap' row is any row containing DSSNAP or FLASH COPY. When you select DELETE MAXSNAPS, the BMCXCOPY and SYSCOPY rows are merged in descending order from latest to oldest based on their TIMESTAMP values. Unlike MAXCOPIES, which marks all subsequent rows for deletion, MAXSNAPS marks only subsequent 'snap' rows for deletion. Example DELETE MAXSNAPS(3) | ||||||||||||||
NOCOPYPEND | Specify NOCOPYPEND to indicate that you do not want to have COPY-pending status set after the deletions are processed. When you use the NOCOPYPEND option with a version of Db2 that has a versioning feature, old version numbers will not be freed. If you need to reuse the version numbers, you will have to run the MODIFY command without the NOCOPYPEND option. The NOCOPYPEND option prevents the performance of dropped-table cleanup on the database descriptor (DBD). Oldest-version and DBD cleanup are triggered only when all SYSCOPY rows are removed by the DELETE command process. | ||||||||||||||
OR | OR is a connector option in your deletion criteria. | ||||||||||||||
SYSLGRNG or SYSLGRNX | When you use DELETE, optionally specify SYSLGRNG or SYSLGRNX to indicate whether the specified table should be cleaned up. Values of SYSLGRNG or SYSLGRNX
| ||||||||||||||
WHERE | Optional clause following DELETE. |
Related topics