Advanced Restore - DB2 MultiNode iDataAgent

Table of Contents

Restore Considerations for a DB2 pureScale Configuration

In a DB2 pureScale environment, the following needs to be taken into account before performing a restore.

For a data only restore, only one node needs to be available.  The default node chosen is the last one that was used for a backup and/or restore.  To see see which one is used by default:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <Subclient>.
  3. The Catalog Partition No. on the Properties dialog display the node.

To change the node priority.

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance> | <Backup Set>.
  2. Right-click the <Subclient> , and then click Properties.
  3. On the Properties dialog, navigate to the Data Storage Policy tab under the Storage Device tab.
    1. In the first available node used for data backup box, select the row corresponding to the node to try first and select the up arrow button.
    2. Click OK.

For a data and log restore or log restore require all nodes to be available, because each node maintains its own transaction log. 

Restoring and Recovering an Entire Database

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 automatically activate the database after the restore operation. However, you need to connect the non administrative users manually after the restore operation.

Procedure

  1. From the CommCell Browser, navigate to Client Computers > client > DB2 MultiNode Client > 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:
    1. Select the Restore Data check box.
    2. Select the Entire Database option.
  6. Click OK.

Restoring Individual Tablespaces

By default, the DB2 database will be in Offline mode. However, you need to set the database in online mode to restore the individual tablespaces.

Procedure

  1. From the CommCell Browser, navigate to Client Computers > client > DB2 MultiNode Client > 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:
    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 Restore Arguments tab:
    1. Select the Online or Offline  Restore option.
    2. Select an appropriate Backup Image.
  7. Click OK.

Restoring History Files

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. Hence, make sure to disable the restoring of log files and reapplying the logs (roll-forward) on restored database.

Procedure

  1. From the CommCell Browser, navigate to Client Computers > client > DB2 MultiNode Client > 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:
    1. Select the Restore Data check box.
    2. Select the History Files option.
    3. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  6. On the Roll-forward tab, clear the Roll-forward check box.
  7. On the Log files tab, clear the Restore Log Files check box.
  8. 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.
  9. Click OK to close the Advanced Restore Options dialog box.
  10. Click OK to close the Restore Options dialog box.

Recovering a Database

By default, you can recover the database along with the restore operation. However, you cannot recover a partial database. Also, you will not be able to recover a database while performing an out-of-place restore operation. If you are trying to recover the database using the backup image, you will not be able to reapply the logs for restore.

  1. From the CommCell Browser, expand Client Computers > client > instance.
  2. Right-click the backup_set, point to All Tasks, and then click Browse and Restore.
  3. Click View Content.
  4. 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.

  5. On the Recover Database tab, select the Recover DB check box .
  6. Select the database recover option:
    Choice Description
    To the End of the logs Recover to the end of logs.
    1. Select the To the End of the logs option.
    2. Click Advanced.

      The Restore Options dialog box is displayed.

    3. On the Roll-Forward tab, select the To the End of the logs option.
    4. Click OK.
    To a Point in Time
    1. Select the To a Point in Time option.
    2. Enter the date and time.

      Note: If the time zone is different on the CommServe computer and client, in the Time Zone box, select the client computer time zone.

    Use a History File Path

    The system checks the history file in order to select the backup image to restore. If the history file is not available, restore the file 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.

    The overflow directory is an alternative log path that the software searches to find archived logs when it recovers the database. Use this overflow directory path only if log files were moved to a location other than that specified by the logpath database configuration parameter.

    1. Select the History File check box.
    2. Enter the history file path.
    3. If the log files are not in the logpath directory, in the Overflow Directory box, enter the path to the alternate directory.
  7. Click OK to close the Restore Options dialog box and start the restore.

Restoring the Backup Images

When you restore a full backup image, make sure to select all associated incremental or delta backup images.

Procedure

  1. From the CommCell Browser, navigate to Client Computers > client > DB2 MultiNode Client > 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:
    1. Select the Restore Data check box.
    2. Select the History Files or the Database Subset option.
    3. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  6. On the Restore Options tab:
    1. Select the restore type, Online Restore or Offline Restore.
    2. To perform an incremental restore, select the Incremental Restore (from one Full back image) check box.
    3. Select the images in the Available Images box and click the > button.
    4. Click Advanced.

      The Advanced Restore Options dialog box is displayed.

  7. Optional: Select the restore options.
    Expand All

    Set the Number of Buffers that the software uses for the restore

    If you restore to multiple locations, set this to a value that is great than 2.

    Set the buffer size

    To set the buffer size, in the Buffer Size box, type the size of the buffer.

    The minimum value is 8, and the default value is 1024. If you select value 0, the value of the backbufz database manager configuration parameter will be used as the buffer allocation size.

    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.
  8. Click OK to close the Advanced Restore Options dialog box.
  9. Click OK to close the Restore Options dialog box.

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 s such as full, incremental, log etc., 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.

Use the following steps to perform an app free restore operation:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.

    Right-click the <BackupSet>, point to All Tasks and then click Restore to Disk.

  2. Click OK on the Restore to Disk filter dialog.  This selects All Backup Types where the Job Status is Completed.
  3. In the right pane of the Commcell Console select one of more jobs. Right click on the job and select Restore to Disk.
  4. On the Restore Options for All Selected items dialog box:
    • Select the Destination Client from the drop down list.
    • Enter the path or click Browse to specify the location of the disk to restore the application data.
    • The backup images will be restored to the disk location specified in the Restore Options for All Selected Items dialog box.
    • Click OK.

      The DB2 iDataAgent creates 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

      Example:

      cd <Restore_Destination_path>/<Restore_Jobid>

      Ls –ltr
      d rwxrwxr-x 3 db2part5 db2grp1 256 Mar 12 12:11 LOGS
      -rwxrwxr-x 1 db2part5 db2grp1 561664000 Mar 12 12:26 HPSNAP1.0.DB2PART5.NODE0001.CATN0000.20130311113930.001
      --rwxrwxr-x 1 db2part5 db2grp1 578866640 Mar 12 12:26 HPSNAP1.0.DB2PART5.NODE0000.CATN0000.20130311113921.001

      Data

      <destination directory> <Backup_images>

      You can run a disk restore using this backup image at the following location. Make sure that the SnapProtect services are running on this client.

      >cd <restore_destination_path>/<restore_job_id>
      >db2 restore database <db_name> taken at <backup_image>

      You can recover the database by reapplying the log files (roll forward).

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

      The following examples are for restore and roll forward using backup images from the disk of two node DB2 MultiNode setup which has only full Backup:

      Export DB2NODE=0
      db2 terminate

      db2 restore database <Database_Name> incremental automatic from <Restore_Destination_path>/<Restore_Jobid> taken at <Node 0 Backup Image> without prompting

      Export DB2NODE=1
      db2 terminate
      db2 restore database <Database_Name> incremental automatic from <Restore_Destination_path>/<Restore_Jobid> taken at <Node 1 Backup Image> without prompting

      For roll forward:

      Export DB2NODE=0
      db2 terminate
      db2 rollforward db <Database_Name> to end of logs on all nodes overflow log path \ ( \
      <Restore_Destination_path>/<Restore_Jobid> /LOGS/<DB2 Instance>/<Database Name>/NODE0000/<Latest Chain Directory> ,\
      <Restore_Destination_path>/<Restore_Jobid> /LOGS/<DB2 Instance>/<Database Name>/NODE0001/<Latest Chain Directory> on node 1 \)

      Cross Machine Restore:

      Consider the following before performing a cross machine restore to destination disk:

      • You need to restore backup images to a destination computer.
      • The destination computer's DB2 iDataAgent must be configured in CommServe.
      • The SnapProtect path in the destination computer must be the same as source computer.
      • You must be a DB2 user to run the db2 commands for restoring to disk.

Restoring Logs

Whenever log files are restored without reapplying the logs (roll-forward), the files are restored to the DB2 Retrieve Path that was specified during the installation of the DB2 iDataAgent.

For both DB2 DPF and DB2 pureScale configurations, all nodes must be available in order for a log restore to succeed.

All Logs

Use the following steps to restore all the log files:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Log Files tab on the Advanced Restore Options dialog and check the Restore Log Files check box and select the All Log Files option.
  2. Click OK.
  1. Click OK.

To a Specific Point-in-Time

Use the following steps to restore the log files to a specific point-in-time:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Log Files tab on the Advanced Restore Options dialog and check the Restore Log Files check box and select the By Point in Time option.
  2. Check the Start check box and enter the Start Date and Time.
  3. Check the End check box and enter the End Date and Time.
  4. Click OK.
  1. Click OK.

To a Specific Log Serial Number

Use the following steps to restore the log restore the log identified by a serial number:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Log Files tab on the Advanced Restore Options dialog and check the Restore Log Files check box and select the By Log Serial Number option.
  2. Check the Start check box and enter the Start Serial Number.
  3. Check the End check box and enter the End Serial Number.
  4. Click OK.
  1. Click OK.

Restoring the Database to a New Client

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

  • The operating system on the destination client should 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.
  • The DB2 user should have sufficient rights to restore the database. See Configuring User Accounts for more information.

Use the following steps to restore the database to a new client:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. On the DB2 Restore Options dialog box:
    1. On the Recover Database tab, clear the Recover DB check box.
    2. Navigate to the General tab. 
      • Select the Destination Computer and the Destination Instance.
      • Enter the Target Database Name
      • In the Target Database path box, enter the location of the target database. Alternatively, click Browse to select the path.
    3. Click OK.

Recovering Databases by Reapplying the Logs (Roll-Forward)

You can recover the database by reapplying the log files containing transactions that are not part of any database backup image. The roll-forward capability is applied after a database or table space image is restored.

Before reapplying the logs (roll-forward) on the restored database, you must perform log archiving using one or both the following configurations:

  • Enable the userexit database configuration parameter

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

  • DB2's own directory path for log file restores

  • The retrieve Path that was specified during the installation of the DB2 iDataAgent

  • The archive Path that was specified during the installation of the DB2 iDataAgent

  • The 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 iDataAgent.

To the End of Logs

Use the following steps to reapply all of the logs to the database after a restore.

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Roll-Forward tab on the Advanced Restore Options dialog and check the Roll-forward (Reapply the Logs) check box and select the To the End of the logs option.
  2. Click OK.
  1. Click OK.

To a Point-in-Time

Use the following steps to reapply the logs till a point-in-time after a restore:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Roll-Forward tab on the Advanced Restore Options dialog and check the Roll-forward (Reapply the Logs) check box and select the To a Point in Time option.
  2. Enter the Date and Time.
  3. Click OK.
  1. Click OK.

To an Alternative Log Path

Use the following steps to reapply and restore the logs in an alternative log path:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Roll-Forward tab on the Advanced Restore Options dialog and check the Roll-forward (Reapply the Logs) check box and check the Alternate Log Path check box.
  2. Enter the log path, or alternatively use the Browse button.
  3. Click OK.

To an Overflow Directory

If the required log file is not present in the location specified by the logpath database configuration parameter, DB2 searches the overflow directory.

Use the following steps to reapply and restore the logs in an overflow directory path:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Roll-Forward tab on the Advanced Restore Options dialog and check the Roll-forward (Reapply the Logs) check box.
  2. Enter the Overflow Directory, or alternatively use the Browse button.
  3. Click OK.
  1. Click OK.

Leaving the Database in Roll Forward Pending State

Use the following steps to keep the database in a pending state till the logs are reapplied:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. Click Advanced on the DB2 Restore Options dialog
  1. Navigate to the Roll-Forward tab on the Advanced Restore Options dialog and check the Leave in Roll-forward Pending State check box.
  2. Click OK.
  1. Click OK.

Restoring a Non-recoverable Database with an Offline Backup

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

Follow these steps.

  1. From the CommCell Browser, navigate to Client Computers | <Client> | DB2 MultiNode | <Instance>.
  2. Right-click the <BackupSet>, 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.
  5. On the Restore Options dialog box, select the Restore Data check box and select the Entire Database option.
  6. On the Restore Options dialog box, navigate to the Recover Database tab and clear the Recover DB check box.
  7. On the Restore Options dialog box, navigate to the Restore Options tab and select an offline backup from Available Images.  Click Advanced.
  8. Click OK.

Command Line Restores

The software supports all DB2 commands that use the the –lo (load option). Refer to the to the IBM DB2 manuals for the complete list of DB2 commands that can include the optional –lo parameter.

Use the following steps to restore a database using the DB2 command line.

NOTE: for Command line restores, disconnect all connected applications to the database before you run the restore. The Restore parameter “Open Session” must be same as the backup number of streams.

For DB2 DPF

  1. At the DB2 command prompt, type the appropriate restore command for the specific platform.
    • For a DB2 instance on 32-bit AIX/Solaris, or 32-bit or 64-bit Linux, or 31-bit/64-bit Linux on System Z, run the following command:

      Export DB2NODE=<n>
      Db2 terminate
      db2 restore db <database name> incremental automatic \
      load '<software install path>/Base/libDb2Sbt.so' \
      open <n> sessions \
      taken at <backup image date of DB2NODE n > \
      without prompting

    • For a DB2 instance on 64-bit AIX/Solaris or 64bit Linux on System Z, run the following command:

      db2 restore db <database name> incremental automatic \
      load '<software install path>/Base64/libDb2Sbt.so' \
      open <n> sessions \
      open <n> sessions taken at <backup image date of DB2NODE n > \
      without prompting

  2. Roll forward the DB2 database.

    Example DB2 DPF

    export DB2NODE=0
    db2 terminate
    db2 rollforward <database name> to end of logs on all nodes and stop

For DB2 pureScale

  1. At the DB2 command prompt, type the restore command.

    db2 restore db <database name> \
    incremental automatic \
    load '<software install path>/Base/libDb2Sbt.so' \
    open <n> sessions \
    taken at <backup image date> \
    without prompting

  2. Roll forward the DB2 database.

    db2 rollforward db <database name> to end of logs and stop

Where

<software install path> is the install path for the agent software (e.g., level1/install);

<backup image date> is the date of the backup image in the following format:

"YYYYMMDDHHMMSS" (for example, 20070612120426).

<n> is number of streams which should be equal to number of backup streams

Cross Database Restore

Prior to performing a cross database restore, configure the required parameters.

Cross Database/Cross Instance/Cross Machine Restore

Requirements:

  1. The source and target DB2 DPF databases must have the same number of nodes.
  2. SnapProtect must be installed on all target DB2 DPF machines and there must be a configured pseudo client in the CommServe.
  3. In the case of a partial restore, the DB2 DPF NODE0 tables space “SYSCATSPACE” must be part of a partial redirect restore.

Use the following steps to perform a cross-database / cross instance / cross machine restore.

For cross database restores, run all DB2 commands on the target machines for the DB2 instances/DB2 database.

For DB2 DPF

  1. At the Command Prompt, type the restore command.

    For non-automatic storage database:

    export DB2NODE=<n>
    db2 terminate

    db2 restore db <Source DB2 Database Name> \ 
    load '<software install path>/Base/libDb2Sbt.so' \
    open <n> sessions \
    'options "\
    CvDpfClientName=<Target MultiNode Pseudo Client Name>,\
    CvDpfControlHostName=<Target Client Name>,\
    CvSrcClientName=<Source MultiNode Pseudo Client Name>,\
    CvSrcDB2InstanceName=<Source DB2 Database Name>,\
    CvSrcDbName=<Source DB2 Database Name>"' \
    taken at <Source DB2 Database NODE<n> backup image date> \
    to '<Target DB2 Database Path>' \
    into <Target DB2 Database Name> \
    without prompting

    For automatic storage database:

    export DB2NODE=<n>
    db2 terminate

    db2 restore db <Source DB2 Database Name> \
    load '<software install path>/Base/libDb2Sbt.so' \
    open <n> sessions \
    CvDpfControlHostName=<Target Client Name>,\
    CvSrcClientName=<Source MultiNode Pseudo Client Name>,\
    CvSrcDB2InstanceName=<Source DB2 Database Name>, \
    CvSrcDbName=<Source DB2 Database Name>"' \
    taken at <Source DB2 Database NODE<n> backup image date> \
    ON '</Target DB2 Database Path>' \
    DBPATH ON '</Target DB2 Database Path>' \
    into <Target DB2 Database Name> \
    without prompting

    Where:

    n = DB2 Node Number

    CvDpfClientName = Target MultiNode Pseudo Client Name in SnapProtect CommServe

    CvDpfControlHostName = Target DB2 Client Name

    CvSrcClientName = Source MultiNode Pseudo Client Name in  SnapProtect CommServe

    CvSrcDB2InstanceName = Source DB2 Database Name

    CvSrcDbName = Source DB2 Database Name

    taken at = Source DB2 Database NODE backup image date

    ON = Target DB2 Database Storage Path

    DBPATH ON = Target DB2 Database Directories Path

    Into = Target DB2 Database Name

  2. Re-update the db2 database configuration parameters LOGARCHOPT1/VENDOROPT since they are overwritten by source database after restore. Set the CvSrcDbName option for the LOGARCHOPT1 parameter to the source database name.
  3. Roll forward the DB2 database.

    export DB2NODE=0
    db2 terminate

    db2 update db cfg for <database name> DBPARTITIONNUM (n) using LOGARCHOPT1 "'\
    CvDpfClientName=<Target_ Db2MultiNode_PesudeoClientName>,\
    CvDpfControlHostName=<Target_DB2_Client_Machine_Name>,\
    CvSrcClientName=<Source_ Db2MultiNode_PesudeoClientName,\
    CvSrcDB2InstanceName=<Source_DB2DPF_Instance_Name>,\
    CvSrcDbName=<Source_DB2_Database_Name>'"
    db2 update db cfg for <database name> DBPARTITIONNUM (n) using VENDOROPT "'\
    CvDpfClientName=<Target_ Db2MultiNode_PesudeoClientName>,\
    CvDpfControlHostName=<Target_DB2_Client_Machine_Name>,\
    CvSrcClientName=<Source_ Db2MultiNode_PesudeoClientName,\
    CvSrcDB2InstanceName=<Source_DB2DPF_Instance_Name>,\
    CvSrcDbName=<Source_DB2_Database_Name>'"
    db2 rollforward db <new_db> to end of logs and stop

For DB2 pureScale

  1. At the Command Prompt, type the restore command.

    db2 restore db <Source DB2 Database Name> \ 
    load '<software install path>/Base/libDb2Sbt.so' \
    open <n> sessions \
    'options "\
    CvDpfClientName=<Target MultiNode Pseudo Client Name>,\
    CvDpfControlHostName=<Target Client Name>,\
    CvSrcClientName=<Source MultiNode Pseudo Client Name>,\
    CvSrcDB2InstanceName=<Source DB2 Database Name>,\
    CvSrcDbName=<Source DB2 Database Name>"' \
    taken at <Source DB2 Database backup image date> \
    ON '<Target DB2 Database Path>' \
    DBPATH ON '<Target DB2 Database Path>' \
    into <Target DB2 Database Name> \
    without prompting

    Where:

    n = DB2 Node Number

    CvDpfClientName = Target MultiNode Pseudo Client Name in SnapProtect CommServe

    CvDpfControlHostName = Target DB2 Client Name

    CvSrcClientName = Source MultiNode Pseudo Client Name in  SnapProtect CommServe

    CvSrcDB2InstanceName = Source DB2 Database Name

    CvSrcDbName = Source DB2 Database Name taken at = Source DB2 Database NODE backup image date

    ON = Target DB2 Database Storage Path

    DBPATH ON = Target DB2 Database Directories Path

    Into = Target DB2 Database Name

  2. Re-update the db2 database configuration parameters LOGARCHOPT1/VENDOROPT since they are overwritten by source database after restore. Set the CvSrcDbName option for the LOGARCHOPT1 parameter to the source database name.

    db2 update db cfg for <database name> using LOGARCHOPT1 "'\
    CvDpfClientName=<Target_ Db2MultiNode_PesudeoClientName>,\
    CvSrcClientName=<Source_ Db2MultiNode_PesudeoClientName,\
    CvSrcDB2InstanceName=<Source_DB2DPF_Instance_Name>,\
    CvSrcDbName=<Source_DB2_Database_Name>'"

  3. Roll forward the DB2 database.

    db2 update db cfg for <database name> using VENDOROPT "'\
    CvDpfClientName=<Target_ Db2MultiNode_PesudeoClientName>,\
    CvSrcClientName=<Source_ Db2MultiNode_PesudeoClientName,\
    CvSrcDB2InstanceName=<Source_DB2DPF_Instance_Name>,\
    CvSrcDbName=<Source_DB2_Database_Name>'"
    db2 rollforward db <new_db> to end of logs and stop

Partial DB2 DPF Redirect Command Line Restore

To do a cross machine restore of  NODE001 tablespaces (USERSTBS1,USERSTBS2,USERSTBS3) of  two NODES on DB2 DPF instances.

Run the following DB2 commands on the Target DB2 DPF machine where the partial restore will go to. Generate a partial DB2 DPF SQL script for NODE0000 SYSCATSPACE tablespace restore.

db2 SET CLIENT ATTACH_DBPARTITIONNUM 0;
db2 SET CLIENT CONNECT_DBPARTITIONNUM 0;

db2 restore db <SourceDatabaseName> rebuild with tablespace \
\(SYSCATSPACE\) load ‘/opt/simpana/Base64/libDb2Sbt.so’ \
'options "\
CvDpfClientName=DB2DPF_DB2PSCALE4_1052,\
CvSrcDpfClientName=DB2DPF_DB2PSCALE2_1052,\
CvSrcClientName=DB2DPF_DB2PSCALE2_1052,\
CvSrcDB2InstanceName=part1052,\
CvSrcDbName=PARTDB"' \
taken at <Node0 backup Image> \
ON '/database/db2/V10.5/part1052/CROSSDB1' \
DBPATH ON '/database/db2/V10.5/part1052/CROSSDB1' \
into crossdb1 \
LOGTARGET '/database/db2/V10.5/part1052/CROSSDB1/archivelogs' \
redirect \
generate script db2dpf_redirect_node0_restore.clp

After the script is run successfully, the output is a DB2 generated SQL file called db2dpf_redirect_node0_restore.clp.

Run the following DB2 commands on Target DB2 DPF machine where you want to perform to generate partial DB2 DPF SQL script for NODE0001 tablespaces (USERSTBS1,USERSTBS2,USERSTBS3) restore.

db2 SET CLIENT ATTACH_DBPARTITIONNUM 1;
db2 SET CLIENT CONNECT_DBPARTITIONNUM 1;

db2 -v restore db <SourceDatabaseName> rebuild with tablespace \
\(USERSTBS1,USERSTBS2,USERSTBS3\) \
load ‘/opt/simpana/Base64/libDb2Sbt.so’ \
'options "\
CvDpfClientName=DB2DPF_DB2PSCALE4_1052,\
CvSrcDpfClientName=DB2DPF_DB2PSCALE2_1052,\
CvSrcClientName=DB2DPF_DB2PSCALE2_1052,\
CvSrcDB2InstanceName=part1052,\
CvSrcDbName=PARTDB"' \
taken at <Node1 backup Image> \
DBPATH ON '/database/db2/V10.5/part1052/CROSSDB1' \
into <TargetDatabaseName> \
LOGTARGET '/database/db2/V10.5/part1052/CROSSDB1/archivelogs' \
redirect \
generate script db2dpf_redirect_node1_restore.clp

After the script is run successfully, the output is a DB2 generated SQL file called b2dpf_redirect_restore_node1.clp .

Where

/opt/simpana/Base64/libDb2Sbt.so = SnapProtect  DB2 SBT library location

CvDpfClientName = Target DB2 DPF Pseudo Client Name in  SnapProtect CommServe

CvSrcDpfClientName = Source DB2 DPF Pseudo Client Name in SnapProtect CommServe 

CvSrcClientName = Source DB2 DPF Pseudo Client Name in SnapProtect CommServe 

CvSrcDB2InstanceName = Source DB2 DPF instance Name

CvSrcDbName = Source DB2 DPF Database Name which you have Backup images of all nodes

DBPATH ON = where DB2 stores various control files for the database, given empty directory should exist with proper DB22 permission

ON = where DB2 creates automatic storage table space containers, given empty directory should exist with proper DB2 permission.

 LOGTARGET = Where db2 restores the log files from a backup image, given empty directory should exist with proper DB2 permission.

Run the following DB2 scripts.

db2 –tf db2dpf_redirect_node0_restore.clp
db2 –tf db2dpf_redirect_node1_restore.clp
export DB2NODE=0
db2 terminate
db2 update db cfg for <Target_Database_Name> DBPARTITIONNUM (n) using LOGARCHOPT1 "'\
CvDpfClientName=<Target_ Db2MultiNode_PesudeoClientName>,\
CvDpfControlHostName=<Target_DB2_Client_Machine_Name>,\
CvSrcClientName=<Source_ Db2MultiNode_PesudeoClientName,\
CvSrcDB2InstanceName=<Source_DB2DPF_Instance_Name>,\
CvSrcDbName=<Source_DB2_Database_Name>'"
db2 update db cfg for <Target_Database_Name> DBPARTITIONNUM (n) using VENDOROPT "'\
CvDpfClientName=<Target_ Db2MultiNode_PesudeoClientName>,\
CvDpfControlHostName=<Target_DB2_Client_Machine_Name>,\
CvSrcClientName=<Source_ Db2MultiNode_PesudeoClientName,\
CvSrcDB2InstanceName=<Source_DB2DPF_Instance_Name>,\ CvSrcDbName=<Source_DB2_Database_Name>'"
db2 rollforward db <TargetDatabaseName> to end of backup and stop on all nodes

db2 update db cfg for <TargetDatabaseName> using LOGARCHOPT1 "''
db2 update db cfg for <TargetDatabaseName> using VENDOROPT "''"

The last two lines are for removing LOGARCHOPT1 and VENDEROPT values.

Single Job ID for Multi Stream Backups

By default, third party command line multiple stream backups share a single job in the Job Manager. Use the following steps to disable the single job ID and generate separate job IDs for each stream.

  1. From the CommCell Browser, navigate to Client Computers.
  2. Right-click the <Client> in which you want to add the additional setting, and click Properties.
  3. Click the Advanced button on the Client Properties dialog.
  4. Navigate to the Additional Setting tab on the Advanced Client Properties dialog and click the Add button.
  5. In the Name field, enter sSKIPSINGLEJOBID.
  6. In the Location box, select or enter HKEY_LOCAL_MACHINE\Software\CommVault Systems\Galaxy\Instance<xxx>\DB2Agent.
  7. In the Type box, select one of the following:
    • REG_SZ for Windows clients
    • Value for Unix clients
  8. In the Value field, type Y.
  9. Click OK.

Querying and Restoring the Data and Log Backup Images to a Disk

For information on how to query and restore the database, see Example: Querying and Restoring the Data and Log Backup Images to a Disk.

Scheduling a Restore

Use the following steps to schedule a restore job:

  1. From the CommCell Browser, navigate to Client Computers | <DB2 MultiNode Client> | <Instance>.
  2. Right-click the <BackupSet>, point to All Tasks and then click Browse and Restore.
  3. Click View Content on the Browse and Restore Options dialog.
  4. In the right pane of the Browse window, select the databases to restore and click Recover All Selected.
  5. On the DB2 Restore Options dialog box:
    1. On the Job Initiation tab, select the Schedule option and click the Configure button.
    2. Enter the Schedule Name, select the frequency (e.g. Weekly) and a start date and time
    3.   and click OK.

Managing Restore Jobs

Once you initiate the restore operation, a restore job is generated in the Job Controller. Jobs can be managed in a number of ways. The following sections provide information on the different job management options available:

Restarting Jobs

Jobs that fail to complete successfully are automatically restarted based on the job restartability configuration set in the Control Panel. Keep in mind that changes made to this configuration will affect all jobs in the entire CommCell.

To Configure the job restartability for a specific job, you can modify the retry settings for the job. This will override the setting in the Control Panel. It is also possible to override the default CommServe configuration for individual jobs by configuring retry settings when initiating the job. This configuration, however, will apply only to the specific job.

Restore jobs for this Agent are resumed from the point-of-failure.

Configure Job Restartability at the CommServe Level

  1. From the CommCell Browser, click Control Panel icon.
  2. Select Job Management.
  3. Click Job Restarts tab and select a Job Type.
    • Select Restartable to make the job restartable.
    • Change the value for Max Restarts to change the maximum number of times the Job Manager will try to restart a job.
    • Change the value for Restart Interval (Mins) to change the time interval between attempts for the Job Manager to restart the job.
  4. Click OK.
 

Controlling Jobs

The following controls are available for running jobs in the Job Controller window:

Suspend

Temporarily stops a job. A suspended job is not terminated; it can be restarted at a later time.

Resume

Resumes a job and returns the status to Waiting, Pending, Queued, or Running. The status depends on the availability of resources, the state of the Operation Windows, or the Activity Control setting

Kill

Terminates a job.

Suspending a Job

  1. From the Job Controller of the CommCell Console, right-click the job and select Suspend.
  2. The job status may change to Suspend Pending for a few moments while the operation completes. The job status then changes to Suspended.

Resuming a Job

  1. From the Job Controller of the CommCell Console, right-click the job and select Resume.
  2. As the Job Manager attempts to restart the job, the job status changes to Waiting, Pending, or Running.

Killing a Job

  1. From the Job Controller of the CommCell Console, right-click the job and select Kill.
  2. Click Yes when the confirmation prompt appears if you are sure you want to kill the job. The job status may change to Kill Pending for a few moments while the operation completes. Once completed, the job status will change to Killed and it will be removed from the Job Controller window after five minutes.

Resubmitting Jobs

If a restore job fails to complete successfully, you can resubmit the job without the need to reconfigure the original job's restore options using the Resubmit Job feature. When a job is resubmitted, all the original options, restore destinations, and other settings configured for the job remain in tact.

Resubmit a Restore Job

  1. From the CommCell Browser, right-click a client computer whose data recovery history you want to view, click View, then click to view a job history.
  2. From the Job History Filter dialog box, select Restore.
    • If you want to view more advanced options for restores, from the Job History Filter, select Restore, then click Advanced.
    • From the Data Recovery History Advanced Filter select the destination client computer of the restores you would like to view, then click OK.
  3. The system displays the results of the options you selected in the Data Recovery Job History window.
  4. Right-click on any job, and select Resubmit.
  5. Select the job options.
  6. Click OK.

Additional Restore Options

Several additional options are available to further refine your restore operations. The following table describes these options, as well as the steps to implement them.

Be sure to read the overview material referenced for each feature prior to using them.

Option Description Related Topics
Use Hardware Revert Capability If Available This option allow you to revert the data to the time when the snapshot was created. Selecting this option brings back the entire LUN to the point when the snapshot was created, overwriting all modifications to the data since the snapshot creation. This option is only available if the storage array used for SnapProtect Backup supports the revert operation.
  1. From the CommCell Browser, navigate to Client Computers | <DB2DPF Client>  | <Instance>.
  1. Right-click the <BackupSet> point to All Tasks, and then click Browse Backup Data.
  2. Click OK.
  3. In the right pane of the Browse window, select the data you want to restore and click Recover All Selected.
  4. Click Recover Database tab.
  1. Select Use hardware revert capability if available check box.
  2. Click OK.
 
Startup Options

The Startup Options are used by the Job Manager to set priority for resource allocation. This is useful to give higher priority to certain jobs. You can set the priority as follows:

  1. From the CommCell Browser, navigate to Client Computers | <DB2DPF Client>  | <Instance>.
  1. Right-click the <BackupSet> point to All Tasks, and then click Browse Backup Data.
  2. Click OK.
  3. In the right pane of the Browse window, select the data you want to restore and click Recover All Selected.
  4. Click Advanced.
  1. Click Startup tab.
  2. Select Change Priority.
  3. Select a priority number - 0 is the highest priority and 999 is the lowest priority.
  4. Select the Start up in suspended State check box to start the job in a suspended state.
  5. Click OK.
Refer to Job Priority and Priority Precedence.
Copy Precedence By default, the system retrieves data from the storage policy copy with the lowest copy precedence. If the data was pruned from the primary copy, the system automatically retrieves data from the other copies of the storage policy in the lowest copy precedence to highest copy precedence order. Once the data is found, it is  retrieved, and no further copies are checked.

You can retrieve data from a specific storage policy copy (Synchronous Copy or Selective Copy). If data does not exist in the specified copy, the data retrieve operation fails even if the data exists in another copy of the same storage policy. Follow the steps given below to retrieve the data from a specific storage policy copy:

  1. From the CommCell Browser, navigate to Client Computers | <DB2DPF Client>  | <Instance>.
  1. Right-click the <BackupSet> point to All Tasks, and then click Browse Backup Data.
  2. Click OK.
  3. In the right pane of the Browse window, select the data you want to restore and click Recover All Selected.
  4. Click Advanced.
  1. Click Copy Precedence tab.
  2. Select the Restore from copy precedence check box.
  3. Select the number from Copy Precedence list.
  4. Click OK.
Refer to Recovering Data From Copies.
Data Path Options

The data recovery operations use a default Library, MediaAgent, Drive Pool, and Drive as the Data Path. You can use this option to change the data path if the default data path is not available. Follow the steps given below to change the default data path:

  1. From the CommCell Browser, navigate to Client Computers | <DB2DPF Client>  | <Instance>.
  1. Right-click the <BackupSet> point to All Tasks, and then click Browse Backup Data.
  2. Click OK.
  3. In the right pane of the Browse window, select the data you want to restore and click Recover All Selected.
  4. Click Advanced.
  1. Click Data Path tab.
  2. Select the MediaAgent from Use MediaAgent list.
  3. Select the Library from Use Library list.
  4. Select the drive pool and drive from Use Drive Pool and Use Drive lists for tape library.
  5. Select the name of the Proxy server  from Use Proxy list, if you wish to restore using a proxy server.
  6. Click OK.
Refer to Change Data Path.
Encryption

If the client's data is encrypted with a pass phrase, you must enter the pass-phrase to start the data recovery operation. Follow the steps given below to enter the pass-phrase:

  1. From the CommCell Browser, navigate to Client Computers | <DB2DPF Client>  | <Instance>.
  1. Right-click the <BackupSet> point to All Tasks, and then click Browse Backup Data.
  2. Click OK.
  3. In the right pane of the Browse window, select the data you want to restore and click Recover All Selected.
  4. Click Advanced.
  1. Click Encryption tab.
  2. Type the pass phrase in Pass Phrase box.
  3. Re-type the pass phrase in Re-enter Pass Phrase box.
  4. Click OK.
Refer to Data Encryption.
Alerts

This option enables users or user groups to get automatic notification on the status of the data recovery job. Follow the steps given below to set up the criteria to raise notifications/alerts:

  1. From the CommCell Browser, navigate to Client Computers | <DB2DPF Client>  | <Instance>.
  1. Right-click the <BackupSet> point to All Tasks, and then click Browse Backup Data.
  2. Click OK.
  3. In the right pane of the Browse window, select the data you want to restore and click Recover All Selected.
  4. Click Advanced.
  1. Click Alerts tab.
  2. Click Add Alert.
  3. From the Add Alert Wizard box, select the required threshold and notification criteria and click Next.
  4. Select the required notification types and click Next.
  5. Select the recipients and click Next.
  6. Click Finish.
  7. Click OK.
Refer to Alerts and Notifications.
CommCell Readiness Report The CommCell Readiness Report provides you with vital information such as connectivity and readiness of the Client, MediaAgent, and CommServe. It is useful to run this report before performing a backup or a recovery operation. Follow the steps given below to generate the report:
  1. On the CommCell Console menu bar, select the Reports tab.
  2. Click Readiness.

    The Report Selection dialog box appears.

  3. If necessary, select Reports | CommServe | CommCell Readiness in the left pane.
  4. Select the Computers tab, and then click Modify below the Computers list.
  5. In the dialog box that appears, clear Include All Client Computers and All Client Groups.
  6. Select the appropriate client from the Exclude list, and then click Include >.
  7. Click OK.
  8. Select the MediaAgent tab, and then clear Include All MediaAgents.
  9. Select the appropriate MediaAgent from the Exclude list, and then click Include >.
  10. Click Run.

    The report appears in your default Web browser.

Refer to CommCell Readiness Report.
Restore Job Summary Report

The Restore Job Summary Report provides you with information about all the data recovery jobs that are run in last 24 hours for a specific client and agent. You can get information such as failure reason, failed objects, job options, and so on. It is useful to run this report after performing the restore. Follow the steps given below to generate the report:

  1. On the CommCell Console menu bar, select the Reports tab.
  2. Click Summary.

    The Report Selection dialog box appears.

  3. If necessary, select Reports | Jobs | Job Summary in the left pane.
  4. On the General tab, select Data Recovery Jobs.
  5. Select the Computers tab.
  6. Select the appropriate client and the appropriate agent.
  7. Click Run.

    The report appears in your default Web browser.

Refer to Restore Job Summary Report.