Restoring Db2 data to the original instance

You can restore a database backup to its original instance on the original host. You can restore to the latest backup or an earlier Db2® database backup version. When you restore a database to its original instance, you cannot rename it. This restore option runs a full production restoration of data, and existing data is overwritten at the target site if the Overwrite existing databases option is selected.

Before you begin

If your Db2 environment includes partitioned databases, the data of all partitions is backed up during regular backup jobs. All instances are listed in the backup pane. Multi-partitioned instances are shown with partition numbers and host names.

Before you create a restore job for Db2, ensure that the following requirements are met:
  • At least one Db2 backup job is set up and running successfully. For instructions about setting up a backup job, see Backing up Db2 data.
  • IBM Storage® Protect Plus roles and resource groups are assigned to the user who is setting up the restore job. For more information about assigning roles, see Managing user access.
  • When restoring from a IBM Storage Protect archive, files will be migrated to a staging pool from the tape prior to the job beginning. Depending on the size of the restore, this process could take several hours.
  • Restore jobs can create data in the IBM Db2 log directory. In some cases, if more than one restore job is run, data will remain in the log directory from the previous job. As a result, the next attempt to restore a database to the original location fails unless the log directory is purged.

    For example, if the Db2 log directory is empty and a restore job runs with the options Restore to original instance, Overwrite existing databases, and Recover until end of backup, the restore job is successfully completed. If the job is followed by a second job with the options Restore to original instance, Overwrite existing databases, and Recover until end of available logs, this second restore attempt fails because the original restore job left data in the Db2 log directory.

Procedure

  1. In the navigation panel, expand Manage Protection > Databases > Db2 and click Create job > Restore.
    The Rrestore wizard opens.
  2. Optional: If you started the restore wizard from the Jobs and Operations page, click Db2 as the source type and click Next.
    Tips:
    • For a running summary of your selections in the wizard, click Preview Restore in the navigation panel in the wizard.
    • The wizard is opened in the default setup mode. To run the wizard in advanced setup mode, select Advanced Setup. With advanced setup mode, you can set more options for your restore job.
  3. On the Select source page, click a Db2 instance to show the databases in that instance. Choose a database by clicking the plus icon Add to restore list icon for that database name. Click Next to continue.
  4. In the Source snapshot page, choose the type of restore operation required.
    • On-Demand: Snapshot: creates a once-off restore operation from a database snapshot. The job is not set to recur.
    • On-Demand: Point-in-Time: creates a once-off restore operation from a point-in-time backup of the database. The job is not set to recur.
    • Recurring: creates a recurring job that runs on a schedule and repeats.
    Tip:

    For an On-Demand: Snapshot you can select no recovery or to recover until the end of the backup. For an On-Demand: Point in Time restore job you can select to recover until the end of the available logs, or recover until a specific point-in-time.

  5. Complete the fields on the Source snapshot page and click Next to continue.
    The fields that are shown depend on the number of items that were selected on the Select source page and on the restore type. Some fields are also not shown until you select a related field.

    Fields that are shown for an on-demand snapshot, single resource restore

    OptionDescription
    Date range Specify a range of dates to show the available snapshots within that range.
    Backup storage type All backups in the selected date range are listed in rows that show the time that the backup operation occurred and the service level agreement (SLA) policy for the backup. Select the row that contains the backup time and SLA policy that you want, and then take one of the following actions:
    • Click the backup storage type that you want to restore from. The storage types that are shown depend on the types available in your environment and are shown in the following order:
      Backup
      Restores data that is backed up to a vSnap server.
      Replication
      Restores data that is replicated to a vSnap server.
      Object Storage
      Restores data that is copied to a cloud service or to a repository server.
      Archive
      Restores data that is copied to a cloud service archive or to a repository server archive (tape).
    • Click anywhere on the row. The first backup type that is shown sequentially from the left of the row is selected by default. For example, if the storage types Backup, Replication, and Archive are shown, Backup is selected by default.
    Use alternate vSnap server for the restore job If you are restoring data from a cloud service or a repository server, select this box to specify an alternative vSnap server, and then select a server from the Select alternate vSnap menu.

    When you restore data from a restore point that was copied to a cloud resource or repository server, a vSnap server is used as a gateway to complete the operation. By default, the vSnap server that is used to complete the restore operation is the same vSnap server that is used to complete the backup and copy operations. To reduce the load on the vSnap server, you can select an alternative vSnap server to serve as the gateway.

    Fields that are shown for an on-demand snapshot, multiple resources restore; or recurring restore. For point-in-time restore, only Site is available for Restore Location Type.

    OptionDescription
    Restore Location Type Select a type of location from which to restore data:
    Site
    The site to which snapshots were backed up. The site is defined in the System Configuration > Storage > Sites pane.
    Cloud service copy
    The cloud service to which snapshots were copied. The cloud service is defined in the System Configuration > Storage > Cloud storage pane.
    Repository server copy
    The repository server to which snapshots were copied. The repository server is defined in the System Configuration > Storage > Repository servers pane.
    Cloud service archive
    The cloud archive service to which snapshots were copied. The cloud service is defined in the System Configuration > Storage > Cloud storage pane.
    Repository server archive
    The repository server to which snapshots were copied to tape. The repository server is defined in the System Configuration > Storage > Repository servers pane.
    Select a location If you are restoring data from a site, select one of the following restore locations:
    Primary
    The primary site from which to restore snapshots.
    Secondary
    The secondary site from which to restore snapshots.

    If you are restoring data from a cloud or repository server, select a server from the Select a location menu.

    Date selector For on-demand restore operations, specify a range of dates to show the available snapshots within that range.
    Restore Point For on-demand restore operations, select a snapshot from the list of available snapshots in the selected date range.
    Use alternate vSnap server for the restore job If you are restoring data from a cloud service or a repository server, select this box to specify an alternative vSnap server, and then select a server from the Select alternate vSnap menu.

    When you restore data from a restore point that was copied to a cloud service or repository server, a vSnap server is used as a gateway to complete the operation. By default, the vSnap server that is used to complete the restore operation is the same vSnap server that is used to complete the backup and copy operations. To reduce the load on the vSnap server, you can select an alternative vSnap server to serve as the gateway.

  6. In the Restore Method page, choose Production for the restore operation.

    In Production mode, the Db2 application server first copies the files from the vSnap repository volume to the target host. That copied data is then used to start the database.

    Tip: Avoid entering a new database name when you are restoring a production operation to the original instance as it will not be implemented.
  7. Set the destination for the restore operation to Restore to original instance to restore data to the original server. Click Next to continue.
  8. Choose options as described in Restoring Db2 data.
  9. In the Schedule page, name the restore job and choose the frequency for the job to run. Schedule the start time, and click Next to continue.

    If the restore job you are specifying is an on-demand job, there is no option to enter a schedule. Specify a schedule only for recurrent restore jobs.

  10. In the Review page, review your selections for the restore job. If all the details are correct for your restore job, click Submit, or click Back to make amendments.

Results

A few moments after you click Submit, the onDemandRestore record is added to the Job Sessions pane. To view progress of the restore operation, expand the job. You can also download the log file by clicking the download icon the add to restore list  icon. All running jobs are viewable in the Jobs and Operations Running Jobs page.