During a redirected restore operation, directory and file containers are automatically created if they do not already exist. The database manager does not automatically create device containers.
DB2 only supports adding, changing or removing table space containers of a DMS table space. For an SMS table space, redirected restore is the only method to modify the table space container configuration.
You can redefine table space containers by invoking the RESTORE DATABASE command and specifying the REDIRECT parameter, or by using the Restore Database wizard in the Control Center. The process for invoking a redirected restore of an incremental backup image is similar to the process for invoking a redirected restore of a non-incremental backup image. Issue the RESTORE DATABASE command with the REDIRECT option and specify the backup image that should be used for the incrementally restore of the database. Alternatively, you can generate a redirected restore script from a backup image, then you can modify the script as required. See Performing a redirected restore using an automatically generated script.
Container redirection provides considerable flexibility for managing table space containers. For example, even though adding containers to SMS table spaces is not supported, you could accomplish this by specifying an additional container when invoking a redirected restore operation.
Example 1
db2 restore db sample redirect without prompting
SQL1277W A redirected restore operation is being performed.
Table space configuration can now be viewed and table spaces that do not
use automatic storage can have their containers reconfigured.
DB20000I The RESTORE DATABASE command completed successfully.
db2 set tablespace containers for 2 using (path 'userspace1.0', path
'userspace1.1')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
db2 restore db sample continue
DB20000I The RESTORE DATABASE command completed successfully.
Example 2
db2 restore db mydb replace existing redirect
db2 set tablespace containers for 5 using
(file 'f:\ts3con1'20000, file 'f:\ts3con2'20000)
To
verify that the containers of the restored database are the ones specified
in this step, issue the LIST TABLESPACE CONTAINERS command for every
table space whose container locations are being redefined. db2 restore db mydb continue
This is the final step of the redirected restore operation.
db2 restore db mydb abort
Example 3
backup db mydb
Backup successful. The timestamp for this backup image is : <ts1>
backup db mydb incremental
Backup successful. The timestamp for this backup image is : <ts2>
db2 restore db mydb incremental taken at <ts2> replace existing redirect
db2 set tablespace containers for 5 using
(file 'f:\ts3con1'20000, file 'f:\ts3con2'20000)
To
verify that the containers of the restored database are the ones specified
in this step, issue the LIST TABLESPACE CONTAINERS command. db2 restore db mydb continue
db2 restore db mydb incremental taken at <ts1>
db2 restore db mydb incremental taken at <ts2>
This
is the final step of the redirected restore operation. db2 restore db mydb abort
db2 restore db mydb incremental abort
Example 4
db2 restore db mydb incremental automatic taken at <ts2>
replace existing redirect
db2 set tablespace containers for 5 using
(file 'f:\ts3con1'20000, file 'f:\ts3con2'20000)
To
verify that the containers of the restored database are the ones specified
in this step, issue the LIST TABLESPACE CONTAINERS command. db2 restore db mydb continue
This
is the final step of the redirected restore operation. db2 restore db mydb abort
db2 restore db mydb incremental abort