Recovering a table space or index space

Each table space that is involved is unavailable for most other applications until recovery is complete. If you make image copies by table space, you can recover the entire table space, or you can recover a data set or partition from the table space. If you make image copies separately by partition or data set, you must recover at the data set or partition level.

If image copies are taken at the data set level, RECOVER must be run at the data set level.

If you took FlashCopy® image copies at the table space level (by specifying the DSNUM ALL option in the COPY statement), you do not have to recover all of the data sets individually. Even though SYSIBM.SYSCOPY contains records for each partition or piece of the FlashCopy image copy data set, you can recover the entire table space as one object in the RECOVER statement. This recovery is possible, because SYSIBM.SYSCOPY also contains a record to indicate that the FlashCopy image copy was taken at the table space level. Alternatively, you can recover each of the data sets individually.

If image copies are taken at the partition level and you want to recover the whole table space, index space, or index, recover all of the partitions in one or more RECOVER utility invocations. A LISTDEF list with PARTLEVEL n may be used to specify all partitions or a subset of partitions.

If image copies are taken at the data set level for nonpartitioned objects, recover all of the data sets by using the DSNUM n option in the RECOVER statement to identify each data set.

When image copies are taken at the data set or partition level and recovery is attempted at the table space, index space or index level with the DSNUM ALL option or by using a LISTDEF list without the PARTLEVEL option, Db2 returns error message DSNU512I.

The following RECOVER statement specifies that the utility is to recover table space DSN8S12D in database DSN8D12A:

RECOVER TABLESPACE DSN8D12A.DSN8S12D

To recover multiple table spaces, create a list of table spaces that are to be recovered; repeat the TABLESPACE keyword before each specified table space. The following RECOVER statement specifies that the utility is to recover partition 2 of the partitioned table space DSN8D12A.DSN8S12E, and recover the table space DSN8D12A.DSN8S12D to the quiesce point (RBA X'000007425468').

RECOVER TABLESPACE DSN8D12A.DSN8S12E DSNUM 2
        TABLESPACE DSN8D12A.DSN8S12D
        TORBA X'000007425468'

The following example shows the RECOVER statement for recovering four data sets in database DSN8D12A, table space DSN8S12E:

RECOVER PARALLEL (4)
		  TABLESPACE DSN8D12A.DSN8S12E DSNUM 1
        TABLESPACE DSN8D12A.DSN8S12E DSNUM 2
        TABLESPACE DSN8D12A.DSN8S12E DSNUM 3
        TABLESPACE DSN8D12A.DSN8S12E DSNUM 4

Each of the 4 partitions will be restored in parallel. You can also schedule the recovery of these data sets to run in four separate jobs.

If a table space or data set is in the COPY-pending status, recovering it might not be possible.