ApsaraDB RDS for MySQL supports the standard restoration feature and the fast restoration feature for individual databases and tables. You can restore specific databases and tables of your ApsaraDB RDS for MySQL instance to the original RDS instance or a new RDS instance by backup set or point in time. The features can be used in scenarios when misoperations are performed and data needs to be quickly restored or when historical data needs to be analyzed.
Feature description
The standard restoration feature and the fast restoration feature for individual databases and tables are provided. The fast restoration feature for individual databases and tables is implemented by using performance-type sandbox instances. If the volume of data remains unchanged, the fast restoration feature for individual databases and tables accelerates data restoration by approximately 50% to 95% compared with the standard restoration feature for individual databases and tables. For more information, see Use the emergency recovery feature of an ApsaraDB RDS for MySQL instance and Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.
Item | Standard restoration feature for individual databases and tables | Fast restoration feature for individual databases and tables |
Restoration range | Specific databases and tables of an RDS instance. | Specific databases and tables of an RDS instance. |
Restoration destination |
|
|
Restoration speed | The restoration speed varies based on the data volume. Data restoration is relatively slow. | The restoration speed varies based on the data volume. Data restoration is accelerated by approximately 50% to 95% compared with the standard restoration feature for individual databases and tables. |
Restoration method | You can restore data from backup sets or to a specific point in time. |
|
You can restore data to any point in time within the log backup retention period only after the log backup feature is enabled for your RDS instance. For more information, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance. If the log backup feature is disabled, you can restore data only to the point in time at which the data is backed up.
The restoration range varies based on data backup retention period, log backup retention period, and the point in time at which you enable the restoration feature for individual databases and tables of your RDS instance. The maximum retention period is 730 days for both data backup files and log backup files. For more information, see Back up an ApsaraDB RDS for MySQL instance. You can call the DescribeLocalAvailableRecoveryTime operation to query the time range within which an RDS instance can be restored. For more information, see DescribeLocalAvailableRecoveryTime.
For more information about data restoration methods, see Overview of data restoration methods.
Prerequisites
Standard restoration feature for individual databases and tables
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 following requirements are met:
The RDS instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6.
The RDS instance runs RDS High-availability Edition or runs MySQL 5.7 on RDS Enterprise Edition.
The RDS instance uses local disks.
NoteYou can go to the Basic Information page of your RDS instance to view the preceding information.
If your RDS instance uses cloud disks, the standard restoration feature for individual databases and tables is not supported. For more information about how to change the storage type of an RDS instance, see How do I change the storage type of an ApsaraDB RDS instance from standard SSD or ESSD to local SSD?
The number of tables that are created in the RDS instance is less than 50,000.
The restoration feature for individual databases and tables is enabled for the RDS instance. You can go to the
page and enable the feature in the Basic Backup section of the Backup Strategy tab.ImportantBy default, the restoration feature for individual databases and tables is enabled for new RDS instances and cannot be disabled.
The backup data that is generated before you enable the restoration feature for individual databases and tables cannot be used to restore individual databases and tables. You can restore full data of an RDS instance. For more information, see Restore full data of an ApsaraDB RDS for MySQL instance.
After you enable the restoration feature for individual databases and tables, you must manually back up full data of your RDS instance. Then, you can use the backup data that is generated after you enable the feature to restore specific databases and tables. For more information, see Manually back up an ApsaraDB RDS for MySQL instance.
Fast restoration feature for individual databases and tables
Billing rules
Standard restoration feature for individual databases and tables
By default, the standard restoration feature for individual databases and tables is enabled and is provided free of charge. If you use the standard restoration feature to restore individual databases or tables to a new RDS instance, you are charged for the new RDS instance. You can view the billing details when you create the RDS instance.
If you want to temporarily use an RDS instance, you can create a pay-as-you-go RDS instance. After data is restored to the new RDS instance, you can migrate the data to the original RDS instance and then release the new RDS instance. For more information, see Migrate data between ApsaraDB RDS instances and Release or unsubscribe from an ApsaraDB RDS for MySQL instance.
You are immediately charged for the new RDS instance after the instance is created.
Fast restoration feature for individual databases and tables
RDS instances with cloud disks: This feature is in public review and is provided free of charge.
Local disks
Free edition: If you enable and use the fast restoration feature for individual databases and tables of this edition, no fees are generated.
Paid edition: If you enable and use the fast restoration feature for individual databases and tables of this edition, you are charged based on the actual data volume by using the pay-as-you-go billing method. Unit price: USD 0.24 per GB-month.
Usage notes
By default, the restoration feature for individual databases and tables is enabled for new RDS instances that use local disks and cannot be disabled.
If you want to restore data of your RDS instance to a point in time, you must make sure that the log backup feature is enabled for the instance. For more information, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance.
If you use the fast restoration feature for individual databases and tables to restore individual databases or tables of an RDS instance, you can restore the data only to the original RDS instance rather than a new RDS instance.
If your RDS instance uses local disks, the backup data that is generated before you enable the restoration feature for individual databases and tables cannot be used to restore individual databases and tables. You can restore full data of your RDS instance. For more information, see Restore full data of an ApsaraDB RDS for MySQL instance.
If your RDS instance uses local disks, you must manually back up full data of your RDS instance after you enable the restoration feature for individual databases and tables. Then, you can restore individual databases and tables from the backup data that is generated after you enable restoration feature for individual databases and tables. For more information, see Manually back up an ApsaraDB RDS for MySQL instance.
NoteAfter you enable the restoration feature for individual databases and tables, the backup file format is changed from TAR to xbstream.
If you restore data of your RDS instance that uses local disks to the same RDS instance, a primary/secondary switchover is triggered during the restoration. The switchover may cause a transient connection that lasts for approximately 30 seconds. Make sure that your application is configured to automatically reconnect to the RDS instance. If you restore data of the RDS instance to a new RDS instance, no primary/secondary switchovers are triggered during the restoration.
ImportantIf you use the fast restoration feature for individual databases and tables to restore data of your RDS instance that uses cloud disks to the same RDS instance, no primary/secondary switchovers are triggered during the restoration. However, in some cases, the performance of the RDS instance may decrease and transient connections may occur.
You cannot suspend or cancel a restoration task after it is initiated.
Enable the fast restoration feature for individual databases and tables
To use the fast restoration feature for individual databases and tables for data restoration, you must perform the following steps to enable the feature and then restore data. Enabling the feature does not affect your workloads.
- 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 of the page that appears, click Backup and Restoration.
NoteIf your RDS instance uses local disks, the free and paid editions are provided for the fast restoration feature for individual databases and tables. The free edition allows you to restore data only to the point in time at which the last full backup is performed. The paid edition allows you to restore data to any point in time. For more information about billing, see Billing rules.
If the [Notice] Fast Restoration Becomes Commercially Available and Billed dialog box appears, you can select Do not show again. and then enable the free or paid edition based on your business requirements. If the dialog box does not appear, you can proceed with the subsequent steps.
On the Backup and Restoration page that appears, click the Backup Strategy tab.
In the Base Backup section, click Edit. In the dialog box that appears, turn on Fast Restoration.
NoteFor RDS instances that use local disks, if Database/Table Restoration is turned off, the Restore Speed option is not displayed. You must turn on Database/Table Restoration. For more information, see Usage notes.
If your RDS instance uses local disks, you must configure the CDM Billing Method and CDM Retention Period parameters.
Free edition: Set the CDM Billing Method parameter to Previous Full Backup Point in Time (Free Edition). The restored data is retained for one day.
Paid edition: Set the CDM Billing Method parameter to Any Point in Time (Paid Edition). You can set the retention period of restored data to 1 to 730 days.
Click OK.
Procedure
- 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 page that appears, click Restore Individual Database/Table.
NoteIf the Restore Individual Database/Table button is not displayed in the ApsaraDB RDS console, check whether the requirements that are described in the Prerequisites section are met.
Configure the following parameters.
Parameter
Description
Restore to
Current Instance
Restore to a New Instance: Follow Step 5 to automatically create an RDS instance. The databases and tables are restored to the new RDS instance. The restoration does not affect the original RDS instance.
After you verify the data in the new RDS instance, you can migrate the data back to the original RDS instance. For more information, see Migrate data between ApsaraDB RDS for MySQL instances.
NoteThe New Instance option is available only for RDS instances that use local disks.
Restore Speed
Standard
Fast: The fast restoration feature for individual databases and tables uses performance-type sandbox instances to accelerate data restoration by approximately 50% to 95% compared with the standard restoration feature for individual databases and tables. For more information, see Create a sandbox instance for emergency disaster recovery of an ApsaraDB RDS for MySQL database.
NoteIf your RDS instance uses cloud disks, you can set the Restore Speed parameter only to Fast. The fast restoration feature for individual databases and tables is now in public preview. You can use the feature free of charge.
If you use the fast restoration feature for individual databases and tables to restore individual databases or tables of an RDS instance, you can restore the data only to the original RDS instance rather than a new RDS instance.
Restore Method
By Backup Set: If you select this option, you can restore the data from a data backup file.
By Time: If you select this option, the system restores full backup data and then incremental log backup data. You can select any point in time within the log backup retention period. For information about how to view or change the log backup retention period, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance.
For example, if both the data backup retention period and the log backup retention period of an RDS instance are seven days, you can restore data that is generated within seven days. Backup sets that are generated seven days ago are not retained and cannot be restored.
NoteThe By Time option is available only after the log backup feature is enabled. For more information about how to enable the feature, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance.
Select the databases and tables that you want to restore. You can also specify the name of each restored database or table. Then, click OK.
NoteYou can select up to 50 databases or tables at a time.
When you restore databases and tables to the original RDS instance, the names of the restored databases can be the same as the names of the original databases, but the names of the restored tables cannot be the same as the names of the original tables. By default, the system adds _backup to the name of a restored database. You can rename the restored database or table.
If you restore databases and tables to the original RDS instance, you must make sure that the available storage of the RDS instance is sufficient to store the data of the databases and tables.
Select a billing method and configure the parameters related to the new RDS instance. This step is required only when you select New instance and Standard.
Subscription: A subscription instance is an instance for which you pay an upfront fee. For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method.
Pay-as-you-go: You are charged an hourly fee for a pay-as-you-go instance based on your actual resource usage. The pay-as-you-go billing method is suitable for short-term use. If you no longer need a pay-as-you-go instance, you can release the instance to reduce costs.
Parameter
Description
Zone
The zone where the new RDS instance resides. Each zone is an independent physical location within a region. Zones in the same region do not have substantial differences.
The new RDS instance can reside in the same zone as the Elastic Compute Service (ECS) instance that you want to connect or in a different zone.
NoteThe new RDS instance must reside in the same region as the original RDS instance. You cannot change the region.
Instance Type
The instance type of the new RDS instance. Each instance type supports a different number of CPU cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.
Capacity
The amount of storage that is provisioned to store data files, system files, log files, and transaction files in the new RDS instance.
Network Type
Classic Network: the traditional type of network.
VPC: the recommended type of network. A virtual private cloud (VPC) is an isolated virtual network that provides higher security and higher performance than the classic network.
NoteYou can go to the Tasks page to view the creation progress of the RDS instance. You can also use one of the following methods to restore individual databases and tables:
Use Database Backup (DBS) to create a logical backup. Then, restore data from the generated logical backup file. For more information, see Back up an ApsaraDB RDS for MySQL or self-managed MySQL instance by using logical backup and Restore a MySQL database from a logical backup.
Manually create a logical backup. Then, restore data from the generated logical backup file to a self-managed database. For more information, see Manually back up an ApsaraDB RDS for MySQL instance and Restore the data of an ApsaraDB RDS for MySQL instance from a logical backup file to a self-managed MySQL instance.
Use mysqldump to back up and restore the RDS instance. For more information, see Use mysqldump to back up and restore an ApsaraDB RDS for MySQL instance.
Correct the online data
Restoration destination | Correction method |
Current Instance | Execute the |
New Instance | After you restore the data of the original RDS instance to the new RDS instance, you can use Data Transmission Service (DTS) to migrate some or all data of the required databases and tables to the original RDS instance to correct the online data of the original RDS instance. For more information, see Migrate data between ApsaraDB RDS for MySQL instances. Note When you create a data migration task, use the new RDS instance as the source database and the original RDS instance as the destination database and set the Access Method parameter for both the source and destination databases to Alibaba Cloud Instance. |
Related operations
Operation | Description |
Restores the specified individual databases and tables of an instance to the original instance. | |
Restores the specified individual databases and tables of an instance to a new instance. | |
Queries the time range within which you can restore data by using a backup file of an instance. |