ApsaraDB RDS for SQL Server supports automatic backup and manual backup. You can specify a backup cycle in a backup policy to automatically back up your the data of your ApsaraDB RDS for SQL Server instance. You can also manually back up your RDS instance. If log backup is enabled for your RDS for SQL Server instance, you can restore the instance to any point in time within the backup retention period.
Backup description
Data backup
RDS for SQL Server supports two data backup methods: physical backup and snapshot backup. For more information, see Use the snapshot backup feature.
Backup method | Feature |
Physical backup |
|
Snapshot backup | Full snapshot backups are periodically performed based on the backup cycle that you specify. Compared with physical backup, the snapshot backup method is faster and has minimal impact on instance performance. |
Log backup
The system automatically generates log backup files for your RDS instance based on the backup frequency that you specify. The following backup frequencies are supported: Same as Data Backup, Every 5 Minutes, and Every 30 Minutes.
NoteThe total size of log backup files does not vary with the backup frequency.
After you change the backup method to Snapshot Backup, the backup frequency can be set only to Every 5 Minutes or Every 30 Minutes.
The log backup feature is enabled by default and cannot be disabled. You can specify a log backup retention period that ranges from 7 days to 730 days.
You can download log backup files.
NoteIf the backup frequency is set to Every 30 Minutes or Every 5 Minutes, you can restore the data of your RDS instance that runs RDS Basic Edition to a specific point in time within the previous 30 minutes or 5 minutes in the event of cloud disk damage or other unexpected failures.
Prerequisites
The AliyunServiceRoleForDBS service-linked role is created by using your Alibaba Cloud account if you use the backup feature of ApsaraDB RDS for the first time.
Usage notes
After you modify the backup time of your RDS instance, a backup may be triggered 2 minutes later. This may cause high I/O bandwidth on the primary RDS instance and affect your workloads. We recommend that you modify the backup time during off-peak hours to minimize the impact of resource consumption caused by backup operations on the performance of your RDS instance.
When you perform a physical backup on your RDS instance, the backup speed is fast and cannot be limited. This may cause high I/O bandwidth and affect your workloads. To minimize the impact on the performance of your RDS instance, we recommend that you perform physical backups during off-peak hours.
If your RDS instance has a large amount of data, a backup may require a long period of time.
You cannot back up or restore cold storage databases.This applies if you enable the feature to archive data to an Object Storage Service (OSS) bucket and the required database is converted into a cold storage database.
Backup files are retained for a specific period of time. Before the retention period elapses, we recommend that you download the backup files that need to be retained for a long period of time to your computer. This prevents data loss due to expiration.
The RDS instance collects traffic statistics from the network interface controllers to reflect the bandwidth usage in SQL Server. Statistics about the traffic that is consumed by data backups are also collected. The amount of traffic on your RDS instance surges during a data backup.
Billing rules
Each RDS instance is allocated a free quota for backup storage. If the backup storage of your RDS instance does not exceed the free quota, you are not charged for backup storage. If the backup storage exceeds the free quota, you are charged for the excess storage that you use. For more information about the free quota and billing rules, see Backup storage fees.
Configure automatic backups
After you configure a backup policy for your RDS instance, the system automatically and periodically backs up the RDS instance based on the backup policy. In some regions, you can use the spare backup feature by enabling the advanced backup settings on the Backup Strategy tab. If you cannot find the entry point to enable the advanced backup settings on the Backup Strategy tab, submit an application. For more information, see Switch to the advanced backup settings and Use the spare backup feature. After you enable the advanced backup settings, the entry point to configure backup policies and the method to configure some parameters are changed. You must configure the backup policies and parameters based on your business requirements.
Regular backup (before the upgrade)
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.
In the left-side navigation pane, click Backup and Restoration.
On the Backup Strategy tab of the Backup and Restoration page, click Edit in the Data Backup Settings section.
In the dialog box that appears, configure the following parameters and click Save.
Parameter
Description
Data Backup Retention (Days)
The data backup retention period. Valid values: 7 to 730. Default value: 7. Unit: days.
Backup Cycle
The cycle based on which you want to perform a backup. You must select at least two days of the week.
Backup Method
The backup method that you want to use. Valid values:
Snapshot Backup: The system backs up the data from cloud disks at a specific point in time. The backup speed is fast.
Physical Backup: This is the default backup method. The system creates a replica of the data of your RDS instance. The backup speed is slow.
ImportantAfter you change the backup method to Snapshot Backup, you can still perform a Physical Backup when you manually back up your RDS instance. For more information, see Back up an ApsaraDB RDS for SQL Server instance.
Backup Priority
The backup priority of the backup method that you select. This parameter is available only if your RDS instance runs RDS Cluster Edition and uses the Physical Backup. Valid values:
Primary Instance Only: Backups are performed only on the primary RDS instance.
Secondary Instance Preferred: Backups are performed on the secondary RDS instance. This helps reduce the I/O loads of the primary RDS instance and improve instance performance and stability. If the secondary RDS instance does not meet the backup conditions, backups are automatically performed on the primary RDS instance. For example, if the secondary RDS instance is unavailable, backups are automatically performed on the primary RDS instance.
NoteThis parameter is available only if your RDS instance runs RDS Cluster Edition. If you set this parameter to Secondary Instance Preferred, incremental backup and 5-minute log backup are not supported.
Incremental backup
Specifies whether to enable the incremental backup feature.
NoteIf you set the Backup Method parameter to Snapshot Backup or your RDS instance runs RDS Cluster Edition and uses the Physical Backup method, you cannot enable the incremental backup feature.
Backup Time
The period of time during which a data backup operation is performed. For example, you can set this parameter to 06:00-07:00. We recommend that you select an off-peak hour.
Backup Frequency
The frequency to generate log backup files. Valid values: Same as Data Backup, Every 5 Minutes, and Every 30 Minutes.
ImportantThe log backup retention period is the same as the data backup retention period. You cannot separately configure the log backup retention period.
If you set the Backup Priority parameter to Secondary Instance Preferred, 5-minute log backup is not supported.
Sparse backup (after the upgrade)
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.
In the left-side navigation pane, click Backup and Restoration.
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.
Configure the following parameters and click OK.
Parameter
Description
Backup Policy
The time range within which the backup is performed and the retention period of the backup sets. The backup must be performed at least twice a week.
NoteYou can click Add Backup Policy to configure the sparse backup feature. This way, you can configure backup policies in a more flexible manner and retain the minimum number of backup sets.
Backup Time
The period of time during which a backup operation is performed. For example, you can set this parameter to 07:00-08:00. We recommend that you select an off-peak hour.
Incremental Backup
Specifies whether to enable the incremental backup feature.
NoteIf you set the Backup Method parameter to Snapshot Backup, you cannot enable the incremental backup feature.
Backup Method
The backup method that you want to use. Valid values:
Snapshot Backup: The system backs up the data from cloud disks at a specific point in time. The backup speed is fast.
Physical Backup: This is the default backup method. The system creates a replica of the data of your RDS instance. The backup speed is slow.
ImportantAfter you change the backup method to Snapshot Backup, you can still perform a Physical Backup when you manually back up your RDS instance. For more information, see Back up an ApsaraDB RDS for SQL Server instance.
Backup Frequency
The frequency to generate log backup files. Valid values: Same as Data Backup and Every 30 Minutes.
NoteThe log backup retention period is the same as the data backup retention period. You cannot separately configure the log backup retention period.
Log Backup Retention Period
The log backup retention period. The log backup retention period must be less than or equal to the data backup retention period. Valid values: 7 to 7300. Unit: days. Default value: 7.
On the Backup Strategy tab, click Save in the lower-left corner.
Configure manual backups
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.
In the upper-right corner of the page, click Backup Instance.Backup Instance
Configure the following parameters and click OK.
Parameter
Description
Backup Policy
Snapshot Backup: The system backs up the data from cloud disks at a specific point in time. The backup speed is fast.
Physical Backup: This is the default backup method. The system creates a replica of the data of your RDS instance. The backup speed is slow.
NoteThe Snapshot Backup option is displayed only when the automatic backup policy is set to Snapshot Backup.
Select Backup Mode
Full Backup: The system immediately performs a full backup.
Automatic Backup: If no full backup has been performed for the instance within the latest three days, the system immediately performs a full backup. Otherwise, the system immediately performs a differential backup.
NoteIf the RDS instance runs RDS Cluster Edition, the automatic backup policy is set to Physical Backup, and Secondary Database Preferred is selected, only Full Backup is supported.
Backup Policy
This parameter is available only when the Select Backup Mode parameter is set to Full Backup.
Instance Backup: The system backs up all data of your RDS instance.
Single-Database Backup: The system backs up only the databases that you specify. This parameter is available only if the Backup Policy parameter is set to Physical Backup.
NoteIf you select Single-Database Backup, the Database section appears. In this section, select the databases that you want to back up from the left-side list and click the > icon to move the selected databases to the right-side list. If no databases are created on your RDS instance, you must create databases before you back up your RDS instance. For more information, see Create a database on an ApsaraDB RDS for SQL Server instance.
After you configure a backup policy, a backup task is created. You can click the
icon in the upper-right corner of the page. On the Tasks page, set the Task Type parameter to Manual Backup and view the progress of the backup task.
NoteAfter the backup task is complete, you can download the backup file on the Data Backup or Log Backup tab on the Base Backups tab of the Backup and Restoration page.
References
You can download existing data backup files or log backup files to your on-premises device for archiving.
You can use data backups and log backups to restore data to an existing RDS instance, a new RDS instance, or a self-managed SQL Server instance. For more information, see Methods to restore an ApsaraDB RDS for SQL Server instance.
The default backup feature that is provided by the system stores backup files in the same region as your RDS instance. For more information about how to store backup files in a region that is different from the region of your RDS instance, see Use the cross-region backup feature.
You can also call the following API operations to manage the backup policy of an RDS instance: