Skip to main content
SnapManager for SAP

Create backup schedules

Contributors

You can schedule a backup to occur at the time and frequency that are suited for your data and environment.

About this task

From SnapManager 3.2 for SAP, you can schedule the backups of the archive log files separately. However, you must use the profile that you created to separate the archive log files.

If you have scheduled the backups of the data files and archive log files at the same time, then SnapManager creates the data files backup first.

If you select the schedule interval as -onetimeonly, then all the pruning options are available. If you select a schedule interval other than -onetimeonly, then the pruning options -until-SCN and -until-date are not supported and the following error message is displayed: The archive log pruning option you have specified, -until-scn or -until-date for the schedule interval hourly is invalid. Specify either the -onetimeonly option for the schedule interval, or prune the archive logs using any one of the option all, or -before {-months | -days | -weeks| -hours}.

When a failover happens in Microsoft Windows Server Failover Cluster (WSFC) and Microsoft Cluster Server (MSCS) environments, you must restart the SnapManager for SAP server so that the service (virtual) address is mapped to the active host and the SnapManager schedules are adjusted to the active SnapManager host.

Note If the same profile and schedule name exists in another repository, the backup scheduling operation is not initiated in that repository. The operation will exit with the following message: operation is already running.
Step
  1. Enter the following command:

    smsap schedule create -profile profile_name {[-full {-online | -offline | -auto}[-retain [-hourly | -daily | -weekly | -monthly | -unlimited] [-verify]] | [-data [-files files [files]] | [-tablespaces -tablespaces [-tablespaces]] {-online | -offline | -auto}[-retain [-hourly | -daily | -weekly | -monthly | -unlimited] [-verify]] | [-archivelogs]} [-comment comment][-backup-dest path1 [,[path2]] [-exclude-dest path1 [,path2]] [-prunelogs{-all | -untilSCN untilSCN | -until-date yyyy-MM-dd HH:mm:ss | -before {-months | -weeks | -days | -hours}} -prune-dest prune_dest1,prune_dest2] -schedule-name schedule_name [-schedule-comment schedule_comment] -interval {-hourly | -daily | -weekly | -monthly | -onetimeonly} -cronstring cronstring -start-time {start-time start_time <yyyy-MM-dd HH:mm>} -runasuser -runasuser [-force] [-taskspec -taskspec] [-quiet | -verbose]

    If you want to…​ Then…​

    Schedule a backup of an online or offline database

    Specify -offline or -online to schedule a backup of the offline or online database. If you specify these, you cannot use -auto.

    Let SnapManager handle scheduling of a database regardless of whether it is online or offline

    Specify -auto. If you specify -auto, you cannot use --offline or -online.

    Schedule a backup of data files

    Specify -data -files to list the files separated by commas. For example, use file names f1,f2,f3.

    Schedule a partial backup of specific tablespaces

    Specify -tablespaces to list the tablespaces separated by commas. For example, use ts1,ts2,ts3.

    Schedule backup of archive log files

    Specify the following:

    • -archivelogs to schedule backup of the archive log files

    • -backup-dest to schedule archive log file destinations to be included in the backup

    • -exclude-dest to schedule the archive log destinations to be excluded from the backup

    Specify the retention class values

    Specify -retain and indicate whether the backup should be retained according to one of the following retention classes:

    • -hourly

    • -daily

    • -weekly

    • -monthly

    • -unlimited SnapManager defaults to hourly.

    Schedule pruning of archive log files

    Specify the following: -prunelogs to prune the archive log files while scheduling a backup -prune-dest to specify the archive log destination from which the archive log files are pruned

    Include a name for the schedule

    Specify -schedule-name.

    Schedule backup of the database at a specific time interval

    Specify the interval option and select the time interval from the following, by which the backups should be created:

    • -hourly

    • -daily

    • -weekly

    • -monthly

    • -onetimeonly

    Configure a schedule

    Specify -cronstring and include the following seven subexpressions that describe the individual option:

    • 1 refers to seconds.

    • 2 refers to minutes.

    • 3 refers to hours.

    • 4 refers to a day in a month.

    • 5 refers to the month.

    • 6 refers to a day in a week.

    • (Optional) 7 refers to the year.

    Note

    If you scheduled your backup with different times in -cronstring and -start-time, then the schedule of the backup is overwritten and triggered by the -start-time.

    Add a comment about the backup schedule

    Specify -schedule-comment followed by the description string.

    Specify the start time of the schedule operation

    Specify -start-time in the yyyy-mm-dd hh:mm format.

    Change the user of the scheduled backup operation while scheduling the backup

    Specify -runasuser. The operation runs as the user (root user or Oracle user) who created the schedule. However, you can use your own user ID, if you have valid credentials for both the database profile and host.

    Enable a pretask or post-task activity of the backup schedule operation by using the pretask and post-task specification XML file

    Specify 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 schedule operation.