A database must support data backup and restoration. PolarDB-X provides data restoration at different levels. For example, PolarDB-X supports instance-level consistent backup and restoration, table-level table recycle bin, and SQL query flashback.

Consistent backup and restoration

The consistent backup and restoration feature allows you to restore the data of an instance to a specified point in time that is accurate to the second. The consistent backup and restoration feature of PolarDB-X is developed based on periodic full backups and global binary logging. For more information about global binary logging, see Global data change logging. 456789

For example, a PolarDB-X instance is backed up at 00:00 every Monday, Tuesday, and Friday, as shown in the preceding figure. If you want to restore the instance data of 14:25:26 on the previous Sunday, the system selects a full backup set that is generated at a point in time that is closest to the recovery time objective. The selected point in time is 00:00 of the previous Friday. Then, the system replays global binary logs from 00:00:00 of the previous Friday to 14:25:26 of the previous Sunday to obtain the required data snapshot.

Table recycle bin

456789If the table recycle bin feature is enabled, the tables that are dropped or truncated are temporarily placed in the recycle bin. If a table needs to be restored within two hours after it is placed in the recycle bin, it can be retrieved from the table recycle bin in the console.

SQL query flashback

The SQL query flashback feature helps you roll back or partially roll back operations that are incorrectly performed. For example, if you use a DELETE statement to delete data by mistake, you can use the SQL query flashback feature to generate a SQL statement that can recover the data. The SQL statement is an INSERT statement on the deleted data. 456879