Skip to main content
SnapManager for SAP

The smsap backup restore command

Contributors

You can run the backup restore command to restore backups of a database or a portion of a database, and then optionally recover the database information.

Syntax

smsap backup restore
-profile profile_name
[-label label | -id id]
[-files files [files...] |
-tablespaces tablespaces [tablespaces...]] |
-complete | -controlfiles]
[-recover {-alllogs | -nologs | -until until} [-using-backup-controlfile]]
[-restorespec restorespec | ]]
[-preview]

[-recover-from-location path1 [, path2]]
[-taskspec taskspec]
[-dump]
[-force]
[-quiet | -verbose]

Parameters

  • -profile profile_name

    Specifies the database that you want to restore. The profile contains the identifier of the database and other database information.

  • -label name

    Restores the backup with the specified label.

  • -id guid

    Restores the backup with the specified GUID. The GUID is generated by SnapManager when you create a backup. You can use the smsap backup list command to display the GUID for each backup.

  • Choose all or specified files

    Optionally, you can use one of the following options:

    • -complete: Restores all the data files in the backup.

    • -tablespaceslist: Restores only the specified tablespaces from the backup.

      You must use spaces to separate the names in the list.

    • -fileslist: Restores only the specified data files from the backup.

      You must use spaces to separate the names in the list. If the database is running, SnapManager ensures that the tablespace containing the files is offline.

  • -controlfiles

    Restores the control files. SnapManager allows you to restore control files along with the data files from the backups in a single operation. The -controlfiles option is independent of other restore scope parameters such as -complete, -tablespaces, and -files.

  • -recover

    Recovers the database after restoring it. You must also specify the point to which you want SnapManager to recover the database by using one of the following options:

    • -nologs: Recovers the database to the time of the backup and applies no logs.

      You can use this parameter for online or offline backups.

    • -alllogs: Recovers the database to the last transaction or commit, and applies all required logs.

    • -until date: Recovers the database up to the date and time specified.

      You must use the year-month-date: hour: minute: second (yyyy-mm-dd:hh:mm:ss) format. For hours, use either 12-hour or 24-hour format, depending on the database setting.

    • -until scn: Rolls forward the data files until it reaches the specified system change number (SCN).

    • -using-backup-controlfile: Recovers the database using the backup control file.

  • -restorespec

    Enables you to restore the data to an active file system and restore from the specified data by providing a mapping of each original Snapshot copy to its active file system. If you do not specify an option, SnapManager restores the data from the Snapshot copies on primary storage. You can specify one of the following options:

    • -restorespec: Specifies the data to restore and the restore format.

  • -preview

    Displays the following information:

    • Which restore mechanism (storage-side file system restore, storage-side file restore, or host-side file copy restore) will be used to restore each file

    • Why more efficient mechanisms were not used to restore each file, when you specify the -verbose option If you are using the -preview option, you must know the following:

    • The -force option has no impact on the command.

    • The -recover option has no impact on the command. To preview the restore operation, the database must be mounted. If you want to preview a restore plan, and the database currently is not mounted, then SnapManager mounts the database. If the database cannot be mounted, then the command will fail, and SnapManager returns the database to its original state.

    The -preview option displays up to 20 files. You can configure the maximum number of files to be displayed in the smsap.config file.

  • -recover-from-location

    Specifies the external archive log location of the archive log files. SnapManager takes the archive log files from the external location and uses them for the recovery process.

  • -taskspec

    Specifies the task specification XML file for preprocessing activity or post-processing activity of the restore operation. You must provide the complete path of the task specification XML file.

  • -dump

    Specifies to collect the dump files after the restore operation.

  • -force

    Changes the database state to a lower state than its current state, if necessary.

    By default, SnapManager can change the database state to a higher state during an operation. This option is not required for SnapManager to change the database to a higher state.

  • -quiet

    Displays only error messages in the console. The default setting is to display error and warning messages.

  • -verbose

    Displays error, warning, and informational messages in the console. You can use this option to see why more efficient restore processes could not be used to restore the file.

Example

The following example restores a database along with the control files:

smsap backup restore -profile SALES1 -label full_backup_sales_May
-complete -controlfiles -force