Loading...

Advanced Restore - DB2 iDataAgent

Table of Contents

Restoring and Recovering an Entire Database to the Source Host

You can restore an entire database after you deactivate the affected database. When you deactivate the database, all the db2 non administrative users will be disconnected. The system will deactivate the database if it is active. After the restore, the system automatically activates whatever database was deactivated by system or users. However, you need to connect the non administrative users manually after the restore operation.

Recovering a Database

By default, you can recover the database along with the restore operation. You cannot recover a partial database.

Use the following steps to recover the database per all the logs associated with the database:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.

    The Browse and Restore dialog box is displayed.

  3. On the Time Range tab, select Latest Backup and click View Content.
  4. Select the databases to restore, and then click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, select Recover DB check box.
  6. Click OK.

Recovering a Database to a Point- in-Time

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.

    The Browse and Restore dialog box is displayed.

  3. On the Time Range tab, select Latest Backup and click View Content.
  4. Select the databases to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, select Recover DB check box.
  6. Select To a Point-in-Time, and then enter the date and time.
  7. Click OK.

Restoring an Entire Database

Use the following steps to restore an entire DB2 database:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.

    The Browse and Restore dialog box is displayed.

  3. On the Time Range tab, select Latest Backup and click View Content.
  4. Select the databases to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the General tab, select the data to restore.
    1. Select the Restore Data check box.
    2. Select the Entire Database option.
  6. On the Recover Database tab, clear the Recover DB check box.
  7. On the Restore Arguments tab, in the Backup Images area, from the Available Images box, select the backup images to restore.
  8. Click OK.

Restoring an Entire Database to a Point-in-Time

Before You Begin

Verify that the DB2 archive log path and the DB2 retrieve path are empty.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. The Browse and Restore dialog box is displayed.

  4. On the Time Range tab, select the time range to use for the restore.
    1. Select Time Range.
    2. Select Absolute Time.
    3. Check the Start Time check box and enter the date and time.
    4. Check the End Time check box and enter the date and time.
    5. Click View Content.
  5. Select the databases to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  6. On the General tab, select the data to restore.
    1. Select the Restore Data check box.
    2. Select the Entire Database option.
  7. On the Recover Database tab, clear the Recover DB check box.
  8. On the Restore Arguments tab, in the Backup Images area, from the Available Images box, select the backup images to restore.
  9. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  10. On the Roll-forward tab, select To a Point in Time, and then enter the date and time.
  11. Click OK.

Redirecting a Restore to a Different DB2 Instance on the Source Host

You can redirect a restore to a different DB2 instance on the source host. When redirecting a restore to a different DB2 instance on the source host, ensure the following:

  • Configure the source DB2 instance, backup set and subclient on CommCell Console.
  • Configure the destination DB2 Instance on CommCell console.
  • Back up your subclient on the source instance.

Note: The SnapProtect software automatically creates the target DB2 database when it does not exist.

Use the following steps to redirect a restore to a different instance on the source host.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. The Browse and Restore dialog box is displayed.

  4. On the Time Range tab, select Latest Backup and click View Content.
  5. Select the databases to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  6. On the General tab, select the data to restore.
    1. Select the Restore Data check box and click the Entire Database option.
    2. Select the tablespaces from the Latest Database View list.
    3. Select the Destination Instance from the destination instance list to change the instance on the source host.
    4. To change the target database name and location, type the Target Database Name and enter the path in the Target Database Path box

      For a Windows client, the Target Database Path is with a drive letter.

    5. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  7. On the Redirect tab.:
    • Select Redirect All Table Spaces/Database to and type the path or click Browse for the path to redirect tablespaces/database.
    • Click OK.
  8. Click OK.

Redirecting a Restore to a New Database

You can redirect a restore to a different database on the source host and same instance.

When you redirect a restore to a different database on the source host and same instance, ensure the following:

  • Configure the source DB2 instance, backup set and subclient on CommCell console.
  • Back up your subclient on the source database.

Note: if you redirect a restore as part of the DB2 transaction log replication for standby database procedure, the standby database name (Restore Options dialog box, General tab, Target Database Name box) must be different than the production (source) database name.

Note: The SnapProtect software automatically creates the target DB2 database when it does not exist.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab, select a cycle of images from the Available Images.
  7. On the General tab, select the restore options.
    1. If this restore is for DB2 transaction log replication, clear the Restore Data check box, otherwise select the Restore Data check box and select Entire Database.
    2. Select the destination for the redirected restore from the Destination Computer list.
    3. In the Target Database Name, enter the target database name.
    4. In the Target Database path, type the location of the target database.
    5. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  8. Specify the storage path if you have an automatic database, or the redirect information if you have a non-automatic database.
    Database Type Procedure
    Automatic Database On the Storage Path tab:
    1. Select the Storage Paths check box.
    2. Select the existing Paths in the box and click Delete.
    3. Click Browse to navigate to the target database paths, or click Add Paths to manually enter them.
    Non-Automatic Databases On the Redirect tab:
    1. Select the Redirect All Table Spaces/Database to check box
    2. Enter the path to redirect the tablespaces and database.
  9. Click OK to close the Advanced Restore Options dialog box.
  10. Click OK to close the Restore Options dialog box.

Restoring and Recovering an Entire Database to a New Host

When restoring the databases to a new client, ensure the following:

  • The operating system on the destination client must be the same as that in the source client.
  • The DB2 application on the destination client should be the same (or later) version as that in the source client.
  • As a DB2 user, you should have sufficient rights to restore the database. See Configuring User Accounts for more information.
  • Install the DB2 Data Agent on both the source and client destination.
  • The destination client should be installed on same CommServe, and the destination DB2 instance should be configured on the CommCell console.
  • Install the DB2 iDataAgent on both the source client and the destination client.
  • Create (Discover) an instance of DB2 on the CommCell Console for both the source client and the destination client.
  • Run a DB2 database backup on the source client.
  • When the Target storage paths are NOT specified (Step 6d), the tablespace path is the target_db_path+ instance_name+database_name. The tablespaces and online log paths are placed here.

Note: The SnapProtect software automatically creates the target DB2 database when it does not exist.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab and clear the Recover DB check box.
  6. On the Restore Arguments, in the Backup Images area, select the latest cycle of backup images.
  7. On the General tab, select the destination.
    1. Select the destination client name from the Destination Computer list.
    2. Select the instance name from the Destination Instance list.
    3. Type the database name in the Target Database Name box.
    4. In the Target Database path, type the location of the target database.
  8. Click OK.

Restoring an Entire Database to a New Host with a Later DB2 Version

Note: The SnapProtect software automatically creates the target DB2 database when it does not exist.

Before You Begin

Perform an offline backup of the source database.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.

    The Browse and Restore dialog box appears.

  3. On the Time Range tab, select Latest Backup, and then click View Content.
  4. Optional: Use non-default browse and restore options. See Browse and Restore.
  5. From the Browse window, select the data to restore in the right pane, and then click Recover All Selected.

    The Restore Options dialog box appears.

  6. On the General tab, select the following options:
    1. From the Destination Computer list, select the destination client name.
    2. From the Destination Instance list, select the destination instance.
    3. To change the target database name and location, in the Target Database Path box, type the new path.

      For Windows clients, the target database path is the drive letter (for example, E:\).

    4. In the Target Database path, type the location of the target database.
    5. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  7. Specify the storage path if you have an automatic database, or the redirect information if you have a non-automatic database.
    Database Type Procedure
    Automatic Database On the Storage Path tab:
    1. Select the Storage Paths check box.
    2. Select the existing Paths in the box and click Delete.
    3. Click Browse to navigate to the target database paths, or click Add Paths to manually enter them.
    Non-Automatic Databases On the Redirect tab:
    1. Select the Redirect All Table Spaces/Database to check box
    2. Enter the path to redirect the tablespaces and database.
  8. Click OK.
  9. Click OK.

Restoring to a New Host

You can rename and redirect one or more table spaces or table space containers to a different destination on the same or on different (cross-machine) host. The DB2 automatic storage database contains the automatic storage tablespaces, or a mix of both the automatic and non-automatic storage tablespaces. The DB2 non-automatic storage database contains the non-automatic storage tablespaces only.

When restoring to a new host, ensure the following:

  • Configure the source DB2 instance, backup set and subclient on CommCell console.
  • Configure the destination DB2 Instance on CommCell console.
  • Back up your subclient on Source client.

Note: The SnapProtect software automatically creates the target DB2 database when it does not exist.

Use the following steps to redirect a restore to a new host:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Optional: Use non-default Browse and Restore options. See Browse and Restore.
  5. From the Browse window, select the data to restore in the right pane and click Recover All Selected.

    The Restore Options dialog box is displayed.

  6. On the General tab.
    1. Select the Restore Data check box.
    2. Select the Entire Database option.
    3. Select the destination client name from the Destination Computer list.
    4. If you choose to change the instance, select the Destination Instance from the destination instance list.
    5. To change the target database name and location, type the Target Database Name. Enter the location.

      For Windows client, the Target Database Path will be with a drive letter.

    6. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  7. Specify the storage path if you have an automatic database, or the redirect information if you have a non-automatic database.
    Database Type Procedure
    Automatic Database On the Storage Path tab:
    1. Select the Storage Paths check box.
    2. Select the existing Paths in the box and click Delete.
    3. Click Browse to navigate to the target database paths, or click Add Paths to manually enter them.
    Non-Automatic Databases On the Redirect tab:
    1. Select the Redirect All Table Spaces/Database to check box
    2. Enter the path to redirect the tablespaces and database.

      Note: The path must contain 'SQL0001.

  8. Click OK to close the Advanced Restore Options dialog box.
  9. Click OK to close the Restore Options dialog box.

Redirecting Specific Table Space Containers for Non-Automatic Storage Tablespaces

Note: You can only modify the page size when the container path is a new location.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Optional: Use non-default Browse and Restore options. See Browse and Restore.
  5. From the Browse window, select the data to restore in the right pane and click Recover All Selected.

    The Restore Options dialog box is displayed.

  6. On the Recover Database tab, clear the Recover DB check box.
  7. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the non-automatic storage tablespaces from the available images.
  8. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  9. On the Redirect tab.
    1. Select the Redirect Table Space Containers check box.
    2. From the Table Space box, select the required table space to be redirected, the associated container name is displayed in the Container Name box.
    3. To redirect a tablespace, select the Container name and then click Edit.
    4. In the Editing Container Name for Dataspace dialog box, specify a new path. Add the container name after the path in the text box of Edit Container Name of Table Space box. Select the Container Type from the list.
    5. Click OK.
  10. Click OK to close the Advanced Restore Options dialog box.
  11. Click OK to close the Restore Options dialog box.

Redirecting Automatic and Non-Automatic Storage Tablespaces on a Mixed Database

If a mix of both the automatic and non-automatic storage tablespaces exist in your DB2 automatic storage database, you can redirect both automatic and non-automatic tablespaces or tablespace containers to a new destination computer.

Use the following steps to change the storage paths for automatic table spaces and redirect the automatic table spaces:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Optional: Use non-default Browse and Restore options. See Browse and Restore.
  5. From the Browse window, select the data to restore in the right pane and click Recover All Selected.

    The Restore Options dialog box is displayed.

  6. On the Recover Database tab, clear the Recover DB check box.
  7. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the automatic storage tablespaces from the available images.
  8. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  9. Specify the storage path if you have an automatic database, or the redirect information if you have a non-automatic database.
    Database Type Procedure
    Automatic Database On the Storage Path tab:
    1. Select the Storage Paths check box.
    2. Select the existing Paths in the box and click Delete.
    3. Click Browse to navigate to the target database paths, or click Add Paths to manually enter them.
    Non-Automatic Databases On the Redirect tab:
    1. Select the Redirect All Table Spaces/Database to check box
    2. Enter the path to redirect the tablespaces and database.

      Note: The path must contain 'SQL0001.

    3. To redirect a tablespace, select the Container name and click Edit.
    4. In the Editing Container Name for Dataspace dialog box, specify a new path. Add the container name after the path in the text box of Edit Container Name of Table Space box. Select the Container Type from the list.
  10. Click OK to close the Advanced Restore Options dialog box.
  11. Click OK to close the Restore Options dialog box.

Adding a Tablespace for Automatic Storage Database

You can add a new storage path if the table spaces reach their maximum capacity.

Use the following steps to add new storage path for automatic storage database:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Optional: Use non-default Browse and Restore options. See Browse and Restore.
  5. From the Browse window, select the data to restore in the right pane and click Recover All Selected.

    The Restore Options dialog box is displayed.

  6. On the Recover Database tab, clear the Recover DB check box.
  7. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the non-automatic storage tablespaces from the available images.
  8. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  9. On the Storage Paths tab.
    1. Select the Specify Storage paths check box.
    2. Click Add Paths. You can add one or more paths, with a new line as a separator. Each path must exist locally and have an absolute path name. All the automatic storage table spaces will be automatically redirected to these newly defined paths.
    3. Click OK.
  10. Click OK to close the Advanced Restore Options dialog box.
  11. Click OK to close the Restore Options dialog box.

Adding a New Container for a Tablespace

Use the following steps to add a table space container for non-automatic Storage tablespaces:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the non-automatic storage tablespaces from the available images.
  7. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  8. On the Advanced Restore Options dialog box, navigate to the Redirect tab.
    1. Select the Redirect Table Space Containers check box.
    2. From the Table Space box, select the required table space to be redirected, the associated container name is displayed in the Container Name box.
    3. To redirect a tablespace, select the Container name and click Add.
    4. In the Browsing Container Name for Dataspace dialog box, click Browse to specify a new path. Add the container’s name after the path in the text box of Edit Container Name of Table Space box. Select the Container Type from the list.
    5. Click OK.
  9. Click OK to close the Advanced Restore Options dialog box.
  10. Click OK to close the Restore Options dialog box.

Editing an Existing Container for a Tablespace

Use the following steps to edit a table space container for non-automatic storage tablespaces:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.
  5. On the Restore Options dialog box, navigate to the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the non-automatic storage tablespaces from the available images.
  7. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  8. On the Advanced Restore Options dialog box, on the Redirect tab.
    1. Select the Redirect Table Space Containers check box.
    2. From the Table Space box, select the required table space to be redirected, the associated container name is displayed in the Container Name box.
    3. To redirect a tablespace, select the Container name and click Edit.
    4. In the Editing Container Name for Dataspace dialog box, click Browse to specify a new path. Add the container’s name after the path in the text box of Edit Container Name of Table Space box. Select the Container Type from the list.
    5. Click OK.
  9. Click OK to close the Advanced Restore Options dialog box.
  10. Click OK to close the Restore Options dialog box.

Finding and Replacing a Container

Use the following steps to find and replace a table space container for non-automatic storage tablespaces:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.
  5. On the Restore Options dialog box, on the Recover Database tab:
    • Clear the Recover DB check box.
  6. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the non-automatic storage tablespaces from the available images.
  7. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  8. On the Advanced Restore Options dialog box, on the Redirect tab:
    1. Select the Redirect Table Space Containers check box.
    2. From the Table Space box, select the required table space to be redirected, the associated container name is displayed in the Container Name box.
    3. Click Find&Replace to select the new location and replace the existing path with a new location path during redirect restore operation.
    4. Click OK.
  9. Click OK to close the Advanced Restore Options dialog box.
  10. Click OK to close the Restore Options dialog box.

Deleting a Container

Use the following steps to delete a table space container for non-automatic Storage tablespaces which has more than one container:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab, in the Backup Images area, select the backup images that include the non-automatic storage tablespaces from the available images.
  7. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  8. On the Redirect tab.
    1. Select the Redirect Table Space Containers check box.
    2. From the Table Space box, select the required table space to be redirected, the associated container name is displayed in the Container Name box.
    3. Click Delete to drop the selected (existing) container.
    4. Click OK.
  9. Click OK.

Performing a Cross-Machine Restore for a Standby Database

Use this procedure to restore a production database to a standby database.

Best Practice: If the standby database client machine and instance are the same, you must set the standby database name to a name that is different than the source database name (Restore Options dialog box, General tab, Target Database Name box).

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the General tab.
    1. Select the Restore Data check box and then select the Entire Database option.
    2. Select the destination client name from the Destination Computer list.
    3. If the standby database is on the production database, type the new database name in the Target Database Name box.
    4. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  7. On the Roll-Forward tab, select the Leave in Roll-forward Pending State check box.
  8. If the DB2 database is an Automatic Database, on t the Storage Path tab.
    • Delete the original path and type the new path that the tablespaces are redirected to.
  9. If the DB2 database is a Non-automatic Database, on the Redirect tab.
    • To redirect all tablespaces, select the Redirect All Table Spaces/Database to check box and then enter the path for the tablespaces.
    • To redirect tablespaces and containers, select the Redirect Table Space Containers check box. Select the tablespace and then click Edit.
  10. Click OK to close the Advanced Restore Options dialog box.
  11. Click OK to close the Restore Options dialog box

Restoring the Backup Images

You can perform a restore from a backup image when you want to perform a scheduled out-of-place restore.

Restoring a Backup Image

Use the following steps to restore the backup images in an offline state:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box appears.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab.
    1. Select the database mode for the restore.

      To restore when the database is offline, select the Offline Restore option.

      To restore when the database is online, select the Online Restore option.

    2. In the Backup Images area, select the images to restore.
      • To use the latest backup image, select Use Latest Backup Image.
      • To manually select the image, in the Available Images box, select the backup images, and then and click >.

        The backup images are moved to the Selection box.

  7. Click OK.

Incremental Restores from One Full Backup Image

This option is applicable if the restore fails in the middle of the selected backup images. For example, if you have full backup image along with an incremental and a delta, the restore fails during the incremental backup image then you need restart again with this option after you resolve the issue. Select the full backup image only.

Use the following steps to perform an incremental restore from one full backup image:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box appears.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab.
    1. Select the Offline Restore check box.
    2. In the Backup Images area, select the images to restore.
      • To use the latest backup image, select Use Latest Backup Image.
      • To manually select the images, in the Available Images box, select the backup images, and then and click >.

        The backup images are moved to the Selection box.

    3. Select the Incremental Restore (from one Full backup image) check box.
  7. Click OK.

Restoring from Multiple Incremental Images

One backup image consists of one full backup with number of incremental or delta backups. You need to select a full backup, the last incremental backup and all the delta backups to perform a restore from multiple incremental images. Use the following steps to perform a restore from multiple incremental images:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box appears.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab.
    1. Select the Offline Restore check box.
    2. In the Backup Images area, from Available Images, select the LAST FULL, LAST INCREMENTAL, and all the DELTA backup images after LAST INCREMENTAL backup, and then click >.

      The backup images to be restored will be moved to Selection box.

  7. Click OK.

Setting the Buffers for Restore

When you backup the database to multiple locations, you can give sufficient buffer value to improve the backup performance. The default value is 2.

Use the following steps to restore the backup images using buffers. When you backup the database to multiple locations, you can give sufficient buffer value to improve the backup performance. The default value is 2.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab.
    1. Select the Offline Restore check box.
    2. Type of enter the Number of Buffers that a are a sufficient number to improve performance.
    3. Type of enter the Buffer Size.
    4. Select the backup images from Available Images and click >.

      The backup images to be restored will be moved to Selection box.

  7. Click OK.

Using Parallelism for Enhancing Restore Performance

If the database contains large number of tablespaces and indexes, you can perform a restore operation faster when you set a maximum number of concurrent parallelism queries to take advantage of available Input/Output bandwidth and processor power of DB2 server.

Use the following steps to enhance your restore operation:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, clear the Recover DB check box.
  6. On the Restore Arguments tab, do the following:
    1. Select the Offline Restore check box.
    2. In the Parallelism box, type the maximum number of parallelism queries to enhance your restore operation.
    3. In the Backup Images area, select the images to restore, in the Available Images box, select the backup images, and then and click >.

      The backup images are moved to the Selection box.

  7. Click OK.

Restoring Individual Tablespaces (Partial DB)

By default, you can restore an entire database in an Offline mode (default option - Offline restore). However, you need to perform an online restore to restore the individual tablespaces. When you select individual tablespaces either from browse or from the DB2 Restore Options dialog box, the restore is automatically switched to Online Restore.

Use the following steps to restore individual tablespaces:

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the General tab, do the following:
    1. Select the Restore Data check box.
    2. Select the Database Subset option.
    3. Select the tablespaces from the Latest Database View list.
  6. On the Recover Database tab, clear the Recover DB check box.
  7. On the Restore Arguments tab:
    • You can view that the restore option is automatically switched to Online Restore for individual tablespaces/partial database.
  8. Click OK.

Restoring Logs

Archive logs can be restored separately or along with the database if all logs have been backed up.

By default, the log files are restored to the DB2 Retrieve Path that was specified during the installation of the DB2 Data Agent.

Archive Log restores are useful in the following scenarios:

  • If there is a database failure and you need to recover the database to the recent state, you restore all the logs along with the database.
  • If the logs from a specific time range were lost due to a hard disk corruption, you can restore them by performing a point-in-time restore of the logs.
  • In certain cases, you might need to restore only specific logs that are missing in the database. Such logs can be identified and then restored using a serial number or time ranges.

You can use the DB2 LOGTARGET option to extract  files from the backup image and restore them to the following directory.

UNIX

<DB2_Retrieve_Path>/<db2_instance_name/<db2_database_name>/LogsFromBackupImage/

Windows

<DB2_Retrieve_Path>\<db2_instance_name\<db2_database_name>\LogsFromBackupImage\

The DB2 Retrieve Path that you can specify during installation or that you configure with an additional setting.

For additional information on LOGTARGET, go to the DB2 Knowledge Center, LOGTARGET.

Procedure

  1. From the CommCell Browser, navigate to Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.

    The Browse and Restore dialog box is displayed.

  3. On the Time Range tab, select Latest Backup and click View Content.
  4. Select the databases to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover tab, click Advanced.

    The Advanced Restore Options dialog box is displayed.

  6. On the Log Files tab, select the Restore Log Files check box.
  7. On the Log Files tab, select the restore log option.
    Expand All

    Restore all logs

    Select the All Log Files option.

    Restore logs to a point-in-time

    Select By Point in Time and enter the Start and End time in the boxes.

    Restore by specifying a serial number

    Select the By Log Serial Number option.

    Check the Start or End check boxes and enter the serial numbers.

    The following are the rules for specifying the serial number.

    • The end serial number must be greater than or equal to the start serial number
    • The start and the end serial number cannot be 0
    • The range of serial numbers restore can be from one or more backup jobs or from a part of a job and from one or more cycles
    • When you specify only the start sequence number, logs starting from that sequence number to the current sequence number are restored
  8. To perform the restore with the DB2 LOGTARGET option, select the Restore Logs from Backup Image (use LogTarget) check box.
  9. Optional: Select the restore options.
    Expand All

    Configuring Pre- and Post-Processes

    Run scripts before or after the restore.

    Enter the full path for the pre-recovery and post-recovery script.

    You can choose to run the post-process script even if the restore job failed. You can use the post-process script to bring a database online or to release a snapshot.

    On the Pre/Post tab:

    1. In the Pre-Recovery Command box, type the full path name for the script.
    2. In the Post-Recovery Command box, type the full path name for the script.
    3. To run the post recovery process regardless of the job's outcome, select the Run Post Process for all attempts check box.

    Restore from a copy precedence

    If the backup is corrupted, restore from a storage policy copy instead of the backup.

    For more information on modifying the copy precedence of a storage policy copy, see Copy Precedence.

    On the Copy Precedence tab, select the Restore from Copy Precedence number check box and enter a copy precedence number.

  10. Click OK to close the Advanced Restore Options dialog box.
  11. Click OK to close the Restore Options dialog box and start the restore.

Reapplying the Logs (Roll-Forward)

You can reapply the logs when you have log files that contain transaction that are not part of the backup that you want to restore. You can reapply logs after you restore a database or table from a backup image.

Note: You cannot use the roll-forward option when you recover (Restore Options dialog box, Recover Database tab, Recover DB check box) the database.

Before you roll-forward the logs on the restored database, you must enable the userexit database configuration parameter to perform log archiving.

You can reapply the logs to:

  • the end of the logs - this option applies all of the logs.

  • a specified time - this options applies the logs to the time that you specify

  • the end of the backup - this option rollforwards all the partitions in the data to the earliest time during the rollforward operation that the database was consistent

Whenever the log files are restored with the roll-forward capability, DB2 searches for the following target restore paths when log files are restored with the roll-forward option:

  • DB2's own directory path for log file restores

  • The retrieve path that was specified during the installation of the DB2 Agent

  • The archive path that was specified during the installation of the DB2 Agent

  • The overflow path identified (if any) in the Overflow Directory field within the Roll-Forward.

If it is unable to find any of these paths, the appropriate error is reported in a file within the DB2 Audit Error Path that was specified during installation of the DB2 Agent.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks and select Browse and Restore.
  3. From the Browse window, select the tables to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  4. On the Recover Database tab, clear the Recover DB check box.
  5. Click Advanced.

    The Advanced Restore Options dialog box is displayed.

  6. On the Roll-Forward tab, do the following:
    1. Select the Roll-forward (Reapply the Logs) check box.
    2. Select the rollforward options that you want to use.
      Option Steps
      To the End of the logs
      1. Select To the End of the logs.
      2. If the client is in a different time zone from the CommServe computer, select the destination time zone from the Time Zone list.
      To a Point in Time
      1. Select To a Point in Time.
      2. Select the date and time to reapply the logs to.
      3. If the client is in a different time zone from the CommServe computer, select the destination time zone from the Time Zone list.
      To End of Backup
      1. Select To End of Backup.
    3. To leave the database in a pending state until all the logs are applied, select the Leave in Roll-forward Pending State check box.
    4. To restore the logs that are in the overflow directory, select the Overflow Directory check box and type the name of the directory in the box.
    5. To reapply and restore the logs to an alternate log path, select the Alternate Log Path check box and type the name of the directory in the box.
    6. Click OK.
  7. Click OK.

Restoring History Files

You can recover history file if it is damaged or DB2 cannot access it. DB2 history file stores all information about backup, restore, and changes in the database.

By default, the DB2 database will be in Offline mode. However, you need to set the database in online mode to restore the history files. You cannot restore history files which contain database records regarding recovery and administration events along with the log files. you must disable the restoring of log files and reapplying the logs (roll-forward) on restored database.

To the Source Host:

Use the following steps to restore history files to the source host:

  1. From the CommCell Browser, navigate to Client Computers | <SourceClient> | DB2 | <Instance>.
  2. Right-click the <Backup_Set>, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Latest Backup and click View Content.
  4. Select the database and click Recover All Selected.

    The Restore Options dialog box appears.

  5. On the General tab, do the following:
    1. Select the Restore Data check box.
    2. Select the History Files option.
  6. On the Restore Arguments tab, do the following:
    1. Select the Online Restore option.
    2. Click Advanced.

      The Advanced Restore Options dialog box appears.

  7. On the Roll-Forward tab, clear the Roll-forward (Reapply the Logs) check box.
  8. On the Log Files tab, clear the Restore Log Files check box.
    1. Click OK.
  9. Click OK.

To a History File Path

The system will check the history file in order to select the backup image to restore. If the history file is not available, make sure to restore this file first before you recover the database. If the system does not find all the information in the history file that it needs to recover the database, you need to specify an alternative overflow directory.

Use the following steps to recover the database to a history file path:

  1. From the CommCell Browser, navigate to Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.

    The Browse and Restore dialog box is displayed.

  3. On the Time Range tab, select Latest Backup and click View Content.
  4. Select the databases to restore and click Recover All Selected.

    The Restore Options dialog box is displayed.

  5. On the Recover Database tab, do the following:
    1. Select the Recover DB check box.
    2. Select the History File Path check box.
    3. In the History File Path box, enter the full path to the history file.
  6. Click OK.

Restoring DB2 Tables

Restore DB2 tables when you need to recover tables that have been logically corrupted or lost or after the table structure was modified.

For information on Browsing tables, see Browse Database Tables for Oracle and DB2 Databases.

Note: The Job Details dialog box displays the destination client and instance, which is the computer and instance of the auxiliary database.

When you restore tables to a different host, a new catalog database is generated on the auxiliary database. When the restore is successful, the database is un-cataloged.

When you perform a table level restore, the software generates a Load Copy command for each table.

Restoring DB2 Tables to the Source Host

Use this procedure to restore the DB2 tables to the source host.

Before You Begin

  1. Perform a table level backup.
  2. The restore uses a staging path on the target and places all input and output files in the dump file path. These paths must have read and write access for  the DB2 user.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks and select Browse and Restore.
  3. Select the Table View check box and click View Content.
  4. Optional: You can include or exclude any of the following tables in the restore, dependent, referenced and recursively dependent tables.

    You can view the table architecture in the left pane. The architecture has the following format:

    \+table view+\<db2_instance_name>\<db2_db_name>\<db2_db_schema_name>\<db2_table_names>

    Right-click the table, and choose whether to include or exclude dependent or referenced tables.

    Option Description
    Deselect All Dependent Tables Exclude all dependent tables
    Select All Dependent Tables Include all dependent tables
    Deselect All Dependent Tables Exclude all recursive referenced tables
    Select All Dependent Tables Include all recursive referenced tables
    Deselect All Referenced Tables Exclude all referenced tables
    Select All Referenced Tables Include all referenced tables
  5. From the Browse window, select the tables to restore and click Recover All Selected.

    The Table Restore Options dialog box appears.

  6. On the General tab, the selected tables are listed in the Users/Tables selected for restore box.
  7. Optional: On the General tab, choose whether to use an auxiliary database:

    The SnapProtect software uses the auxiliary database to export the tables. You can restore the tables to an auxiliary database regardless of whether the database exists.

    Option Steps
    Use an auxiliary database
    1. Select the Auxiliary Database check box.
    2. Select the auxiliary database host from the Destination Computer list.
    3. Select the auxiliary database instance from the Destination Instance list.
    4. Enter the auxiliary database name in the Target Database Name box.
    5. Enter the full path for the target database in the Target Database Path box.
    6. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.

      The dump file directory contains the export, import and table creation information. The information is stored for reuse.

      Warning: If the auxiliary database exists, the database is overwritten to the Target Database Path.

    Do not use an auxiliary database If you choose the option to not use an auxiliary database, the SnapProtect software automatically creates a temporary auxiliary database with the name j<job_id> on the same DB2 instance as the source database and then uses it for the restore.
    1. Enter the full path for the target database in the Target Database Path box.

      Note: The directory must be empty.

    2. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.
  8. Optional: To have the SnapProtect software automatically clean the auxiliary database when the restore is successful, select the Clean Up Auxiliary Database after Export check box.

    The database is stored in the DB2 system. The software reuses the database if the restore job fails.

  9. On the Table Restore Options tab, select the restore location:
    1. Select the Import to Source DB option.
    2. Enter the source instance port number if you have selected the Auxiliary Database option.

      For information on how to find the DB2 Instance port number, see How do I Find Out the DB2 Instance Port Number.

  10. Optional: To delete the tables prior to the restore, on the Table Restore options tab, select the Drop Table for Import check box.

    Note: By default, when you restore tables, the restore operation replaces all existing data if the same tables exist on the destination database. You can select the Drop Table for Import option to have the software drop and recreate the tables. If you have the same table name but a different table structure on destination, you have to drop the tables before the restore.

  11. Optional: To generate the Data Definition Language (DDL) authorization statements for the tables, on the Table Restore options tab, select the Generate Authorization DDL check box.
  12. Optional: To add additional parameters to the DDL statements, on the Table Restore options tab, select the Specify additional db2look parameters check box and enter the parameters.

    For additional information on db2look, go to the DB2 Knowledge Center, db2look.

    To set the DB2 grant privilege on the restored table, select the Specify additional db2look parameters check box and enter -x as the parameter.

  13. On the Restore Options tab, select the restore time option.

    By default the database tables are restored to the current time.

    • To restore the database tables to the end of the logs (the current time), select the To the End of the logs option.
    • To restore the database tables to a point-in-time, select the To a Point in Time option and enter the date and time.
    • To restore the database tables to the earliest time during a rollforward operation that the database was consistent, select the To End of Backup option.

      For additional information on this option, go to the IBM website, END OF BACKUP.

  14. Click OK to close the Table Restore Options dialog box.

Restoring DB2 Tables to a Different Database on the Same Instance on the Source Host

Use this procedure to restore the DB2 tables to a different database on the same instance on the source host.

Note: When you restore a DB2 table, you can restore to any existing database schema on the destination.

You can view the schema and table combination after the restore by using SQL commands.

Expand All

Example

You restore db2inst5.table1 to db2inst6.table1.

After the restore, run the following command to see the change.

db2inst6>db2 “select * from db2inst5.table1”
EMPNO             ENAME                                                 ADD1
 ----------- -------------------------------------------------- ----------------
1                 Jane Doe                                          Any Street
2                 Fred Bloggs                                       Any Street

Before You Begin

  1. Perform a table level backup.
  2. Configure the database on the CommCell Console host that you use for the restore.
  3. The restore uses a staging path on the target and places all input and output files in the dump file path. These paths must have read and write access for  the DB2 user.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks and select Browse and Restore.
  3. Select the Table View check box and click View Content.
  4. Optional: You can include or exclude any of the following tables in the restore, dependent, referenced and recursively dependent tables.

    You can view the table architecture in the left pane. The architecture has the following format:

    \+table view+\<db2_instance_name>\<db2_db_name>\<db2_db_schema_name>\<db2_table_names>

    Right-click the table, and choose whether to include or exclude dependent or referenced tables.

    Option Description
    Deselect All Dependent Tables Exclude all dependent tables
    Select All Dependent Tables Include all dependent tables
    Deselect All Dependent Tables Exclude all recursive referenced tables
    Select All Dependent Tables Include all recursive referenced tables
    Deselect All Referenced Tables Exclude all referenced tables
    Select All Referenced Tables Include all referenced tables
  5. From the Browse window, select the tables to restore and click Recover All Selected.

    The Table Restore Options dialog box appears.

  6. On the General tab, the selected tables are listed in the Users/Tables selected for restore box.
  7. Optional: On the General tab, choose whether to use an auxiliary database:

    The SnapProtect software uses the auxiliary database to export the tables. You can restore the tables to an auxiliary database regardless of whether the database exists.

    Option Steps
    Use an auxiliary database
    1. Select the Auxiliary Database check box.
    2. Select the auxiliary database host from the Destination Computer list.
    3. Select the auxiliary database instance from the Destination Instance list.
    4. Enter the auxiliary database name in the Target Database Name box.
    5. Enter the full path for the target database in the Target Database Path box.
    6. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.

      The dump file directory contains the export, import and table creation information. The information is stored for reuse.

      Warning: If the auxiliary database exists, the database is overwritten to the Target Database Path.

    Do not use an auxiliary database If you choose the option to not use an auxiliary database, the SnapProtect software automatically creates a temporary auxiliary database with the name j<job_id> on the same DB2 instance as the source database and then uses it for the restore.
    1. Enter the full path for the target database in the Target Database Path box.

      Note: The directory must be empty.

    2. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.
  8. Optional: To have the SnapProtect software automatically clean the auxiliary database when the restore is successful, select the Clean Up Auxiliary Database after Export check box.

    The database is stored in the DB2 system. The software reuses the database if the restore job fails.

  9. On the Table Restore Options tab, select the restore location:
    1. Select the Import to a different DB option.
    2. Select a host other than the source host from the Import Destination Computer list.
    3. Select the source instance from the Import Destination Instance list.
    4. Enter the database name in the Import Database Name box.

      The database name must be configured in the CommCell Console.

    5. Enter the DB2 user name and password.
    6. Enter the DB2 import instance port number in the Database Server Port box.

      The software makes the Database Server Port box available when you select the Use an auxiliary database option. For information on how to find the DB2 Instance port number, see How do I Find Out the DB2 Instance Port Number.

  10. Optional: To delete the tables prior to the restore, on the Table Restore options tab, select the Drop Table for Import check box.

    Note: By default, when you restore tables, the restore operation replaces all existing data if the same tables exist on the destination database. You can select the Drop Table for Import option to have the software drop and recreate the tables. If you have the same table name but a different table structure on destination, you have to drop the tables before the restore.

  11. Optional: To generate the Data Definition Language (DDL) authorization statements for the tables, on the Table Restore options tab, select the Generate Authorization DDL check box.
  12. Optional: To add additional parameters to the DDL statements, on the Table Restore options tab, select the Specify additional db2look parameters check box and enter the parameters.

    For additional information on db2look, go to the DB2 Knowledge Center, db2look.

    To set the DB2 grant privilege on the restored table, select the Specify additional db2look parameters check box and enter -x as the parameter.

  13. On the Restore Options tab, select the restore time option.

    By default the database tables are restored to the current time.

    • To restore the database tables to the end of the logs (the current time), select the To the End of the logs option.
    • To restore the database tables to a point-in-time, select the To a Point in Time option and enter the date and time.
    • To restore the database tables to the earliest time during a rollforward operation that the database was consistent, select the To End of Backup option.

      For additional information on this option, go to the IBM website, END OF BACKUP.

  14. Click OK to close the Table Restore Options dialog box.

Restoring DB2 Tables to a Different Database on a Different Instance on the Source Host

Use this procedure to restore the DB2 tables to a different database on a different instance on the source host.

Note: When you restore a DB2 table, you can restore to any existing database schema on the destination.

You can view the schema and table combination after the restore by using SQL commands.

Expand All

Example

You restore db2inst5.table1 to db2inst6.table1.

After the restore, run the following command to see the change.

db2inst6>db2 “select * from db2inst5.table1”
EMPNO             ENAME                                                 ADD1
 ----------- -------------------------------------------------- ----------------
1                 Jane Doe                                          Any Street
2                 Fred Bloggs                                       Any Street

Before You Begin

  1. Verify that you the source and target hosts can reach each other on the network.
  2. Perform a table level backup.
  3. The restore uses a staging path on the target and places all input and output files in the dump file path. These paths must have read and write access for  the DB2 user.
  4. Configure the database on the CommCell Console host that you use for the restore.
  5. Set the DB2 SVCENAME configuration parameter on the target instance. On the command line type the following:

    Db2 update dbm cfg using SVCENAME <service_name or service number>

    The value can be the TCP/IP port number or the name from the services file. Use one of the following commands to determine the information.

    UNIX

    On the command line, type the following command:

    cat /etc/services | grep '<db2_instance_name>'

    Windows

    Search the WINNT/SYSTEM32/DRIVERS/ETC/Services file.

    Example

    The following is an example UNIX services file for the DB2 instance 'db2inst5'. The SVCENAME configuration parameter can be set to any of the values in the first column (for example DB2_instance5_END) or any in the second column (for example,'6003').

    DB2_db2inst5 60000/tcp
    DB2_db2inst5_1 60001/tcp
    DB2_db2inst5_2 60002/tcp
    DB2_db2inst5_END 60003/tcp

  6. Set the DB2 DB2COMM env parameter to TCPIP. On the command line type the following:

    DB2SET DB2COMM=TCPIP

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks and select Browse and Restore.
  3. Select the Table View check box and click View Content.
  4. Optional: You can include or exclude any of the following tables in the restore, dependent, referenced and recursively dependent tables.

    You can view the table architecture in the left pane. The architecture has the following format:

    \+table view+\<db2_instance_name>\<db2_db_name>\<db2_db_schema_name>\<db2_table_names>

    Right-click the table, and choose whether to include or exclude dependent or referenced tables.

    Option Description
    Deselect All Dependent Tables Exclude all dependent tables
    Select All Dependent Tables Include all dependent tables
    Deselect All Dependent Tables Exclude all recursive referenced tables
    Select All Dependent Tables Include all recursive referenced tables
    Deselect All Referenced Tables Exclude all referenced tables
    Select All Referenced Tables Include all referenced tables
  5. From the Browse window, select the tables to restore and click Recover All Selected.

    The Table Restore Options dialog box appears.

  6. On the General tab, the selected tables are listed in the Users/Tables selected for restore box.
  7. Optional: On the General tab, choose whether to use an auxiliary database:

    The SnapProtect software uses the auxiliary database to export the tables. You can restore the tables to an auxiliary database regardless of whether the database exists.

    Option Steps
    Use an auxiliary database
    1. Select the Auxiliary Database check box.
    2. Select the auxiliary database host from the Destination Computer list.
    3. Select the auxiliary database instance from the Destination Instance list.
    4. Enter the auxiliary database name in the Target Database Name box.
    5. Enter the full path for the target database in the Target Database Path box.
    6. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.

      The dump file directory contains the export, import and table creation information. The information is stored for reuse.

      Warning: If the auxiliary database exists, the database is overwritten to the Target Database Path.

    Do not use an auxiliary database If you choose the option to not use an auxiliary database, the SnapProtect software automatically creates a temporary auxiliary database with the name j<job_id> on the same DB2 instance as the source database and then uses it for the restore.
    1. Enter the full path for the target database in the Target Database Path box.

      Note: The directory must be empty.

    2. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.
  8. Optional: To have the SnapProtect software automatically clean the auxiliary database when the restore is successful, select the Clean Up Auxiliary Database after Export check box.

    The database is stored in the DB2 system. The software reuses the database if the restore job fails.

  9. On the Table Restore Options tab, select the restore location:
    1. Select the Import to a different DB option.
    2. Select the source host from the Import Destination Computer list.
    3. Select the source instance from the Import Destination Instance list.
    4. Enter the database name in the Import Database Name box.

      The database name must be configured in the CommCell Console.

    5. Enter the DB2 user name and password.
    6. Enter the DB2 import instance port number in the Database Server Port box.

      The software makes the Database Server Port box available when you select the Use an auxiliary database option. For information on how to find the DB2 Instance port number, see How do I Find Out the DB2 Instance Port Number.

  10. Optional: To delete the tables prior to the restore, on the Table Restore options tab, select the Drop Table for Import check box.

    Note: By default, when you restore tables, the restore operation replaces all existing data if the same tables exist on the destination database. You can select the Drop Table for Import option to have the software drop and recreate the tables. If you have the same table name but a different table structure on destination, you have to drop the tables before the restore.

  11. Optional: To generate the Data Definition Language (DDL) authorization statements for the tables, on the Table Restore options tab, select the Generate Authorization DDL check box.
  12. Optional: To add additional parameters to the DDL statements, on the Table Restore options tab, select the Specify additional db2look parameters check box and enter the parameters.

    For additional information on db2look, go to the DB2 Knowledge Center, db2look.

    To set the DB2 grant privilege on the restored table, select the Specify additional db2look parameters check box and enter -x as the parameter.

  13. On the Restore Options tab, select the restore time option.

    By default the database tables are restored to the current time.

    • To restore the database tables to the end of the logs (the current time), select the To the End of the logs option.
    • To restore the database tables to a point-in-time, select the To a Point in Time option and enter the date and time.
    • To restore the database tables to the earliest time during a rollforward operation that the database was consistent, select the To End of Backup option.

      For additional information on this option, go to the IBM website, END OF BACKUP.

  14. Click OK to close the Table Restore Options dialog box.

Restoring DB2 Tables to a Different Database on a New Host

Use this procedure to restore the DB2 tables to a different database on the same or different instance on a new host.

Note: When you restore a DB2 table, you can restore to any existing database schema on the destination.

You can view the schema and table combination after the restore by using SQL commands.

Expand All

Example

You restore db2inst5.table1 to db2inst6.table1.

After the restore, run the following command to see the change.

db2inst6>db2 “select * from db2inst5.table1”
EMPNO             ENAME                                                 ADD1
 ----------- -------------------------------------------------- ----------------
1                 Jane Doe                                          Any Street
2                 Fred Bloggs                                       Any Street

Before You Begin

  1. Verify that you the source and target hosts can reach each other on the network.
  2. Perform a table level backup.
  3. The restore uses a staging path on the target and places all input and output files in the dump file path. These paths must have read and write access for  the DB2 user.
  4. Configure the database on the CommCell Console host that you use for the restore.
  5. Set the DB2 SVCENAME configuration parameter on the target instance. On the command line type the following:

    Db2 update dbm cfg using SVCENAME <service_name or service number>

    The value can be the TCP/IP port number or the name from the services file. Use one of the following commands to determine the information.

    UNIX

    On the command line, type the following command:

    cat /etc/services | grep '<db2_instance_name>'

    Windows

    Search the WINNT/SYSTEM32/DRIVERS/ETC/Services file.

    Expand All

    Example

    The following is an example UNIX services file for the DB2 instance 'db2inst5'. The SVCENAME configuration parameter can be set to any of the values in the first column (for example DB2_instance5_END) or any in the second column (for example,'6003').

    DB2_db2inst5 60000/tcp
    DB2_db2inst5_1 60001/tcp
    DB2_db2inst5_2 60002/tcp
    DB2_db2inst5_END 60003/tcp

  6. Set the DB2 DB2COMM env parameter to TCPIP. On the command line type the following:

    DB2SET DB2COMM=TCPIP

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks and select Browse and Restore.
  3. Select the Table View check box and click View Content.
  4. Optional: You can include or exclude any of the following tables in the restore, dependent, referenced and recursively dependent tables.

    You can view the table architecture in the left pane. The architecture has the following format:

    \+table view+\<db2_instance_name>\<db2_db_name>\<db2_db_schema_name>\<db2_table_names>

    Right-click the table, and choose whether to include or exclude dependent or referenced tables.

    Option Description
    Deselect All Dependent Tables Exclude all dependent tables
    Select All Dependent Tables Include all dependent tables
    Deselect All Dependent Tables Exclude all recursive referenced tables
    Select All Dependent Tables Include all recursive referenced tables
    Deselect All Referenced Tables Exclude all referenced tables
    Select All Referenced Tables Include all referenced tables
  5. From the Browse window, select the tables to restore and click Recover All Selected.

    The Table Restore Options dialog box appears.

  6. On the General tab, the selected tables are listed in the Users/Tables selected for restore box.
  7. Optional: On the General tab, choose whether to use an auxiliary database:

    The SnapProtect software uses the auxiliary database to export the tables. You can restore the tables to an auxiliary database regardless of whether the database exists.

    Option Steps
    Use an auxiliary database
    1. Select the Auxiliary Database check box.
    2. Select the auxiliary database host from the Destination Computer list.
    3. Select the auxiliary database instance from the Destination Instance list.
    4. Enter the auxiliary database name in the Target Database Name box.
    5. Enter the full path for the target database in the Target Database Path box.
    6. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.

      The dump file directory contains the export, import and table creation information. The information is stored for reuse.

      Warning: If the auxiliary database exists, the database is overwritten to the Target Database Path.

    Do not use an auxiliary database If you choose the option to not use an auxiliary database, the SnapProtect software automatically creates a temporary auxiliary database with the name j<job_id> on the same DB2 instance as the source database and then uses it for the restore.
    1. Enter the full path for the target database in the Target Database Path box.

      Note: The directory must be empty.

    2. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.
  8. Optional: To have the SnapProtect software automatically clean the auxiliary database when the restore is successful, select the Clean Up Auxiliary Database after Export check box.

    The database is stored in the DB2 system. The software reuses the database if the restore job fails.

  9. On the Table Restore Options tab, select the restore location:
    1. Select the Import to a different DB option.
    2. Select a host other than the source host from the Import Destination Computer list.
    3. Select the source instance from the Import Destination Instance list.
    4. Enter the database name in the Import Database Name box.

      The database name must be configured in the CommCell Console.

    5. Enter the DB2 user name and password.
    6. Enter the DB2 import instance port number in the Database Server Port box.

      The software makes the Database Server Port box available when you select the Use an auxiliary database option. For information on how to find the DB2 Instance port number, see How do I Find Out the DB2 Instance Port Number.

  10. Optional: To delete the tables prior to the restore, on the Table Restore options tab, select the Drop Table for Import check box.

    Note: By default, when you restore tables, the restore operation replaces all existing data if the same tables exist on the destination database. You can select the Drop Table for Import option to have the software drop and recreate the tables. If you have the same table name but a different table structure on destination, you have to drop the tables before the restore.

  11. Optional: To generate the Data Definition Language (DDL) authorization statements for the tables, on the Table Restore options tab, select the Generate Authorization DDL check box.
  12. Optional: To add additional parameters to the DDL statements, on the Table Restore options tab, select the Specify additional db2look parameters check box and enter the parameters.

    For additional information on db2look, go to the DB2 Knowledge Center, db2look.

    To set the DB2 grant privilege on the restored table, select the Specify additional db2look parameters check box and enter -x as the parameter.

  13. On the Restore Options tab, select the restore time option.

    By default the database tables are restored to the current time.

    • To restore the database tables to the end of the logs (the current time), select the To the End of the logs option.
    • To restore the database tables to a point-in-time, select the To a Point in Time option and enter the date and time.
    • To restore the database tables to the earliest time during a rollforward operation that the database was consistent, select the To End of Backup option.

      For additional information on this option, go to the IBM website, END OF BACKUP.

  14. Click OK to close the Table Restore Options dialog box.

Restoring DB2 Tables with the "Do Not Import" Option

Use this procedure to restore the DB2 tables with the "Do Not Import" option.

You can use the table export dump files when you want to customize your command line.

Before You Begin

  1. Perform a table level backup.
  2. The restore uses a staging path on the target and places all input and output files in the dump file path. These paths must have read and write access for  the DB2 user.

Procedure

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. Select the Table View check box and click View Content.
  4. Optional: You can include or exclude any of the following tables in the restore, dependent, referenced and recursively dependent tables.

    You can view the table architecture in the left pane. The architecture has the following format:

    \+table view+\<db2_instance_name>\<db2_db_name>\<db2_db_schema_name>\<db2_table_names>

    Right-click the table, and choose whether to include or exclude dependent or referenced tables.

    Option Description
    Deselect All Dependent Tables Exclude all dependent tables
    Select All Dependent Tables Include all dependent tables
    Deselect All Dependent Tables Exclude all recursive referenced tables
    Select All Dependent Tables Include all recursive referenced tables
    Deselect All Referenced Tables Exclude all referenced tables
    Select All Referenced Tables Include all referenced tables
  5. From the Browse window, select the tables to restore and click Recover All Selected.

    The Table Restore Options dialog box appears.

  6. On the General tab, the selected tables are listed in the Users/Tables selected for restore box.
  7. Optional: On the General tab, choose whether to use an auxiliary database:

    The SnapProtect software uses the auxiliary database to export the tables. You can restore the tables to an auxiliary database regardless of whether the database exists.

    Option Steps
    Use an auxiliary database
    1. Select the Auxiliary Database check box.
    2. Select the auxiliary database host from the Destination Computer list.
    3. Select the auxiliary database instance from the Destination Instance list.
    4. Enter the auxiliary database name in the Target Database Name box.
    5. Enter the full path for the target database in the Target Database Path box.
    6. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.

      The dump file directory contains the export, import and table creation information. The information is stored for reuse.

      Warning: If the auxiliary database exists, the database is overwritten to the Target Database Path.

    Do not use an auxiliary database If you choose the option to not use an auxiliary database, the SnapProtect software automatically creates a temporary auxiliary database with the name j<job_id> on the same DB2 instance as the source database and then uses it for the restore.
    1. Enter the full path for the target database in the Target Database Path box.

      Note: The directory must be empty.

    2. Enter the full path to the directory for the table dump files in the Export Destination for Table Dump Files box.
  8. On the Table Restore Options tab, select the Do Not Import option.

    The table export dump files will be generated on the dump file path (General tab, Export Destination for Table Dump Files box).

  9. On the Restore Options tab, select the restore time option.

    By default the database tables are restored to the current time.

    • To restore the database tables to the end of the logs (the current time), select the To the End of the logs option.
    • To restore the database tables to a point-in-time, select the To a Point in Time option and enter the date and time.
    • To restore the database tables to the earliest time during a rollforward operation that the database was consistent, select the To End of Backup option.

      For additional information on this option, go to the IBM website, END OF BACKUP.

  10. Click OK to close the Table Restore Options dialog box.

Creating Directories on the Target for Disaster Recovery and Cross-Machine Restores

In the event of a disaster, the recovery to the new target database may include creating the data directories on the target (destination) host if they do not exist. A similar situation may occur when performing a cross-machine restore.

The Create_Db_dir.ps1 or Create_Db_Dir.sh scripts are run on either a Windows or UNIX configuration and create the directory structure needed for a disaster recovery or cross-machine restore scripts.

If you do not use the BackupJobID or PointInTime parameters, the current time is used for the Point-in-Time.

Parameter Description
clientName Specifies the name of the client as displayed in the CommCell Browser (e.g., client1).
SnapProtectInstance The name of the SnapProtect instance.
DatabaseInstanceName The name of the database instance.
BackupJobID The Backup Job ID
PointInTime The Point-in-Time
BackupSetName For DB2 only. The name of the backup set.

UNIX

  1. You must be a database instance user in the UNIX group of SnapProtect to run this utility.
  2. Log onto the CommServe.
  3. Go to the <SnapProtect>/Base directory to locate the Create_Db_Dir.sh utility.
  4. Run the Create_Db_Dir.sh utility to create the directory

Usage

Create_Db_dir.sh -c <clientName> -i <SnapProtectInstance> -d <DatabaseInstanceName> -j <BackupJobID> OR -p <PointInTime> -b <BackupSetName>

Windows

  1. The script Create_Db_Dir.ps1 is located under SnapProtect location.
  2. The Windows powershell needs to run it from SnapProtect_installation\Create_Db_Dir.ps1.
  3. Open the PowerShell prompt and verify the version is 2.0 or above.

    powershell Get-Host

  4. Verify the Execution Policy for PowerShell is 'Unrestricted'.

    powershell Get-ExecutionPolicy

    If needed, set the Execution Policy to 'Unrestricted'

    powershell Set-ExecutionPolicy Unrestricted

  5. Execute the script:

    powershell.\SnapProtect_installation\Create_Db_dir.sh -c <clientName> -i <SnapProtectInstance> -d <DatabaseInstanceName> -j <BackupJobID> OR -p <PointInTime> -b <BackupSetName>

  6. Disable the PowerShell script execution on the system:

    powershell Set-ExecutionPolicy Restricted

Usage

Create_Db_dir.ps1 -c <clientName> -i <SnapProtectInstance> -d <DatabaseInstanceName> -j <BackupJobID> OR -p <PointInTime> -b <BackupSetName>

Restoring to Disk (App Free Restore)

You can restore the backup images of data and logs or multiple backup jobs at a time directly to a location on a disk using CommCell console without the intervention of DB2 application. This is useful for restoring multiplexed data on the same media. The data from different backup jobs are passed back to the client so that all of the interleaved backup jobs can be restored in parallel. You can restore the data associated with a specific backup job such as full, in parallel streams. You can also submit multiple restore jobs from full and incremental backups. Later, you can restore DB2 database from DB2 command line using backup image from Disk without using the load SnapProtect library.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. Click OK.
  4. On the Restore to Disk dialog box, select the backup job that you want to restore to a disk. Right click on the job and select Restore to Disk. You can select multiple backup jobs at a time and restore them to disk.
  5. On the Restore Options dialog box, navigate to the General Tab.
    1. Select the Destination Client from the drop down list.
    2. Type the path or click Browse to specify the location of the disk to restore the application data.
    3. Select the Impersonate User if you want to use a different account with the required privileges. In the User Name box, type the user name. The User should have necessary privileges to restore the application data.

      In the Password box, type the password for the user account.

      In the Confirm Password box, re-type the password.

  6. Click OK.

    The backup images will be restored to the disk location specified in the Restore Options for All Selected Items dialog box.

    DB2 iDataAgent will create a new folder with the current restore job id on the destination directory which has been specified during the restore operation. This folder contains the backup images and DB2 archive logs.

    Log Files

    <restore_destination_path>/<restore_job_id>/LOGS/DB2/<Node Number>/<Chain number>/Log_files

    Data

    <restore_destination_path>/<restore_job_id>/<Backup_images>

    You can run a disk restore using this backup image at the following location:

    db2 restore database <db_name> taken at <backup_image_timestamp>

    You can also use the following command to restore the backup image.

    db2 restore database <db_name> from <restore_destination_path>/<restore_job_id> taken at <backup_image_timestamp>

    You can recover the database by reapplying the log files (roll forward). Make sure that the SnapProtect services are running on this client.

    db2 rollforward database <db_name> to end of logs and stop overflow log path "(<Restore_Destination_path>/<Restore_Jobid>)"

If you are trying to restore one cycle of backup images which include Full, incremental and deltas, you should use the last backup image timestamp (incremental or delta) with incremental automatic key word to restore:

db2 restore database <db_name> incremental automatic from <restore_destination_path>/<restore_job_id> taken at <late_incremental or delta_backup_image_timestamp>

The multi streams backup job will have multiple backup images as number of streams after restoring to disk.

Restoring a Non-recoverable Database with an Offline Backup

DB2 supports backup and restore of an non-recoverable database.

Follow these steps.

  1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. On the Browse and Restore dialog box, select Time Range and Absolute Time with the Start Time and End Time and then click View Content.
  4. Select the databases and click Recover All Selected.

    The Restore Options dialog box appears.

  5. On the General tab, select the Restore Data check box and select the Entire Database option.
  6. On the Recover Database tab, clear the Recover DB check box.
  7. On the Restore Options tab, In the Backup Images area, select an offline backup from Available Images, and then click Advanced.

    The Advanced Restore Options dialog box appears.

  8. On the Roll-Forward tab, clear the Roll-forward (Reapply the logs) check box, and then cick OK.
  9. Click OK.

Performing a Restore on a Restore Only Client

Make sure to perform the following prior to performing a restore on a Restore Only Client.

  • Backup the DB2 database on a source client which has full license. When a component is installed on a client computer in restore only mode, license for that component will not be consumed and you will be able to use that client only as a destination for restoring backed up data that is residing on a different computer. You cannot perform backup operations on that client computer. See Installing Restore Only Agents for more information on installing restore only client.
  • Install the DB2 iDataAgent in regular mode on a target client.

    Release the license using the following steps:

    1. From the CommCell Browser, navigate to Client Computers | <Client>
    2. Right-click the DB2, point to All Tasks, and then click Release License.
    3. Click Yes to release the license.

    Use the following steps to perform a restore on a restore only client:

    1. From the CommCell Browser, expand Client Computers > client > DB2 > instance.
    2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
    3. Select Latest Backup and click View Content.
    4. Select the database and click Recover All Selected.
    5. On the Restore Options dialog box, navigate to the Recover Database tab and clear the Recover DB check box.
    6. On the Restore Options dialog box, navigate to the Restore Arguments tab. Select a cycle of backup images from the available images.
    7. On the Restore Options dialog box, navigate to the General tab.
    8. On the Restore to Disk dialog box, select the backup job that to restore to a disk. Right click on the job and select Restore to Disk. Select multiple backup jobs at a time and restore them to disk.
    9. On the Restore Options dialog box, navigate to the General Tab.

      Select the target client/DB2 instance name from the Target Database Name list.

      In the Target Database path, type the location of the target database/tablespaces. Alternatively, click Browse to select the path.

    10. Click OK.

    Scheduling a Restore

    For information on how to configure a restore schedule, see Schedule Restores.

    Managing Restore Jobs

    For information on how to manage the job, see Job Controller Overview.