Logical backup and restore for RDS for SQL Server
Data Disaster Recovery (DBS) allows you to perform single-table recovery, create remote backups, and archive data long-term for ApsaraDB RDS for SQL Server databases. This topic describes how to use DBS to automate logical backups and restores for your database.
Notes
Configuring two or more backup schedules for the same SQL Server database is not supported and can cause restore failures.
Create a backup schedule
For more information, see Create a backup schedule.
-
When you purchase the backup schedule, select SQL Server as the database type and Logical Backup as the backup method.
-
To learn about the backup and restore granularity that DBS supports for SQL Server databases, see Supported database types and features.
Configure a backup schedule
This section describes how to configure a logical backup schedule for an ApsaraDB RDS for SQL Server database.
-
Log on to the Data Management (DMS) 5.0 console console.
-
In the top navigation bar, choose .
NoteIf you use the DMS console in simple mode, move the pointer over the
icon in the upper-left corner of the DMS console and choose . -
Find the target backup schedule and click Configure Backup Schedule in the Actions column.
-
On the Configure Backup Source and Destination page, configure the backup source and destination, and then click Next.
Category
Parameter
Description
N/A
Backup schedule name
The name of the backup schedule. DBS automatically generates a backup schedule name. We recommend that you enter a descriptive name that is easy to identify. Backup schedule names do not need to be unique.
Backup Source Information
Backup method
The value defaults to the backup method you selected when you created the schedule. In this example, the backup method is Logical Backup.
Database location
RDS Instance
Instance region
Select the region of the source RDS instance.
RDS instance ID
Select the ID of the source RDS instance that you want to back up.
Database account
Enter the database account. This account must have the permissions required to back up the database. For more information, see Account permissions.
NoteOn RDS databases, backups require only a read-only account, but restores require a read-write account.
Password
Enter the password for the database account.
NoteAfter entering the account credentials, click Test Connection to verify them. A success message appears if the test passes. If it fails, click the provided diagnosis link and adjust the source information as prompted.
Compliance warranty regarding cross-border data transfers
Read and agree to the compliance commitment by selecting the check box.
Backup Destination Information
Backup storage type
Specifies the storage type for the backup destination. The following options are available:
-
DBS storage (Recommended): Data is automatically stored in the built-in DBS storage, eliminating the need to create a storage space. You are charged based on the amount of data stored. For billing details, see Billing.
-
OSS For User: You must create an Object Storage Service (OSS) bucket in advance. For more information, see Create buckets.
Note-
This example uses DBS storage. If you select User OSS, you must also specify the Object Storage Service (OSS) bucket name. Only the OSS Standard storage class is supported.
-
For large amounts of data, consider purchasing a DBS storage plan (subscription) to offset the fees for DBS storage. Storage plans are more cost-effective than the pay-as-you-go option.
Storage encryption
Specifies the storage encryption method. The following options are available:
-
Encrypted (Recommended): Encrypts storage by using the industry-standard AES-256 algorithm.
OSS supports server-side encryption. When you upload an object, OSS encrypts it before saving. When you download the object, OSS automatically decrypts it.
-
Non-encrypted: Storage is not encrypted.
-
-
On the Edit Backup Objects page, move the databases or tables that you want to back up to the Selected box, and then click Next.
Note-
You can back up specific databases or tables. To select all available databases, click Select All. The supported backup objects vary by database. For more information, see Supported database types and features.
-
By default, backup tasks do not include newly created databases. To back up a new database, you can add it to the backup schedule. For more information, see Modify backup objects.
-
-
On the Configure Backup Time page, configure the backup time settings, and then click Next.
Parameter
Description
Full backup frequency
The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.
NoteIf you select Periodic Backup, you must configure the Full Data Backup Recurrence and Start At parameters.
Full backup cycle
The days of the week on which DBS runs the backup schedule. You can select one or more days of a week. Select at least one day of the week.
Full backup start time
The start time of the backup. We recommend that you set a point in time within off-peak hours. Example: 01:00.
NoteIf a previous full data backup is not finished at the start time of the next backup, DBS skips the next backup.
Incremental backup
Incremental backup is not supported for SQL Server databases.
Maximum concurrent threads for full backup
The maximum number of concurrent threads available for a full backup. You can set this parameter to adjust the backup speed. For example, you can reduce the number of backup threads to minimize impacts on the database.
-
On the Edit Lifecycle page, specify the retention period for full backup data in the DBS storage.
NoteThe minimum retention period is 7 days and the maximum is 3,650 days. Backup sets are automatically deleted after their retention period expires.
-
After the preceding configurations are complete, click Precheck in the lower-right corner of the page.
-
In the precheck dialog box, after the precheck passes, click Start Task.
Note-
The backup schedule is configured when its Status changes to Running.
-
If the backup schedule has an exception or reports an error, troubleshoot and resolve the issue promptly. For more information, see How to fix an abnormal DBS backup schedule. If the issue persists, contact us by joining the DBS customer consultation group in DingTalk (Group ID: 35585947).
-
Restore data
-
Log on to the Data Management (DMS) 5.0 console console.
-
In the top navigation bar, choose .
NoteIf you use the DMS console in simple mode, move the pointer over the
icon in the upper-left corner of the DMS console and choose . On the Backup Schedules page, find the backup schedule that you want to manage and click Manage in the Actions column.
On the Configure Task page, click Restore Database in the upper-right corner.
-
On the Set Time Restored To page, configure the following parameters, and then click Next.
Category
Parameter
Description
N/A
Task Name
The name of the restore task. DBS automatically generates a task name. We recommend that you specify a name that can help you identify the task. Task names do not need to be unique.
Set Time Restored To
Recoverable time range
The time range from the point in time when the first full backup set is created to the point in time when the latest full backup set is created. The database can be restored to a point in time within the time range.
Selected recovery point
Select a recovery point. The time must be within the Recoverable time range. You can restore data from any full backup set.
Destination database
Database location
RDS Instance
Instance region
Select the region where the destination instance is located.
NoteThis parameter is not displayed if Database location is set to User-Created Database with Public IP Address <IP Address:Port Number>.
RDS instance ID
Select the ID of the destination ApsaraDB RDS for SQL Server instance.
NoteThis parameter is required only if Database location is set to RDS Instance.
Database account
Enter the account for the destination database. This account must have write permissions.
Password
The password of the account that is used to connect to the database that you want to back up.
Compliance warranty regarding cross-border data transfers
Read and agree to the compliance commitment by selecting the check box.
-
On the Configure Objects to Restore page, configure the following settings, and then click Precheck.
Parameter
Description
Conflict handling
The default option for Conflict handling is Rename object if it has the same name. For example, if you restore a table named
job_infoand a table with that name already exists in the destination, the system renames the restored table tojob_info_dbs_<restore_task_ID>_<timestamp>.Objects to restore
In the Source Database Objects box, select the databases or tables you want to restore and move them to the Selected Objects box.
NoteSome databases support single-table or single-database recovery, which reduces the amount of data to restore and shortens the Recovery Time Objective (RTO). For details about the supported restore granularity, see Supported database types and features.
-
In the Precheck dialog box, after the Precheck Passed message appears, click Start Task.
You can monitor the database recovery progress on the Restore Tasks tab.
NoteThe recovery time depends on the specifications of the backup schedule and the size of the database. Higher specifications result in faster recovery. For more information, see Performance tests for logical and physical backups.
Related operations
-
You can also create and start a backup schedule by calling an API operation. For more information, see CreateAndStartBackupPlan.
-
To change the backup source, backup objects, or backup policy (such as the backup time or retention policy), see Manage a backup schedule.
-
For information about potential charges for your backup schedule, see Billing FAQ.
-
If a backup is not currently needed, you can pause the backup schedule to save costs. For more information, see Pause or restart a backup schedule.