The smsap backup restore command
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 | -from-secondary [-temp-volume temp_volume] [-copy-id id]] [-preview] [-fast {-require | -override | -fallback | -off}] [-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. -
-tablespaces list
: Restores only the specified tablespaces from the backup.You must use spaces to separate the names in the list.
-
-files list
: 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. -
-from-secondary
: Restores the data from secondary storage.You cannot use this option if the backup exists on primary storage; the primary backup must be freed before a backup can be restored from secondary storage. If you use a temporary volume, you must specify the volume by using the
-temp-volume
option.You must specify the
-copy-id
option whenever you specify the-from-secondary
option. If there is more than one backup on the secondary storage system, the-copy-id
option is used to specify which backup copy on the secondary storage should be used for the restore operation.If you are using Data ONTAP operating in 7-Mode, you must specify a valid value for the -copy-id
option. However, if you are using clustered Data ONTAP, the-copy-id
option is not requiredWhen restoring from secondary storage, SnapManager first attempts to restore data directly from the secondary storage system to the primary storage system (without involving the host). If SnapManager cannot perform this type of restore (for example, if the files are not part of the file system), then SnapManager will fall back to a host-side file copy restore. SnapManager has two methods for performing a host-side file copy restore from secondary. The method that SnapManager selects is configured in the
smsap.config
file. -
Direct: SnapManager clones the data on secondary storage, mounts the cloned data from the secondary storage system to the host, and then copies data out of the clone into the active environment.
This is the default secondary access policy.
-
Indirect: SnapManager first copies the data to a temporary volume on primary storage, mounts the data from the temporary volume to the host, and then copies data out of the temporary volume into the active environment.
This policy should be used only if the host does not have direct access to the secondary storage system. Restores using the indirect method will take twice as long as the direct secondary access policy because two copies of the data are made.
The decision whether to use the direct or indirect method is controlled by the value of the
restore.secondaryAccessPolicy
parameter in thesmsap.config
configuration file. -
-
-preview
Displays the following information:
-
Which restore mechanism (fast restore, 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. -
The
-fast
option (-require, -override, -fallback,
or-off
) has significant impact on the output. 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 thesmsap.config
file. -
-
-fast
Enables you to choose the process to use in the restore operation. You can force SnapManager to use the volume-based fast restore process rather than other restore processes, if all mandatory restore eligibility conditions are met. If you are aware that a volume restore cannot be performed, you can also use this process to prevent SnapManager from conducting eligibility checks and the restore operation by using the fast restore process.
The
-fast
option includes the following parameters:-
-require
: Enables you to force SnapManager to perform a volume restore, if all restore eligibility conditions are met.If you specify the
-fast
option, but do not specify any parameter for-fast
, SnapManager uses the-require
parameter as a default. -
-override
: Enables you to override the non-mandatory eligibility checks and perform the volume-based fast restore process. -
-fallback
: Enables you to restore the database by using any method that SnapManager determines.If you do not specify the
-fast
option, SnapManager uses the defaultbackup restore -fast fallback
option. -
-off
: Enables you to avoid the time required to perform eligibility checks.
-
-
-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. For Real Application Clusters (RAC), you must include the
-force
option if SnapManager has to change the state of any RAC instance to a lower state.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