All Products
Search
Document Center

PolarDB:Table recycle bin

Last Updated:Sep 13, 2023

This topic introduces the operation of the table recycle bin.

Background

The table recycle bin feature of PolarDB-X 1.0 allows you to restore table data that is deleted by mistake.

After you enable the table recycle bin feature for PolarDB-X 1.0, the tables that you deleted by using the DROP TABLE command are moved to the recycle bin and become invisible to you. After the tables are moved to the recycle bin for two hours, they are automatically cleared and cannot be restored. You can view, restore, and clear deleted tables in the recycle bin.

Limits and notes

  • The table recycle bin feature is only supported on PolarDB-X 1.0 instances of 5.3.3-1670435 and later versions.

  • The table recycle bin feature for PolarDB-X 1.0 is disabled by default. For more information about how to enable it, see Enable the table recycle bin feature.

  • The table recycle bin feature for PolarDB-X 1.0 is not applicable to tables that you delete by using the TRUNCATE TABLE command.

  • Tables in the recycle bin still occupy the storage space of ApsaraDB for RDS (RDS) instances before they are automatically cleared. To quickly release the space, you can go to the recycle bin for manual clearing.

  • PolarDB-X 1.0 allows you to manage the table recycle bin by using command lines.

Enable the table recycle bin feature

  1. Log on to the PolarDB-X 1.0 console and choose the region where the target instance locating.

  2. On the Instances page, find the target instance and click on its ID.

  3. On the left navigation pane, cick Data Recovery>Table Recycle Bin.

  4. On the Table Recycle Bin page, click the target database name tab. Click Enabled.

  5. In the dialog box that prompts, click OK.

Restore a data table

  1. On the Table Recycle Bin page, click the target database name tab to view the list of tables.

  2. In the table list, find the target table, and click Recovery in the Actions column.

Clear a data table

  1. On the Table Recycle Bin page, click the target database name tab to view the list of tables.

  2. If you want to delete a specified table, find the table in table list, and click Delete in the Actions column.

    If you want to clear all data tables from the recycle bin, click Empty Recycle Bin.

Disable the table recycle bin feature

  1. On the Table Recycle Bin page, click the target database name tab.

  2. Click Disable.