Recovering a table space or index space

Start of changeFL 100 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 and space-level recovery from data set-level copies is not supported for that object, you must recover at the data set or partition level. End of change

Start of changeFL 100 For UTSs, partitioned indexes over UTSs, or LOB table spaces whose base table resides in a UTS, you can use the RECOVER utility to recover the entire table space or index space, or to recover individual partitions and data sets. For objects that are not UTSs or related to a UTS, if image copies are taken at the data set level, RECOVER must be run at the data set level. End of change

Start of changeFor all object types, 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.End of change

Start of changeFL 100 If image copies are taken at the partition level and you want to recover the whole table space, index space, or index, specify DSNUM ALL (either explicitly or as the default) for any object type for which space-level recovery from data set-level copies is supported. (See DSNUM ALL.) Alternatively, specify each partition in a DSNUM clause or use a LISTDEF list with PARTLEVEL n to specify all partitions or a subset of partitions.End of change

Start of changeFL 100 If image copies are taken at the data set level for nonpartitioned objects for which space-level recovery from data set-level copies is not supported, recover all of the data sets by using the DSNUMn option in the RECOVER statement to identify each data set. End of change

Start of changeFL 100 When image copies are taken at the data set or partition level for objects on which space-level recovery is not supported 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.End of change

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

RECOVER TABLESPACE DSN8D13A.DSN8S13D

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 DSN8D13A.DSN8S13E, and recover the table space DSN8D13A.DSN8S13D to the quiesce point (RBA X'000007425468').

RECOVER TABLESPACE DSN8D13A.DSN8S13E DSNUM 2
        TABLESPACE DSN8D13A.DSN8S13D
        TORBA X'000007425468'

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

RECOVER PARALLEL (4)
		  TABLESPACE DSN8D13A.DSN8S13E DSNUM 1
        TABLESPACE DSN8D13A.DSN8S13E DSNUM 2
        TABLESPACE DSN8D13A.DSN8S13E DSNUM 3
        TABLESPACE DSN8D13A.DSN8S13E 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.