Database and table restoration is a process of restoring only specified databases or tables in a cluster. For example, assume that you are the database administrator of a gaming company, you can use the database and table restoration feature to restore the data of a player or a group of players. You can restore databases and tables by using two methods: restore from a backup set and restore to a point in time. This topic describes how to restore a specified database or table from a backup set.

Limits

  • Only PolarDB Cluster Edition supports database and table restoration, and one of the following clusters must be used:
    • A cluster of PolarDB for MySQL 5.6 whose minor version of the kernel is 5.6.1.0.25 or later. For more information, see Version Management.
    • A cluster of PolarDB for MySQL 5.7 whose minor version of the kernel is 5.7.1.0.8 or later.
    • A cluster of PolarDB for MySQL 8.0 whose minor version of the kernel is 8.0.1.1.14 or later.
      Note Database and table restoration is not supported on clusters of PolarDB for MySQL 8.0.2.
  • PolarDB Single-node Edition, Archive Database Standalone Edition, and Archive Database Cluster Edition clusters do not support the database and table restoration feature.
  • Database and table restoration is not supported on clusters with transparent data encryption (TDE) enabled.
  • Clusters in the Global Database Network (GDN) do not support the database and table restoration feature.

Limits

  • You can restore databases and tables only from level-1 backup sets. Level-2 backup sets are not supported.
  • Only the tables that you specify are restored. Make sure that you select only the tables that you want to restore.
    Note If you are unable to select the tables that you want to restore, we recommend that you restore all data in the current cluster to a new cluster and then migrate the data to the current cluster. For more information, see Method 1 for cluster restoration: Restore from a backup set and Method 2 for full restoration: point-in-time restore.
  • If the specified tables are deleted within the time period from the point in time when the most recent backup set is generated to the point in time that you specified, you cannot restore the data by Backup Timepoint.
  • You can restore at most 100 tables at a time. If you restore a database, all tables in the database are restored.
    Note To restore a large number of tables, we recommend that you restore all data in your cluster to a new cluster. For more information, see Method 1 for cluster restoration: Restore from a backup set and Method 2 for full restoration: point-in-time restore.
  • The database and table restoration feature is applicable only to clusters that store 50,000 tables or less. If the cluster stores more than 50,000 tables, this feature cannot be used.
  • You cannot use the database and table restoration feature to restore triggers. If the table that you restore contains a trigger, the trigger cannot be restored.
  • You cannot use the database and table restoration feature to restore foreign keys. If the table that you restore contains a foreign key, the foreign key cannot be restored.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster that you want to manage is deployed.
  3. Find the cluster you want to manage and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Backup and Restore.
  5. On the Backup and Restore page, click Restore Databases/Tables.
  6. In the dialog box that appears, select Backup Set in the Restore Type section and select the backup set that you want to use from the backup set drop-down list.
    1
  7. On the left side of the Databases and Tables to Restore section, select the database that you want to restore. On the right side, select the table that you want to restore.
    1
    Note
    • If you do not select a table after you select a database, all tables in the database are restored.
    • After you select a database or table, the system automatically generates the name of the new database or table by appending the _backup suffix to the name of the selected database or table. For example, if the name of the selected table is test, the new table is named test_backup. You can also change the name of the new database or table.
  8. Click OK.

Related operations

API Precautions
DescribeMetaList Queries the metadata of the database or table that you want to restore.
RestoreTable Restores the databases or tables of a PolarDB cluster.