Skip to main content
SnapManager for SAP

Perform backup, restore, and clone operations using prescript and post-scripts

Contributors

You can use your own script while initiating a backup, restore, or clone operation. SnapManager displays a Task-enabling page in the Backup Create wizard, Restore or Recover wizard, or Clone Create wizard, where you can select the script and provide values for any parameters required by the script.

What you'll need

  • Install the plug-in scripts in the correct SnapManager installation location.

  • Verify that the plug-ins are installed correctly by using the smsap plugin check command.

  • Ensure that you are using the BASH shell.

About this task

In the command-line interface (CLI), list the script name, select the parameters, and set the values.

Steps
  1. To verify that you are using the BASH shell, enter the following command at the command prompt:

    bash

    Alternately, you can enter the which-bash command at the prompt, and use the command output as the start parameter of the script.

    The BASH shell is operating properly if you do not see an error.

  2. For the backup operation, enter the -taskspec option and provide the absolute path of the task specification XML file for performing a preprocessing or a post-processing activity to occur before or after the backup operation:

    smsap backup create -profile profile_name {[-full {-online | -offline | -auto} [-retain {-hourly | [-daily | -weekly | -monthly | -unlimited}] [-verify] | [-data [[-files files [files]] | [-tablespaces -tablespaces [-tablespaces]] [-datalabel label] {-online | -offline | -auto} [-retain {-hourly | [-daily | -weekly | -monthly | -unlimited]} [-verify] | [-archivelogs [-label label] [-comment comment] [-backup-dest path1 [,[path2]]] [-exclude-dest path1 [,path2]]] [-prunelogs {-all | -untilSCN untilSCN | -before {-date yyyy-MM-dd HH:mm:ss | -months | -days | -weeks | -hours}} -prune-dest prune_dest1,[prune_dest2]] [-taskspec taskspec] [-include-with-online-backups | -no-include-with-online-backups]} -dump [-force] [-quiet | -verbose]

    If the backup plug-in operation failed, only the plug-in name and return code are displayed. Your plug-in script must include log messages and redirect the messages to the user-defined log files.

  3. For the backup restore operation, enter the -taskspec option and provide the absolute path of the task specification XML file for performing a preprocessing or a post-processing activity to occur before or after the restore operation:

    smsap backup restore -profile profile_name {-label <label> | -id <id>} {-files <files>|-tablespaces <tablespaces> | -complete | -controlfiles} [-recover {-alllogs | -nologs | -until <until>}][-restorespec <restorespec>] [-taskspec <taskspec>] [-verify][-force] backup restore -fast [require | override | fallback | off] [-preview] -dump [-quiet | -verbose]

    If the restore plug-in operation failed, only the plug-in name and return code are displayed. Your plug-in script must include log messages and redirect the messages to the user-defined log files.

  4. For the clone create operation, enter the -taskspec option and provide the absolute path of the task specification XML file for performing a preprocessing or a post-processing activity to occur before or after the clone operation:

    smsap clone create -profile profile_name {-backup-label backup_name | -backup-id <backup-id>| -current} -newsid new_sid- clonespec full_path_to_clonespecfile [-reserve <yes, no, inherit>] [-host <host>] [-label <label>] [-comment <comment>] {-taskspec <taskspec>] -dump [-quiet | -verbose]

    If the clone plug-in operation failed, only the plug-in name and return code are displayed. Your plug-in script must include log messages and redirect the messages to the user-defined log files.

Example of creating a backup using the task specification XML file

smsap backup create -profile SALES1 -full -online -taskspec sales1_taskspec.xml -force -verify