Sets the table space container during a redirected restore operation.
A redirected restore is a restore where the storage (table space containers or storage group paths) for the restored database is different from the storage for the source database at the time the backup was done. Using this command you can add, change, or remove table space containers during a redirected restore operation. If, for example, one or more containers become inaccessible for any reason, the restore fails if it is not redirected to different table space containers.
This command can be used to convert existing regular or large database managed table spaces to use automatic storage. It can also be used to re-stripe existing automatic storage table spaces more evenly over the storage paths available to the database.
Database
>>-SET TABLESPACE CONTAINERS FOR--tablespace-id-----------------> >--+----------------------------------------------+--USING------> | .-REPLAY-. | '-+-IGNORE-+--ROLLFORWARD CONTAINER OPERATIONS-' .-,------------------------. V | >--+-(----PATH--"container-string"-+--)------------------------+->< | .-,-----------------------------------------------. | | V | | +-(----+-FILE---+--"container-string"--number-of-pages-+--)-+ | '-DEVICE-' | '-AUTOMATIC STORAGE-----------------------------------------'
For a file container, the string must be an absolute or relative file name. If the file name is not absolute, it is relative to the database directory.
For a device container, the string must be a device name. The device must already exist.
This option is not supported for system managed table spaces.
This is the only USING clause that can be specified in a DB2® pureScale® environment.
See the example in RESTORE DATABASE.
A backup of a database, or one or more table spaces, keeps a record of all the table space containers in use by the table spaces being backed up. During a restore, all containers listed in the backup are checked to see if they currently exist and are accessible. If one or more of the containers is inaccessible for any reason, the restore will fail. In order to allow a restore in such a case, the redirecting of table space containers is supported during the restore. This support includes adding, changing, or removing of table space containers. It is this command that allows the user to add, change or remove those containers.
The IGNORE/REPLAY ROLLFORWARD CONTAINER OPERATIONS option is ignored when specified with the USING AUTOMATIC STORAGE option.
A redirected restore of a table space in a multi-partition environment using the USING AUTOMATIC STORAGE option of the SET TABLESPACE CONTAINERS command will only convert the table space to automatic storage on the partition being restored. It will not redefine the containers on any other database partition.
By not redefining the containers on other database partitions, the definition of the table space differs on each partition. Later, when adding a database partition, use the ADD DBPARTITIONNUM command with the LIKE DBPARTITIONNUM option. Depending on the database partition chosen in this option, the new database partition will have either the table space defined with automatic storage or the table space defined without automatic storage. To remove both the inconsistency in the definitions of the table spaces and the need to decide between the definitions each time a new database partition is added, ensure that the table space definition is the same on all database partitions. For example, if all of the database partitions were subject to a redirected restore followed by using the USING AUTOMATIC STORAGE option of the SET TABLESPACE CONTAINERS command, then the table space will be converted to automatic storage on all the database partitions. Adding another database partition later will have the same definition for the table space as that found on the other database partitions.
In a partitioned database environment, if a single table space had been redirected on only a subset of the database partitions using the SET TABLESPACE CONTAINERS command to alter storage types, then a single table space can be defined as DMS on some database partitions, automatic storage on other database partitions, and a combination of DMS and automatic storage on yet another database partition.
Once you restore a table space, run a subsequent ALTER TABLESPACE statement to update the table space's storage group ID in the catalog views.