All Products
Search
Document Center

PolarDB:Method 1 for database and table restoration: Restore data from a backup set

Last Updated:May 07, 2024

Database and table restoration is a process that restores 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 or restore to a point in time. This topic describes how to restore a specified database or table from a backup set.

Background information

The database and table restoration feature of PolarDB does not overwrite or delete existing databases or tables in the cluster, nor does it directly write data into databases and tables in the cluster. Instead, new databases and tables are created in the cluster. By specifying new names for databases or tables during the restoration process, you can restore backup data from db1 to db2.

During database and table restoration, the original cluster can still be accessed. However, the computing resources of the original cluster may be consumed. As a result, the CPU utilization and IOPS of the cluster increase.

Supported versions and Limitations

Supported versions

Note

For information about how to check the version of your cluster, see Query an engine version.

  • Both Enterprise Edition and Standard Edition of PolarDB for MySQL support restoring databases and tables from backup sets. The following are specific supported versions and limitations.

    • PolarDB Enterprise Edition: Cluster Edition clusters that run MySQL 5.6, 5.7, 8.0.1, or 8.0.2 support this feature.

      • PolarDB for MySQL 5.6: the revision version must be 5.6.1.0.25 or later.

      • PolarDB for MySQL 5.7: the revision version must be 5.7.1.0.8 or later.

      • PolarDB for MySQL 8.0.1: the revision version must be 8.0.1.1.14 or later.

      • PolarDB for MySQL 8.0.2: the revision version must be 8.0.2.2.0 or later.

    • PolarDB Standard Edition:

      • PolarDB for MySQL 5.7 on x86 architecture: the revision version must be 5.7.1.0.30 or later.

      • PolarDB for MySQL 8.0.1 on x86 architecture: the revision version must be 8.0.1.1.38.2 or later.

      • PolarDB for MySQL 8.0.2 on x86 architecture: the revision version must be 8.0.2.2.21 or later.

      • PolarDB for MySQL 8.0.1 on the ARM-based Yitian processor: the revision version must be 8.0.1.1.41 or later.

      • If your cluster uses cloud disks and contains 50,000 or more tables, it cannot be restored from backup sets.

  • The primary cluster of a GDN supports restoring databases and tables from backup sets. The following are requirements for the cluster version. The requirements apply to both Enterprise Edition and Standard Edition.

    • PolarDB for MySQL 5.6: does not support this feature.

    • PolarDB for MySQL 5.7: the revision version must be 5.7.1.0.30 or later.

    • PolarDB for MySQL 8.0.1: the revision version must be 8.0.1.1.38.2 or later.

    • PolarDB for MySQL 8.0.2: the revision version must be 8.0.2.2.21 or later.

  • Clusters that meet the following version requirements support optimized restoration of databases and tables from backup sets. The requirements apply to both Enterprise Edition and Standard Edition.

    • PolarDB for MySQL 5.6: does not support optimized restoration of databases and tables from backup sets.

    • PolarDB for MySQL 5.7: the revision version must be 5.7.1.0.30 or later.

    • PolarDB for MySQL 8.0.1: the revision version must be 8.0.1.1.38.2 or later.

    • PolarDB for MySQL 8.0.2: the revision version must be 8.0.2.2.21 or later.

    Note

    Optimized restoration of databases and tables from backup sets offers faster restoration speed. For information about how this feature works and how fast it is, see Overall process and estimated time.

Limitations

  • Multi-master Cluster (Database/Table) Edition clusters do not support database or table restoration from backup sets.

  • Tables with global secondary indexes cannot be restored from backup sets.

  • If a cluster that does not have read-only nodes contains more than 50,000 tables, the database and table restoration feature is not supported.

  • Secondary clusters of a GDN do not support restoration from backup sets.

  • In-memory column indexes cannot be restored from backup sets.

  • Tables archived as cold data cannot be restored from backup sets.

  • Only tables that use the InnoDB storage engine can be restored from backup sets.

Note

If your cluster does not support database and table restoration from backup sets, use one of the following methods to fully restore data into a new cluster: Method 1 for full restoration: Restore data from a backup set and Method 2 for full restoration: Restore data to an earlier point in time. Then, you can follow this topic to migrate data to your original cluster: Migrate data between PolarDB for MySQL clusters.

Usage notes

  • You can use the database table restoration feature even when a cluster contains more than 50,000 tables (including system tables).

    Note
    • The database and table restoration feature is in canary release. To enable this feature, follow the guide on Contact us.

    • You can execute the following statement to query the total number of tables in a cluster (system tables included).

      SELECT COUNT(*) FROM information_schema.tables;
    • You can execute the following statement to query the total number of tables in a cluster.

      SELECT COUNT(*) FROM information_schema.tables WHERE table_schema IN ('sys', 'performance_schema', 'mysql', 'information_schema', '__recycle_bin__');
  • 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 left-side navigation pane, click Clusters.

  3. In the upper-left corner, select the region where the cluster to which you want to connect is deployed.

  4. Find the cluster and click its ID.

  5. In the left-side navigation pane, choose Settings and Management > Backup and Restoration

  6. On the Backup and Restoration page, click Restore Databases/Tables.

  7. In the dialog box that appears, select Backup Set in the Restoration Type section and select the target backup set from the backup set drop-down list.

    1

  8. 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 specify a name for a database or table, the system automatically generates a new database or table name by suffixing the name of the original database and table with _backup. For example, assume the original table is named test, a table named test_backup is automatically created.

    • If you do not select a table after you select a database, all tables in the database are restored.

  9. Click OK.

Related API operations

API

Description

DescribeMetaList

Queries the metadata of databases or tables that can be restored.

RestoreTable

Restores PolarDB databases or tables.