Database Backup (DBS) allows you to restore data by database or table. If data is deleted from a specific database or table by mistake, you can restore the database or table without the need to restore the entire database instance. This shortens the recovery time objective (RTO).

Overview

During a logical backup, DBS stores backup data in the dimensions of database objects such as tables or databases. When you restore data by database or table, DBS reads data only from the specified one or more tables for restoration. This shortens the RTO. If the incremental backup feature is enabled, DBS allows you to restore the data to a point in time from the completion of the first full backup to the completion of the last incremental backup.
Note DBS supports incremental backups only for some types of databases. For more information, see Database engines and features.

Prerequisites

At least one logical backup is complete. DBS does not allow you to restore data by database or table from a physical backup. For more information, see Configure a backup schedule.
Note To perform a logical backup on a PolarDB-X database, you must back up the entire database instance. As a result, DBS does not allow you to restore PolarDB-X data by database or table.

Procedure

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
  3. On the Backup Schedules page, find the ID of your backup schedule and click Manage in the Actions column.
  4. On the Configure Task page, click Restore Database in the upper-right corner.
  5. In the Set Time Restored To step, set the parameters in the Set Time Restored To and Configure Destination Database sections and click Next.
    Note
    • If the incremental backup feature is enabled, DBS allows you to restore the data to a point in time from the completion of the first full backup to the completion of the last incremental backup.
    • If the incremental backup feature is disabled, DBS allows you to restore the data to a point in time when a full backup is complete.
    For more information about the parameters, see the topics about how to restore databases.
    Restore a MySQL database
  6. In the Configure Objects to Restore step, set the Conflict Handling parameter and specify the databases or tables to be restored in the Objects to Restore section.
    Restore one or more tables
    Parameter Description
    Conflict Handling Select one of the following methods for conflict handling:
    • Fail when Object with the Same Name Exists.
    • Rename Object with the Same Name: If you select this option, DBS renames the new table that is to be created by the restore task. For example, a table to be restored in the source database and an existing table in the destination database have the same name job_info. The system renames the new table that is restored from the table in the source database in the following format: job_info_dbs_<ID of the restore task>_</Timestamp>.
    Objects to Restore The database or table that you want to restore. Select the database or table that you want to restore in the Available section and click the right arrow to add it to the Selected section. In this example, only the persons and sbtest100 tables are selected for restoration.
  7. In the lower-right corner of the page, click Precheck.
    The system checks the preceding configurations, database connectivity, and database permissions.
  8. After the Precheck Passed message appears in the Precheck dialog box, click Start Task.
    After you click Start Task, you can click Restore Tasks in the left-side navigation pane to view the database restoration progress on the details page of the backup schedule. View the restoration progress
    Note The restoration time depends on the data volume and backup schedule specifications. For more information, see Performance description of backup and restoration.