All Products
Search
Document Center

ApsaraDB RDS:Back up an ApsaraDB RDS for SQL Server instance

Last Updated:Oct 12, 2024

ApsaraDB RDS for SQL Server supports automatic backup and manual backup. You can specify a backup cycle in a backup policy for the system to automatically back up your ApsaraDB RDS for SQL Server instance. You can also manually back up your RDS instance.

Backup description

Data backup

Backup method

Feature

Physical backup

  • Full physical backups and incremental physical backups are supported. Logical backups are not supported.

  • By default, the incremental backup feature is enabled to reduce the size of backup files. Automatic backups are performed based on the backup cycle of a full backup following incremental backups.

    Click to view the incremental backup policy

    • After a full backup is successfully performed, the system automatically performs an incremental backup within three days starting from the day on which the full backup is performed. The system automatically performs a full backup three days after the previous full backup.

    • Before an incremental backup is performed, the system automatically checks whether new databases are created after the previous full backup. If one or more databases are created after the previous full backup, a full backup instead of the incremental backup is performed to ensure data in the new databases is also backed up.

    • If data may be damaged, the system automatically performs a full backup. For example, data may be damaged due to database creation failures or previous data backup failures.

    • If you perform a full backup during a backup cycle, the system automatically performs an incremental backup within three days starting from the day on which the full backup is performed.

    Note
    • If the backup frequency is once a day, the system performs a full backup on the first day of a backup cycle and performs two consecutive incremental backups within the remaining two days following the full backup.

    • If the incremental backup feature is disabled, no incremental backups are performed. Instead, full backups are performed within the backup cycle.

  • Backups for individual databases are supported. You can back up one or more databases of your RDS instance.

  • The system shrinks the transaction logs of the RDS instance during each backup. You can log on to the ApsaraDB RDS console and go to the Backup and Restoration page of your RDS instance. Then, click Shrink Transaction Log to manually shrink transaction logs.

  • The primary database only and secondary database preferred backup modes are supported for RDS instances that run RDS Cluster Edition. You can configure settings to allow physical backups to be performed on the secondary RDS instance. This reduces the I/O loads of the primary RDS instance and improves instance performance and stability.

Snapshot backup

Full snapshot backups are performed based on the backup cycle that you specify. The snapshot backup method is faster and supports larger amounts of data than the physical backup method.

Note

Snapshot backups are used to periodically back up data snapshots on cloud disks. You can use the snapshots to quickly restore data to a specific point in time. For more information, see Use the snapshot backup feature.

Log backup

  • The system automatically generates log backup files for your RDS instance based on the backup frequency that you specify. The Same as Data Backup and Every 30 Minutes backup frequencies are supported.

    Note
    • The total size of log backup files does not vary based on the backup frequency.

    • After you change the backup method to Snapshot Backup, the backup frequency is fixed as 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. For more information, see Download data backup files and log backup files.

    Note

    If the backup frequency is set to Every 30 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 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. For more information, see How do I create a service-linked role for DBS?

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. To minimize the impact on the performance of your RDS instance, we recommend that you modify the backup time of your RDS instance during off-peak hours.

  • 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.

  • Backup files are retained for a specific period of time. Before the retention period elapses, we recommend that you download the required backup files to your computer.

  • If your RDS instance runs RDS Basic Edition, RDS High-availability Edition, or RDS Cluster Edition, the RDS instance collects traffic statistics from the network interface controllers to better 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.

  • If your RDS instance runs RDS Cluster Edition and uses the Physical Backup method, you can specify a backup priority. You can determine whether to use the primary database only or secondary database preferred backup mode for the RDS instance. For more information, see RDS Cluster Edition. Take note of the following items:

    • The default backup mode for a new RDS instance that runs RDS Cluster Edition is primary database only.

    • The secondary database backup feature does not support incremental backups. If you use this feature, the system performs full backups instead of incremental backups. This increases the amount of backup data. To prevent an excessively large amount of backup data, we recommend that you modify the backup policy. For example, you can change the backup policy from one backup every day to one backup every two days.

    • If you use the secondary database preferred mode for your RDS instance that runs RDS Cluster Edition, backups are preferentially performed on the secondary RDS instance. 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.

    • If you change the backup policy to secondary database backup and change the backup time, a full backup may be triggered 2 minutes later. In this case, if the secondary RDS instance does not meet the backup conditions, backups are automatically performed on the primary RDS instance. This affects your workloads. For example, if the secondary RDS instance is unavailable, backups are automatically performed on the primary RDS instance. To reduce the impact of resource consumption caused by backup operations on instance performance, we recommend that you modify the backup policy and backup time during off-peak hours.

    • Transaction log shrinking is forcefully performed on the primary RDS instance, and cannot be performed on the secondary RDS instance. If the RDS instance uses the secondary database backup policy and you manually shrink the transaction logs of the instance, transaction log shrinking is forcefully scheduled to the primary RDS instance.

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)

  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 Strategy tab of the Backup and Restoration page, click Edit in the Data Backup Settings section.

  4. 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. For more information, see Enable the snapshot backup feature.

    • 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.

    Important

    After 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.

    Note

    This parameter is available only if your RDS instance runs RDS Cluster Edition. If you set this parameter to Secondary Instance Preferred, incremental backup is not supported. For more information, see Usage notes.

    Incremental backup

    Specifies whether to enable the incremental backup feature. For more information, see Backup description.

    Note

    If 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 and Every 30 Minutes.

    Important

    The log backup retention period is the same as the data backup retention period. You cannot separately configure the log backup retention period. For more information about log backups, see Back up an ApsaraDB RDS for SQL Server instance.

Sparse backup (after the upgrade)

  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. 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.

    Note

    You 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. For more information, see Use the sparse backup feature.

    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. For more information, see Backup description.

    Note

    If 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. For more information, see Use the snapshot backup feature.

    • 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.

    Important

    After 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.

    Note

    The log backup retention period is the same as the data backup retention period. You cannot separately configure the log backup retention period. For more information about log backups, see Back up an ApsaraDB RDS for SQL Server instance.

    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.

  5. On the Backup Strategy tab, click Save in the lower-left corner.

Configure manual backups

  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 upper-right corner of the page, click Backup Instance.Backup Instance

  3. 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. For more information, see Use the snapshot backup feature.

    • 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.

    Note

    The 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: The system immediately performs a full backup or an incremental backup.

      Note

      If 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.

      Note

      If 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.

  4. The system creates a backup task. 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 backup progress. 备份进程

    Note

    After 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. For more information, see Download the data backup files and log backup files.

References

FAQ

  • Can I disable the data backup feature or the log backup feature for my RDS instance?

    No, you cannot disable the features. By default, the data backup and log backup features are enabled and cannot be disabled. You can reduce the backup frequency, such as twice a week.

    Note
    • The log backup retention period is the same as the data backup retention period. You cannot separately configure the log backup retention period.

  • Why are incremental backups not supported by the snapshot backup feature?

    Snapshot backups are used to periodically back up data snapshots on cloud disks. You can use the snapshots to quickly restore data to a specific point in time. Snapshots are created based on cloud disks instead of backup files. As a result, the snapshot backup feature does not support incremental backups.

    Note

    Snapshots use the incremental snapshot chain mechanism. This mechanism retains the status of a snapshot at each point in time. As a result, a snapshot backup only backs up the incremental and updated data on cloud disks.

  • Why are incremental backups not supported by the secondary database preferred mode?

    The differential bitmaps cannot be deleted from the secondary RDS instance due to kernel reasons of ApsaraDB RDS for SQL Server. As a result, the secondary database preferred mode does not support incremental backups. For more information, see official documentation.

  • If the incremental backup feature is enabled, is the existing automatic backup policy affected after I manually perform a full backup?

    If the incremental backup feature is enabled and you perform a full backup during a backup cycle, the system automatically performs an incremental backup within three days starting from the day on which the full backup is performed. For example, a full backup is performed on Monday and an incremental backup is performed on Tuesday. If a full backup is performed on Wednesday, an incremental backup is separately performed on Thursday and Friday.