ApsaraDB RDS for MySQL allows you to restore individual databases and tables. If you unintentionally delete one or more databases or tables of an RDS instance, you can restore the databases or tables from a backup set.
Prerequisites
- The RDS instance runs one of the following MySQL versions and RDS editions:
- MySQL 8.0 on RDS High-availability Edition (with local SSDs)
- MySQL 5.7 on RDS High-availability Edition (with local SSDs)
- MySQL 5.6 on RDS High-availability Edition
- The RDS instance does not use X-Engine.
- The number of tables on the RDS instance does not exceed 50,000.
- The Restore Individual Database/Table function is enabled. To enable this function,
follow these steps: Log on to the ApsaraDB for RDS console, navigate to the Backup and Restoration page, click the Backup Settings tab and then the Edit button on the tab, and in the dialog box that appears select
Enabled for Restore Individual Database/Table.Note
- After this function is enabled, a new backup format is used to support the restoration of individual databases and tables. This function cannot be disabled after it is enabled.
- This function is enabled for each new RDS instance by default and cannot be disabled.
- If you want to restore individual databases and tables to the original RDS instance,
the original RDS instance must meet the following requirements:
- The original RDS instance is in the Running state and is not locked.
- The original RDS instance does not have an ongoing migration task.
- If you want to restore individual databases and tables to a point in time, the log backup function is enabled for the original RDS instance.
- If you want to restore individual databases and tables from a backup set, the original RDS instance has at least one backup set.
- If you want to restore individual databases and tables to a new RDS instance, the
original RDS instance must meet the following requirements:
- The original RDS instance is in the Running state and is not locked.
- If you want to restore individual databases and tables to a point in time, the log backup function is enabled for the original RDS instance.
- If you want to restore individual databases and tables from a backup set, the original RDS instance has at least one backup set.
Precautions
- If you restore individual databases and tables to the original RDS instance, a primary/secondary switchover is triggered. This may cause a transient connection error. Make sure that your application is configured to automatically reconnect to the original RDS instance. If you restore individual databases and tables to a new RDS instance, no primary/secondary switchover is triggered.
- The Restore Individual Database/Table function triggers a compression format change for backup files from TAR to xbstream. After the change, the storage space occupied by these backup files slightly increases. Keep an eye on your backup storage usage. If your backup storage usage exceeds the specified free quota, you are charged for your excess backup storage usage. We recommend that you specify a proper backup cycle based on your business needs to maximize the usage of free backup storage.
- The Restore Individual Database/Table function restores only the specified tables.
You must select all of the tables that you want to restore. The restoration fails
in the following scenarios:
- The specified tables are deleted during the period spanning from the point in time when the last backup set was generated to the point in time to which you want to restore data.
- The restoration involves a table that you have not specified. For example, you specified to restore Table B, but Table B was renamed from Table A before the specified point in time. In this situation, the restoration fails because you did not specify Table A.
If you cannot determine all of the tables involved, you can only restore data at the instance level. For more information, see Restore the data of an RDS MySQL instance.
- You can select a maximum of 50 databases or tables at a time.
Procedure
FAQ
- After the supported file compression format is changed from TAR to xbstream, will
the original backup files in TAR format become unavailable?
No, the original backup files in TAR format are still available.
- Why does the Restore Individual Database/Table function suddenly become unavailable?
Check whether the number of tables on your RDS instance exceeds 50,000. If the number exceeds 50,000, the Restore Individual Database/Table function is unavailable.
Related operations
Operation | Description |
---|---|
Restore databases or tables | Restores individual databases and tables of an ApsaraDB for RDS instance to the original instance. |
Clone instance | Restores individual databases and tables of an ApsaraDB for RDS instance to a new instance. |
Query the time range for restoration | Queries the time range to which an ApsaraDB for RDS instance can be restored. |