ApsaraDB RDS for MySQL supports database-level data restoration and table-level data restoration. If you accidentally delete a database or a table on your RDS instance, you can restore only the deleted database or table without the need to restore the data of the entire instance. This way, you can shorten the recovery time objective (RTO).

Introduction

When a physical backup is performed, ApsaraDB RDS for MySQL stores the data of your RDS instance at the database and table levels. Therefore, when you restore individual databases or tables of your RDS instance, ApsaraDB RDS for MySQL reads and restores the tables that you specify from the physical backup file. This significantly shortens the recovery time and increases the recovery speed.

ApsaraDB RDS for MySQL also provides the fast restoration feature for individual databases and tables. This feature uses sandbox instances to accelerate data restoration by approximately 50% to 95% compared with the standard individual database and table restoration feature. For more information, see Create a sandbox instance for the emergency disaster recovery of an ApsaraDB RDS for MySQL database. The fast restoration feature for individual databases and tables is in public preview and can be used free of charge. For more information about how to enable the fast restoration feature for individual databases and tables, see the "Appendix: Enable the fast restoration feature for individual databases and tables" section of this topic.
Note The fast restoration feature for individual databases and tables is available only in the China (Zhangjiakou) and China (Hohhot) regions.

Billing rules

  • The individual database and table restoration feature is enabled by default and is provided free of charge.
  • The fast restoration feature for individual databases and tables is in public preview and can be used free of charge. After the fast restoration feature for individual databases and tables is commercially released, you are charged USD 0.24 per GB-month for using the feature. The following table describes the billing rules for the fast restoration feature for individual databases and tables.
    Item Public preview phase Commercial use phase
    Price Free of charge USD 0.24 per GB-month
    Note You can view the storage usage of your sandbox instance in the ApsaraDB RDS console. For more information, see Create a sandbox instance for the emergency disaster recovery of an ApsaraDB RDS for MySQL database.
    Retention period of sandbox instances 1 day (The retention period cannot be adjusted in the public preview phase.) 1 day to 730 days
    Functionality Point-in-time restore supported Point-in-time restore supported
    Free trial Not limited 7 days per RDS instance

Restore individual databases and tables of an RDS instance that uses local SSDs

Prerequisites
  • The RDS instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6 on RDS High-availability Edition or runs MySQL 5.7 on RDS Enterprise Edition.
  • The number of tables that are created in the RDS instance is less than 50,000.
  • The individual database and table restoration feature is enabled for the RDS instance on the Backup Settings tab of the Backup and Restoration page in the ApsaraDB RDS console.
    Note
    • The individual database and table restoration feature is enabled for each new RDS instance and cannot be disabled.
    • The data that is generated before the individual database and table restoration feature is enabled cannot be restored. If you want to restore this data, we recommend that you restore all data of the RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance.
    • After you enable the individual database and table restoration feature, the supported backup file format changes from TAR to xbstream to support the restoration of individual databases and tables. In addition, the feature cannot be disabled after it is enabled.

Impacts

If you restore individual databases and tables to the original RDS instance, a primary/secondary switchover is triggered during the restoration process. The switchover may cause a transient connection that lasts approximately 30 seconds. In this case, make sure that your application is configured to automatically reconnect to the RDS instance. If you restore individual databases and tables to a new RDS instance, no primary/secondary switchovers are triggered during the restoration process.

Procedure

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration. On the page that appears, click Restore Individual Database/Table.
    Note If the Restore Individual Database/Table button is not displayed, you must check that the RDS instance meets all prerequisites.
  3. Configure the following parameters.
    Parameter Description
    Restore To
    • Current Instance: If you select this option, ApsaraDB RDS restores the data to the original RDS instance.
    • New Instance: If you select this option, ApsaraDB RDS restores the data to a new RDS instance.
    Recovery 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, you can restore the data to a point in time within the log backup retention period that you specify. 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.
      Note The By Time option is available only when the log backup feature is enabled.
    Restore Mode
    • Logical Restoration: The restoration is slow.
    • Physical Restoration: The restoration is fast, but a primary/secondary switchover is triggered. In addition, all attached read-only RDS instances are restarted. If the RDS instance is being maintained, the amount of data that you want to restore is small, or the data replication to the attached read-only RDS instances is interrupted, the backend automatically selects Logical Restoration.
    Note This parameter is available only when read-only RDS instances are attached to the RDS instance.
  4. 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.
    Note
    • You can select up to 50 databases or tables at a time.
    • If you restore the selected databases and tables to the original RDS instance, these databases and tables must have new names that are different from the original names. By default, ApsaraDB RDS adds _backup to the original names.
    • If you restore the selected 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 from these databases and tables.
  5. Select a billing method and configure the parameters that are required to create an RDS instance. This step is required only when you want to restore the data to a new RDS instance.
    • 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
    Availability 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 or in a different zone than the Elastic Compute Service (ECS) instance that you want to connect.
    Note The 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 cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.
    Capacity The maximum amount of storage that is provisioned to store data files, system files, binary 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.
Note You can also use one of the following methods to restore individual databases and tables:

Restore individual databases and tables of an RDS instance that uses standard SSDs or ESSDs

  1. Use DBS to create a logical backup. For more information, see Back up an ApsaraDB RDS for MySQL, PolarDB for MySQL, or self-managed MySQL database.
  2. Restore data from the generated logical backup file. For more information, see Restore a MySQL database from a logical backup.
Note For more information about how to restore individual databases and tables, see Use mysqldump to back up and restore an ApsaraDB RDS for MySQL instance.

Appendix: Enable the fast restoration feature for individual databases and tables

Prerequisites

  • The RDS instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6 on RDS High-availability Edition with local SSDs.
    Note The fast restoration feature for individual databases and tables runs at a lower speed in RDS instances that run MySQL 8.0 than in RDS instances that run a different MySQL version due to specific database engine issues.
  • The RDS instance runs the InnoDB storage engine.
  • The sandbox feature is not enabled for the RDS instance. If the sandbox feature is enabled, you must disable it before you enable the fast individual database and table restoration feature. For more information, see Create a sandbox instance for the emergency disaster recovery of an ApsaraDB RDS for MySQL database.
  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration.
    Note If the Enable Fast Restoration dialog box appears, you can click Enable to enable the fast individual database and table restoration feature. If the dialog box does not appear, you can proceed with the subsequent steps.
  3. Click the Backup Settings tab. In the Backup Settings section of the tab, click Edit.
  4. In the Backup Settings dialog box, set Restore Speed to Fast and click Save.
    Note If the Restore Individual Database/Table switch is turned off, the Restore Speed parameter is not displayed. To enable the individual database and table restoration feature, you must turn on the Restore Individual Database/Table switch.
    • The Restore Individual Database/Table feature is enabled for each new RDS instance and cannot be disabled.
    • The data that is generated before you turn on the Restore Individual Database/Table switch cannot be restored. If you want to restore this data, we recommend that you restore all data of the RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance.
    • After you turn on the Restore Individual Database/Table switch, the supported backup file format is changed from tar to xbstream.
    • The Restore Individual Database/Table switch cannot be turned off after it is turned on.

Related operations

Operation Description
RestoreTable Restores the specified individual databases and tables of an ApsaraDB RDS instance to the original RDS instance.
CloneDBInstance Restores the specified individual databases and tables of an ApsaraDB RDS instance to a new RDS instance.
DescribeLocalAvailableRecoveryTime Queries the time range within which you can restore data by using a backup file of an ApsaraDB RDS instance.