Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP SQL Anywhere, on-demand edition 1.0 SP 6 » Task syntax

CreateMaintenancePlan task

Creates a cloud maintenance plan.

Syntax 1 (SQL)
CALL DBCloud.CreateMaintenancePlan ( plan_name=plan_name, host=host, full_schedule=full_schedule [, optional-parameters ] )
Syntax 2 (Cloud Command utility)
dbcloudcmd run CreateMaintenancePlan plan_name host full_schedule [ optional-parameters ]
  • plan

    An output parameter. Internal use only.

  • plan_name

    The plan name. (Required)

  • host

    The target host to store backups. Accepts a search query that identifies hosts. The search query can be a list of host names or IDs separated by semicolons (;), or a full search. An appropriate host is selected from this list and the backup is stored there. (Required)

  • full_schedule

    The schedule for full backups. (Required)

  • incremental_schedule

    The schedule for incremental backups. The default is NULL.

  • set_default

    Set to 1 to make the new plan the default maintenance plan. The default is 0.

  • user

    The owner of the maintenance plan. Accepts a search query that identifies one user, for example a user name or ID. The default is the current user.

  • min_backups_to_keep

    The minimum number of full backups that should be kept before the oldest backups will be deleted. The default is 3.

  • min_days_to_keep

    The minimum number of days that full backups should be kept before they can be deleted. The default is 7.

  • failed_backups_before_alert

    The number of failed backups within the most recent group before an alert is issued. The default is 3.

  • failed_backup_group_size

    The minimum number of recent backups in which we look for failed backups. The default is 10.

Required privileges

BackupDatabase, RunScheduleTask


This task creates a maintenance plan for the cloud that allows you to schedule automatic, recurring backups for a database or group of databases.


The full_schedule and incremental_schedule parameters accept an XML string containing the schedule information. The XML string must be specified as follows and must include one or more of the listed XML elements:

XML elements Description
<time_range start_time="xx"/> Start time. Format may vary depending on command shell being used.
<start_date date="xx"/> Start date. Format may vary depending on command shell being used.
<interval frequency="xx" units="yy"/> Frequency of event. xx is an integer and yy is one of "HOURS", "MINUTES", or "SECONDS".
<days_of_week><dow day="xx"/></days_of_week> Day of the week. xx is a string as in "Sunday" or "Monday", etc.
<days_of_month><dom day="xx"/></days_of_month> Day of the month. xx is an integer between 0 and 31, with 0 being the last day of the month.

When a maintenance plan is executed, stale backups of each database using the plan will be deleted according to the criteria stored in the min_backups_to_keep and min_days_to_keep fields in the maintenance plan. Backups less than min_days_to_keep days old are always saved, and the most recent min_backups_to_keep full backups are always saved. Any incremental backups based on these backups are also saved. Any older backups may be deleted when the maintenance plan executes.


Run the following task to create a maintenance plan called myplan that runs a full backup every Thursday at 4:00 PM and stores the backups on the host myhost5:

dbcloudcmd run CreateMaintenancePlan plan_name=myplan host=myhost5 full_schedule="<schedule><time_range start_time=\"16:00:00\"/>
     <dow day=\"Thursday\"/></schedule>"

Run the following task to create a maintenance plan called myplan2 that runs a full backup every Monday and Thursday at 1:00 AM, and an incremental backup every Wednesday, Friday, and Sunday at 5 AM and stores the backups on any available host:

dbcloudcmd run CreateMaintenancePlan plan_name=myplan2 host="status:running" full_schedule="<schedule><time_range start_time=\"1:00:00\"/>
<dow day=\"Monday\"/><dow day=\"Thursday\"/></schedule>" incremental_schedule="<schedule><time_range start_time=\"5:00:00\"/>
<dow day=\"Wednesday\"/><dow day=\"Friday\"/><dow day=\"Sunday\"/></schedule>"