Restoring Oracle data

Use a restore job to restore an Oracle environment from snapshots. IBM Spectrum® Protect Plus creates a vSnap clone from the version that is selected during the job definition creation and creates a Network Files System (NFS) share. The IBM Spectrum Protect Plus agent then mounts the share on the Oracle server where the restore job is to be run. For Oracle Real Application Clusters (RAC), the restore job is run on all nodes in the cluster.

Before you begin

Complete the following prerequisites:
  • Create and run an Oracle backup job. For instructions, see Backing up Oracle data.
  • Before an IBM Spectrum Protect Plus user can restore data, the appropriate roles and resource groups must be assigned to the user. Grant users access to resources and backup and restore operations by using the Accounts pane. For instructions, see Managing user access.
Review the following restrictions:
  • Point-in-time recovery is not supported if one or more data files were added to the database in the period between the chosen point in time and the time that the preceding backup job ran.
  • If an Oracle database is mounted but not opened during a backup job, IBM Spectrum Protect Plus cannot determine the database tempfile settings that are related to autoextensibility and maximum size. When a database is restored from this restore point, IBM Spectrum Protect Plus cannot re-create the tempfiles with the original settings because they are unknown. Instead, tempfiles are created with default settings, AUTOEXTEND ON and MAXSIZE 32767M. After the restore job is completed, you can manually update the settings.
  • When restoring from a IBM Spectrum 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.

About this task

The following restore modes are supported:
Instant access mode
In instant access mode, no further action is taken after mounting the share. Users can complete any custom recovery by using the files in the vSnap volume.
Test mode
In test mode, the agent creates a new database by using the data files directly from the vSnap volume.
Production mode
In production mode, the agent first restores the files from the vSnap volume back to primary storage and then creates the new database by using the restored files.

Procedure

To define an Oracle restore job, complete the following steps:

  1. In the navigation pane, click Manage Protection > Databases > Oracle > Create job, and then select Restore to open the Restore wizard.
    Tips:
    • You can also open the wizard by clicking Jobs and Operations > Create job > Restore > Oracle.
    • For a running summary of your selections in the wizard, click Preview Restore in the navigation pane 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.
  2. On the Select source page, take the following actions:
    1. Click a source in the list to show the databases that are available for restore operations. You can also use the search function to search for available instances and toggle the displayed instances through the View filter.
    2. Click the plus icon Plus icon next to the database that you want to use as the source of the restore operation. You can select more than one database from the list.

      The selected sources are added to the restore list next to the database list. To remove an item from the list, click the minus icon Minus icon next to the item.

    3. Click Next to continue.
  3. On the Source snapshot page, select the type of restore job that you want to create:
    On-demand: Snapshot
    Runs a one-time restore operation. The restore job starts immediately upon the completion of the wizard.
    On-demand: Point in Time
    Runs a one-time restore job from a point-in-time backup of a database. The restore job starts immediately upon the completion of the wizard.
    Recurring
    Creates a repeating point-in-time restore job that runs on a schedule.
  4. 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

    Option Description
    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 that are 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; point-in-time restore; or recurring restore

    Option Description
    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 > Site pane.
    Cloud service
    The cloud service to which snapshots were copied. The cloud service is defined in the System Configuration > Backup Storage > Object Storage pane.
    Repository server
    The repository server to which snapshots were copied. The repository server is defined in the System Configuration > Backup Storage > Repository Server pane.
    Cloud service archive
    The cloud archive service to which snapshots were copied. The cloud service is defined in the System Configuration > Backup Storage > Object Storage pane.
    Repository server archive
    The repository server to which snapshots were copied to tape. The repository server is defined in the System Configuration > Backup Storage > Repository Server 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.

  5. On the Restore method page, set the restore job to run in test, production, or instant access mode by default.

    For test or production mode, you can optionally enter a new name for the restored database.

    For production mode, you can also specify a new folder for the restored database by expanding the database and entering a new folder name.

    Click Next to continue.

    After the job is created, it can be run in test, production, or instant access mode in the Job Sessions pane.

  6. On the Set destination page, specify where you want to restore the database and click Next.
    Restore to original location
    Select this option to restore the database to the original server.
    Restore to alternate location
    Select this option to restore the database to a local destination that is different from the original server, and then select the alternative location from the list of available servers.
  7. On the Job options page, configure additional options for the restore job and click Next to continue.
    Recovery Options
    Set the following point-in-time recovery options:
    Recover until end of backup
    Restore the selected database to the state at the time that the backup was created.
    Recover until specific point in time
    When log backup is enabled by using an Oracle Backup job definition, point-in-time restore options will be available when you create an Oracle Restore job definition. Select one of the following options, and then click Save:
    • By Time. Select this option to configure a point-in-time recovery from a specific date and time.
    • By SCN. Select this option to configure a point-in-time recovery by System Change Number (SCN).

    IBM Spectrum Protect Plus finds the restore points that directly proceed and follow the selected point in time. During the recovery, the older data backup volume and the newer log backup volume are mounted. If the point in time occurred after the last backup, a temporary restore point is created.

    Application Options
    Set the application options:
    Overwrite existing database
    Enable this option to allow the restore job to overwrite the selected database. By default, this option is not selected.
    Maximum Parallel Streams per Database
    Set the maximum number of parallel data stream from the backup storage per database. This setting applies to each database in the job definition. If the value of the option is set to 1, multiple databases can still be restored in parallel. Multiple parallel streams might improve restore speed, but high bandwidth consumption might affect overall system performance.

    This option is applicable only when you are restoring an Oracle database to its original location by using its original database name.

    Init Params
    This option controls the initialization parameters that are used to start the recovered database in Oracle test and production workflows.
    Source. This option is the default. IBM Spectrum Protect Plus uses the same initialization parameters as the source database, but with the following changes:
    • Parameters that contain paths such as control_files, db_recovery_file_dest, or log_archive_dest_* are updated to reflect the new paths based on the renamed mount points of the recovered volumes.
    • Parameters such as audit_file_dest and diagnostic_dest are updated to point to the appropriate location under the Oracle base directory on the destination server if the path differs from the source server.
    • If a new name is specified for the database, the db_name and db_unique_name parameters are updated to reflect the new name.
    • Cluster-related parameters such as instance_number, thread, and cluster_database are set automatically by IBM Spectrum Protect Plus, depending on the appropriate values for the destination.

    Target. Customize the initialization parameters by specifying a template file that contains the initialization parameters that are used by IBM Spectrum Protect Plus.

    The specified path must point to a plain text file that exists on the destination server and is readable by the IBM Spectrum Protect Plus user. The file must be in Oracle pfile format, consisting of lines in the following format:
    name = value
    Comments that begin with the # character are ignored.
    IBM Spectrum Protect Plus reads the template pfile and copies the entries to the new pfile that is used to start the recovered database. However, the following parameters in the template are ignored. Instead, IBM Spectrum Protect Plus sets their values to reflect appropriate values from the source database or to reflect new paths based on the renamed mount points of the recovered volumes.
    • control_files
    • db_block_size
    • db_create_file_dest
    • db_recovery_file_dest
    • log_archive_dest
    • spfile
    • undo_tablespace

    Additionally, cluster-related parameters like instance_number, thread, and cluster_database are set automatically by IBM Spectrum Protect Plus, depending on the appropriate values for the destination.

    Advanced Options
    Set the advanced job definition options:
    Run cleanup immediately on job failure
    This option enables the automatic cleanup of backup data as part of a restore operation if recovery fails. This option is selected by default. Do not clear this option unless instructed by IBM® Software Support for troubleshooting purposes.
    Allow session overwrite
    Select this option to replace an existing database with a database of the same name during recovery. When an Instant Disk Restore is performed for a database and another database with the same name is already running on the destination host or cluster, IBM Spectrum Protect Plus shuts down the existing database before starting up the recovered database. If this option is not selected, the restore job fails when IBM Spectrum Protect Plus detects a running database with the same name.
    Continue with restores of other databases even if one fails
    Toggle the recovery of a resource in a series if the previous resource recovery fails. If this option is not enabled, the restore job stops if the recovery of a resource fails.
    Protocol Priority (Instant access only)
    If more than one storage protocol is available, select the protocol to take priority in the job. The available protocols are iSCSI and Fibre Channel.
    Mount Point Prefix
    For instant access restore operations, specify the prefix for the path where the mount point is to be directed.
  8. Optional: On the Apply scripts page, specify scripts that can be run before or after an operation runs at the job level. Batch and PowerShell scripts are supported on Windows operating systems, and shell scripts are supported on Linux® operating systems.
    Pre-Script
    Select this check box to choose an uploaded script and an application or script server where the pre-script will run. To select an application server where the pre-script will run, clear the Use Script Server check box. Scripts and script servers are configured on the System Configuration > Script page.
    Post-Script
    Select this check box to choose an uploaded script and an application or script server where the post-script will run. To select an application server where the post-script will run, clear the Use Script Server check box. Scripts and script servers are configured on the System Configuration > Script page.
    Continue job/task on script error
    Select this check box to continue running the job if the script that is associated with the job fails.

    When you select this check box, if a pre-script or post-script completes processing with a nonzero return code, the backup or restore operation is attempted and the pre-script task status is reported as COMPLETED. If a post-script completes processing with a nonzero return code, the post-script task status is reported as COMPLETED.

    If you clear this check box, the backup or restore is not attempted, and the pre-script or post-script task status is reported as FAILED.

  9. Take one of the following actions on the Schedule page:
    • If you are running an on-demand job, click Next.
    • If you are setting up a recurring job, enter a name for the job schedule, and specify how often and when to start the restore job. Click Next.
  10. On the Review page, review your restore job settings and click Submit to create the job.

Results

An on-demand job begins after you click Submit, and the onDemandRestore record is added to the Job Sessions pane shortly. To view the progress of the restore operation, expand the job. You can also download the log file by clicking the download icon Download icon.

A recurring job will begin at the scheduled start time when you start the schedule in the Jobs and Operations > Schedule page.

All running jobs are viewable in the Jobs and Operations > Running Jobs page.

What to do next

Oracle databases are always restored in non-multithreaded mode. If the databases that you restored were originally in multithreaded mode, after the restore operation is completed, you must manually configure credentials and switch the databases to the multithreaded mode.