All Products
Search
Document Center

ApsaraDB RDS:Use the sparse backup feature

更新時間:Apr 26, 2024

In addition to regular backups, ApsaraDB RDS for SQL Server supports sparse backups. The sparse backup feature allows you to configure backup policies in a more flexible manner and retain the minimum number of backup sets. This reduces the period of time that is required to restore data from backup sets and reduces the storage costs of backup sets. This topic describes how to use the sparse backup feature.

Differences between regular backup and sparse backup

Item

Regular backup

Sparse backup

Retention policy

Backup sets are retained based on the retention period that you specify, and at least two and up to seven backup sets must be retained every week.

For example, a backup set is retained every Monday and Sunday for 365 days.

You can configure backup policies in a more flexible manner and retain the minimum number of backup sets.

For example, a backup set is retained every Monday and Sunday for seven days, and a backup set is permanently retained on the last day of each month.

Storage cost

A large number of regular backup sets are generated, which increases storage costs.

The backup policies can be configured in a more flexible manner. The minimum number of backup sets is retained, which lowers storage costs.

Prerequisites

  • If this is the first time you use the backup feature of ApsaraDB RDS, you must attach the AliyunServiceRoleForDBS policy by using your Alibaba Cloud account. For more information, see How do I create a service-linked role for DBS?

  • The advanced backup settings are enabled. For more information, see Switch to the advanced backup settings.

    Note

    To use the sparse backup feature, you must switch to the advanced backup settings and configure backup policies. For more information, see Procedure.

Usage notes

  • After you configure a sparse backup policy, the configuration takes effect within approximately 10 to 15 minutes.

  • The backup policy in the first row is fixed and cannot be deleted. For the first backup policy, you must set the Backup Policy parameter to Every Week. After you select Every Week, you must also specify at least two days of a week.

  • If you configure more than one sparse backup policies to back up data on the same day, only one backup set is generated on the day and is retained based on the longest retention period among the policies.

  • If you delete a backup policy, the generated backup sets are still retained for the retention period for the policy. For more information, see Delete a backup policy.

  • After you configure sparse backup policies, if no backup set is created or dumped within the backup window on the day that you specify, the backup set on that day is skipped and no backup set is retained. This issue may occur due to various reasons, such as backup failure, the instance being locked, or the failure to dump the level-1 backup set within its validity period.

    For example, you configure a backup policy to perform a backup on the first day of every month and retain the backup set for 30 days. If the backup fails on December 1, no backup set will be retained for that day.

  • You cannot separately use incremental backup sets to restore data of your RDS instance. You can use the full backup set on which the incremental backup sets depend to restore data of your RDS instance. Before you enable the sparse backup feature and switch to the advanced backup settings, if the generated full backup sets expire, you cannot use the incremental backup sets that depend on these full backup sets to restore data of your RDS instance. For more information, see Switch to the advanced backup settings.

  • After you enable the sparse backup feature and switch to the advanced backup settings, the system converts the most recent incremental backup set into a full backup set and delivers the full backup set during the next full backup. For more information, see Switch to the advanced backup settings.

Billing rules

A free quota on backup storage is provided for your RDS instance. If the total size of the backup files of your RDS instance does not exceed the free quota, no backup fees are generated. If the total size exceeds the free quota, you are charged for the excess backup storage that you use. For more information about the free quota and billing rules, see Backup storage fees.

Procedure

You must manually configure backup policies to retain the minimum number of backup sets.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Backup Strategy tab. On the tab that appears, move the pointer over the circled number between SQL Server and Level-1 Backup to view the backup policies that you configured.

    image.png

  4. In the dialog box that appears, click Add Backup Policy, configure sparse backup policies, and click OK.

    Backup cycle

    Backup time

    Retention period

    Every Week

    You can select one or more days of the week.

    You can configure a retention period for each backup policy. The retention period ranges from 7 to 7,300 days.

    Note

    You can also select Long-term Retention to the right of a backup policy to retain backup sets for a long period of time.

    Every Month

    You can select one or more days of the month or Last Day of Each Month.

    Every Year

    You can select a day of the year. For example, you can select January 1 of each year.

    Note
  5. Click Save in the lower-left corner of the Backup Strategy tab.

Configuration example

image.png

The preceding figure is used as an example to describe different backup policies.

  • 1: Data is backed up every day of a week, and each backup set is retained for seven days.

  • 2: Data is backed up every Monday, and the backup set is retained for 30 days.

  • 3: Data is backed up on the first day and last day of each month, and the backup set is retained for 365 days.

  • 4: Data is backed up once every year on January 1, and the backup set can be retained for a long period of time.

What to do next

Query backup policies

On the Backup Strategy tab, move the pointer over the circled number to view the backup policies that you configured.

Note

The number in the circle indicates the number of backup policies that you configured.

image.png

Delete a backup policy

On the Level -1 Backup page, you can click the 删除 icon to delete a backup policy.

Note

The backup policy in the first row is fixed and cannot be deleted. For the first backup policy, you must set the Backup Policy parameter to Every Week. After you select Every Week, you must also specify at least two days of a week.

image

Switch to the advanced backup settings

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Backup Strategy tab and click Switch to Advanced Backup Policy.

    image.png

    Important

    If Switch to Advanced Backup Policy is not displayed on the tab, submit an application. After your application is approved, refresh the page.

  4. In the dialog box that appears, select Understood and click OK.

    Important

    After you switch to the advanced backup settings, you cannot switch back to the previous backup settings.

    If the information similar to the following figure is displayed, the advanced backup settings are enabled. Then, you can configure a sparse backup policy. For more information, see Procedure.

    image.png