COPY

The COPY online utility creates copies of certain objects.

The COPY online utility creates up to five image copies, four sequential image copies, and one FlashCopy® image of any of the following objects:
  • Table space
  • Table space partition
  • Data set of a nonpartitioned table space
  • Index space
  • Index space partition

The two types of image copies are:

  1. A full image copy, which is a copy of all pages in a table space, partition, data set, or index space.
  2. An incremental image copy, which is a copy only of those data pages that have been modified since the last use of the COPY utility and system pages.

The RECOVER utility uses these copies when recovering a table space or index space to the most recent time or to a previous time. Copies can also be used by the MERGECOPY, COPYTOCOPY, and UNLOAD utilities.

You can copy a list of objects in parallel to improve performance. Specifying a list of objects along with the SHRLEVEL REFERENCE option creates a single recovery point for that list of objects. Specifying the PARALLEL keyword allows you to copy a list of objects in parallel, rather than serially.

To calculate the number of threads you need when you specify the PARALLEL keyword, use the formula (n * 2 + 1), where n is the number of objects that are to be processed in parallel, regardless of the total number of objects in the list. If you do not use the PARALLEL keyword, n is one and COPY uses three threads for a single-object COPY job.

Output

Output from the COPY utility consists of:

  • Start of changeUp to four sequential data sets containing the image copy and one FlashCopy image copy.End of change
  • Rows in the SYSIBM.SYSCOPY catalog table that describe the image copy data sets that are available to the RECOVER utility. Your installation is responsible for ensuring that these data sets are available if the RECOVER utility requests them.
  • If you specify the CHANGELIMIT option, a report on the change status of the table space.

The COPY-pending status is set off for table spaces if the copy was a full image copy. However, DB2® does not reset the COPY-pending status if you copy a single piece of a multi-piece linear data set. If you copy a single table space partition, DB2 resets the COPY-pending status only for the copied partition and not for the whole table space. DB2 resets the informational COPY-pending (ICOPY) status after you copy an index space or index. The COPY utility will reset ICOPY-pending status for not logged table spaces.

Authorization required

To execute this utility, you must use a privilege set that includes one of the following authorities:

  • IMAGCOPY privilege for the database
  • DBADM, DBCTRL, or DBMAINT authority for the database. If the object on which the utility operates is in an implicitly created database, DBADM authority on the implicitly created database or DSNDB04 is required.
  • Start of changeSystem DBADM authorityEnd of change
  • SYSCTRL or SYSADM authority

An ID with installation SYSOPR authority can also execute COPY, but only on a table space in the DSNDB01 or DSNDB06 database.

If the CONCURRENT option is specified, the user ID that invokes the COPY utility must have the authority to execute the DFSMSdss DUMP command.

Start of changeIf either the FLASHCOPY YES or FLASHCOPY CONSISTENT option is specified, the user ID that invokes the COPY utility must have the authority to execute the DFSMSdss COPY command.End of change

Execution phases of COPY

The COPY utility operates in these phases:

UTILINIT
Performs initialization and setup.
REPORT
Reports for CHANGELIMIT option.
COPY
Creates copies.

Start of changeIf FLASHCOPY YES or FLASHCOPY CONSISTENT is specified, then the FlashCopy image copies are created in this phase. If FLASHCOPY is not specified, then sequential format image copies are created.End of change

Start of changeSEQCOPYEnd of change
Start of changeCreates additional sequential format image copies from a FlashCopy image copy when either FLASHCOPY YES or CONSISTENT is specified. The utility execution includes this phase only when both FlashCopy image copies and sequential format image copies are requested.End of change
Start of changeLOGAPPLYEnd of change
Start of changeLog apply identifies the most recent checkpoint for each member. All objects that are being copied will be updated to the same logpoint in order to prepare for backout processing.

If COPY SHRLEVEL CHANGE FLASHCOPY CONSISTENT is specified, log apply applies the updates to the FlashCopy image copy to ensure that all activity is reflected up to the point of consistency.

End of change
Start of changeLOGCSREnd of change
Start of changeLog apply is called to do the current status rebuild.

If COPY SHRLEVEL CHANGE FLASHCOPY CONSISTENT is specified, the LOGCSR phase identifies any uncommitted work to back out from the FlashCopy image copy.

End of change
Start of changeLOGUNDOEnd of change
Start of changeUncommitted work is backed out from the image copy in order to make it consistent.

If COPY SHRLEVEL CHANGE FLASHCOPY CONSISTENT is specified, the LOGUNDO phase backs out uncommitted work from the FlashCopy image copy.

End of change
UTILTERM
Performs cleanup.