DB2 Version 9.7 for Linux, UNIX, and Windows

Performing a redirected restore using an automatically generated script

When you perform a redirected restore operation, you need to specify the locations of physical containers stored in the backup image and provide the complete set of containers for each table space that will be altered. Use the following procedure to generate a redirected restore script based on an existing backup image, modify the generated script, then run the script to perform the redirected restore.

About this task

To perform a redirected restore using a script:

Before you begin

You can perform a redirected restore only if the database has been previously backed up using the DB2® backup utility.

Procedure

  1. Use the restore utility to generate a redirected restore script. The restore utility can be invoked through the command line processor (CLP) or the db2Restore application programming interface (API). The following is an example of the RESTORE DATABASE command with the REDIRECT option and the GENERATE SCRIPT option:
       db2 restore db test from /home/jseifert/backups taken at 20050304090733 
             redirect generate script test_node0000.clp
    This creates a redirected restore script on the client called test_node0000.clp.
  2. Open the redirected restore script in a text editor to make any modifications that are required. You can modify:
    • Restore options
    • Automatic storage paths
    • Container layout and paths
  3. Run the modified redirected restore script. For example:
       db2 -tvf test_node0000.clp