DB2 10.5 for Linux, UNIX, and Windows

Performing a redirected restore using an automatically generated script

When you perform a redirected restore operation, you must specify the locations of physical containers that are stored in the backup image and provide the complete set of containers for each table space that you are altering.

Before you begin

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

About this task

Procedure

To perform a redirected restore using a script:

  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 parameter and the GENERATE SCRIPT parameter:
       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