All Products
Search
Document Center

Cloud Backup:Back up an SQL Server database

Last Updated:Feb 26, 2024

To prevent data loss or corruption due to disasters, hardware failures, or accidental deletion, we recommend that you use Cloud Backup to back up your SQL Server database in a timely manner. You can use Cloud Backup to back up SQL Server databases that are deployed on Elastic Compute Service (ECS) instances or on-premises servers to the cloud. You can restore the data of an SQL Server database to the source database or another ECS-hosted database within the same region based on recovery points. This topic describes how to back up an SQL Server database.

Prerequisites

  • Cloud Backup is activated. You are not charged for activating Cloud Backup. You are charged for using the database backup feature of Cloud Backup based on the following billable items:

    • Rental of database backup vaults. You are not charged for using a vault in the first 30 days. You are charged after the free-trial period ends. You can store data from various databases.

    • Storage usage of database backup vaults. You are charged for the backup storage based on the storage space occupied by the data that is deduplicated and compressed. A free capacity of 100 GB is provided for each backup vault per month. After the free quota is used up, you are charged based on tiered pricing.

      Note

      You are not charged for using Cloud Backup if you only register an SQL Server database in the Cloud Backup console.

    For more information, see Pricing.

  • Cloud Assistant Agent is installed on the ECS instance that hosts the database.

    A Cloud Backup client for ECS must be used together with Cloud Assistant.

    • If you purchased the ECS instance before December 1, 2017, you must manually install Cloud Assistant Agent. For more information, see Install Cloud Assistant Agent.

    • If you purchased the ECS instance on or after December 1, 2017, Cloud Assistant Agent is pre-installed.

  • An SQL Server database is registered. For more information, see Register an ECS-hosted SQL Server database or Register an on-premises SQL Server database.

Usage notes

  • You are not charged for using Cloud Backup if you only register an SQL Server database in the Cloud Backup console.

  • Cloud Backup supports a limited number of database versions, operating systems, and backup features. For more information, see the "Supported database versions" section in Overview (ECS-hosted databases).

  • You must make sure that .NET Framework 4.5 or later is installed on the ECS instance.

  • If the compression feature is enabled for a file system, the files of an SQL Server database cannot be stored in the file system. For more information, see File Locations for Default and Named Instances of SQL Server.

  • If an SQL Server database uses the simple recovery mode, Log Backup is not supported. You can select Full Backup or Cumulative Incremental Backup.

  • If you are using a master database, Cumulative Incremental Backup and Log Backup are not supported. You can select only Full Backup.

  • On-premises database servers must be connected to virtual private clouds (VPCs) by using virtual private networks (VPNs) or Express Connect circuits. You must also make sure that you can use a Cloud Backup client to access one of the following CIDR blocks from an on-premises server: 100.64.0.0/10, 100.64.0.0/11, and 100.96.0.0/11. For more information, see Connect a VPC to a data center in single-tunnel mode.

Create a backup plan for the SQL Server database

After you register an SQL Server database, you must create a backup plan for the database. Cloud Backup backs up the database based on the backup plan that you configure. To create a backup plan, perform the following steps:

  1. Log on to the Cloud Backup console.

  2. On the Database Backup page, click the SQL Server tab.

  3. Click the ECS Database Instance or Local Database Instance tab.

  4. Find the SQL Server database for which you want to create a backup plan, and click Back Up in the Actions column.

  5. In the Create Backup Plan panel, perform the following steps:

    1. Configure the backup parameters and click Next.

      1. Specify Plan Name.

      2. Select the SQL Server database that you want to back up.

    2. Configure the backup plan and click Next.

      Parameter

      Description

      Recommended Plan

      The recommended backup plan. Cloud Backup provides the following preconfigured backup policies. You can select a backup policy based on your business requirements or create a custom backup policy.

      • Typical Plan: enables the Full Backup and Cumulative Incremental Backup features.

      • Critical Application: enables the Full Backup, Cumulative Incremental Backup, and Log Backup features.

      • Customize: enables a custom backup policy.

      Full Backup

      If you select Full Backup, all the database files in the operating system are backed up.

      However, you can restore the files to only the point in time at which the files are backed up.

      You can back up files immediately or at a specified point in time. You can also schedule periodic backups by hour, day, week, or month.

      Cumulative Incremental Backup

      If you select Cumulative Incremental Backup, all incremental database files in the operating system are backed up.

      However, you can restore the files to only the point in time at which the files are backed up.

      You can back up files immediately or at a specified point in time. You can also schedule periodic backups by hour, day, week, or month.

      Important

      When Cloud Backup clears expired backup files, cumulative incremental backup files are considered as normal incremental backup files. An incremental backup file depends on the most recent incremental and full backup files. Therefore, the incremental backup file is retained until the incremental and full backup files on which it depends are deleted. When all the full and cumulative incremental backup files on which the cumulative incremental backup file depends are deleted, Cloud Backup deletes the cumulative incremental backup file. We recommend that you configure a reasonable backup cycle and expiration time. For more information, see How does Cloud Backup clear expired database backup files?

      Log Backup

      If you select Log Backup, database logs are backed up. You can restore the logs to a specific point in time.

      You can back up files immediately or at a specified point in time. You can also schedule periodic backups by hour, day, week, or month.

      Important

      To restore a log backup file, Cloud Backup must obtain the most recent full backup file. Therefore, the full backup file is not recycled until the log backup file expires. We recommend that you configure a reasonable backup cycle and expiration time. For more information, see How does Cloud Backup clear expired database backup files?

    3. Configure the backup settings and click Next.

      You can specify the number of concurrent threads, the retry time, and the limit of the backup speed.

      Parameter

      Description

      Concurrent Threads

      The number of concurrent threads that are used to back up files.

      Retry Time

      The time interval between two consecutive reconnection attempts if the database is disconnected during backup. Unit: minutes.

      Speed Limit

      The maximum size of data that is backed up per second. Unit: MB/s. The value 0 indicates that the speed is unlimited.

    4. Configure a backup vault and then click OK.

      Important

      You can back up a database instance to only one backup vault.

      Parameter

      Description

      Backup Vault

      The backup vault to which you want to store the backup data. Valid values:

      • Create Vault: If you select this option, specify a name for the backup vault in the Vault Name field. If you do not configure this parameter, a random name is specified.

      • Select Vault: If you select this option, select a backup vault from the Vault Name drop-down list.

      Important

      After a backup vault is created, you are charged for the backup vault regardless of whether backup data is generated. For more information, see Billable items and billing methods.

      To maximize the redundancy of your backup data, Cloud Backup uses zone-redundant storage (ZRS)-enabled backup vaults by default in regions that support ZRS-enabled backup vaults. For regions that support only locally redundant storage (LRS)-enabled backup vaults, Cloud Backup uses LRS-enabled backup vaults. You do not need to manually select a backup vault type.

      Vault Name

      The name of the backup vault.

      Backup Retention Period

      The retention period of the backup data. Unit: days, weeks, months, or years. After the retention period expires, the backup data is automatically deleted.

      You can change the backup retention period on the Storage Vaults page. This change takes effect on all newly generated backup data in the backup vault.

      Important

      To restore a cumulative incremental backup file or log backup file, Cloud Backup must obtain the most recent full backup file. Therefore, the full backup file is not recycled until the cumulative incremental backup file or log backup file expires. We recommend that you configure a reasonable backup cycle and expiration time. For more information, see How does Cloud Backup clear expired database backup files?

      The backup plan is created.

Backup is successful

  • A full backup is a prerequisite for an incremental backup. You must manually perform a full backup.

  • After the backup plan is created, you can view the backup plan details on the Backup Plans tab. The details include the next execution time and backup intervals for the full backup, incremental backup, and log backup. Cloud Backup backs up the SQL Server database from the specified start time at the specified interval.

  • When the backup execution time is reached, Cloud Backup runs the backup plan. If the Status of a backup job is Idle and the time for Next Run is displayed, the backup job is completed.image.png

Related operations

On the Backup Plan tab, find the backup plan. In the Actions column, you can click buttons to perform the following operations:

  • Modify a backup plan

    If a backup plan does not meet your requirements, you can click Edit to modify the backup plan.

  • Configure alerts

    You can choose More > Alert Settings in the Actions column and then select a backup alert policy. The following table describes the alert policies.

    Alert policy

    Description

    Disabled

    The backup client does not send alert notifications.

    Same as Backup Vault

    The backup client sends alert notifications based on the alert settings that are specified for the backup vault.

    Default

    The backup client sends alert notifications to the owner of the Alibaba Cloud account by using emails.

    Custom

    If you select this option, you must select one or more contacts or contact groups. Then, the backup client sends alert notifications to the selected contacts or contact groups.

  • Delete a backup plan

    If you delete a backup plan, all backup and restoration jobs that are being performed based on the backup plan are interrupted.

    To delete a backup plan, find the backup plan and choose More > Delete Backup in the Actions column.

What to do next

Restore an SQL Server database

FAQ

References