Limited supportBMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Copy for Db2 13.1.

DELETE subcommand syntax options


The following figure shows the DELETE subcommand syntax options and description.

GUID-FAF6F12A-9FBC-482A-A3CE-663028C1C9B3-low.png

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:

  • Use DELETE DATE(*) to specify all rows in SYSCOPY or BMCXCOPY.
  • Use DELETE DATE(integer) to select all rows inserted before the date you specify. The date must be in the format YYMMDD or YYYYMMDD and cannot have a value greater than the current date.

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.

Example

The following example deletes the image copy rows where the cataloged image copies are not found in the ICF catalog:

MODIFY TABLESPACE databaseName.tableSpaceName
DELETE WHERE DSNOTFOUND

The following example deletes rows that are more than 30 days old or image copy rows where cataloged image copies are not found in the ICF catalog.

MODIFY TABLESPACE databaseName.tableSpaceName
DELETE WHERE AGE(30)
OR DSNOTFOUND

The following example deletes rows that are more than 30 days old and that are image copy rows where cataloged image copies are not found in the ICF catalog.

MODIFY TABLESPACE databaseName.tableSpaceName
DELETE WHERE AGE(30)
AND DSNOTFOUND

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

Value

Description

ICFDELETE NO

ICFDELETE NO is the default and indicates no clean up of the ICF catalog should be done.

ICFDELETE YES

Specify ICFDELETE YES to delete the image copy entry from the ICF catalog as well as from SYSCOPY or BMCXCOPY. Data sets are deleted before rows from SYSCOPY or BMCXCOPY are deleted.

ICFDELETE DD ddname

IDCAMS delete commands are written to the file with the specified ddname. You can use this file as SYSIN for subsequent IDCAMS runs to delete the image copy files discovered in the MODIFY DELETE step. This can reduce the MODIFY run time and allows you to delete the files later at a convenient time.

Example

The following is an example of the JCL to copy and write IDCAMS commands to a file before deleting them:

//ICFDELET DD DSN=IDCAMS.ICFDELET,UNIT=SYSDA,
//     SPACE=(3200,(10,10)),
//     DISP=(NEW,CATLG),
//     DCB=(LRECL=80,BLKSIZE=3200,RECFM=FB)

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.

  • Use DELETE MAXCOPIES(0) to retain no copy entries, subject to other delete criteria.
  • Use DELETE MAXCOPIES(integer) to retain the integer most recent copy entries of any type in SYSCOPY or BMCXCOPY and delete the remainder. Valid values for integer are 1 through 65535.

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.

  • Use DELETE MAXFULLCOPIES(0) to retain no full copy entries, subject to other delete criteria.
  • Use DELETE MAXFULLCOPIES(integer) to retain the integer most recent full copy entries in SYSCOPY or BMCXCOPY and delete all previous copies (full or incremental).Valid values for integer are 1 through 65535.

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.

Reason for message

Explanation

NOT (3) DSNUM 1 COPIES LOCATED

If BMC AMI Copy found a DSNUM 1 copy before a DSNUM 0 copy, BMC AMI Copy requires three DSNUM 1 copies for evaluation.

DSNUM SERIES HAS GAPS IN NUMBERING

While examining the rows between the three DSNUM 1 entries (using the highest DSNUM seen), BMC AMI Copy does not allow any gaps in the sequence of numbers.

DSNUM SERIES DOES NOT AGREE WITH NUMPARTS AND GROWTH

The series of DSNUM integer copies must reflect DSNUM 1 through the highest DSNUM. (BMC AMI Copy considers partition by growth.)

FOUND EMBEDDED 'M' ROW

BMC AMI Copy found an 'M' row and stopped searching. BMC AMI Copy deletes the copies made prior to the M row. Recovery of the space is not assured based on MAXRECDAYS.

UNRECOVERABLE EVENT

Before finding sufficient copies to assure recoverability, BMC AMI Copy encountered an unrecoverable event.

NONE QUALIFY

BMC AMI Copy found no qualifying rows.

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.

Important

This can orphan incremental copies, resulting in an exception message.

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.

Important

Use this option with care. A space that normally would be placed in COPY-pending status is left with its status unchanged.

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

Value

Description

SYSLGRNG NO or SYSLGRNX NO

Specify SYSLGRNG NO or SYSLGRNX NO to indicate that no clean up of the SYSLGRNG or SYSLGRNX table is to be done.

SYSLGRNG YES or SYSLGRNX YES

(Default) SYSLGRNG YES or SYSLGRNX YES follows the following rules for clean up of the SYSLGRNG or SYSLGRNX table:

  • SYSLGRNG or SYSLGRNX is cleaned up only if contiguous rows are deleted from SYSCOPY and they include the row with the lowest START_RBA value.
  • Log ranges are deleted after SYSCOPY rows in a separate unit of recovery.
  • (SPE2005

    ) If the space is in UTRW status, deletion of SYSLGRNX rows is bypassed.

WHERE

Optional clause following DELETE.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*