All Products
Search
Document Center

PolarDB:Table recycle bin

Last Updated:Jul 15, 2024

This topic describes the table recycle bin.

Background information

The table recycle bin feature in PolarDB-X 1.0 allows you to restore the tables that you remove by accident.

After you enable the table recycle bin feature in PolarDB-X 1.0, tables that are removed by executing the DROP TABLE statement are moved to the table recycle bin and are no longer visible. Two hours after the tables are moved to the table recycle bin, they are automatically deleted and cannot be restored. You can view, restore, and clear the tables in the table recycle bin.

Limits

  • This feature is supported on an instance of PolarDB-X 1.0 5.3.3-1670435 or later.

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

  • In PolarDB-X 1.0, the tables that are removed by executing the TRUNCATE TABLE statement are not moved to the table recycle bin.

  • Tables in the recycle bin still occupy the storage space before they are automatically cleared. To release the storage space as soon as possible, you can access the recycle bin to manually delete them.

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

  • After you enable the table recycle bin feature, if the error message "cant find file" is returned when you execute the DROP TABLE statement, you must disable the recycle bin feature and then execute the DROP TABLE statement again.

Enable the table recycle bin

  1. Log on to the PolarDB-X console and select the region where the instance is deployed.

  2. On the Instances page, click the instance name.

  3. In the left-side navigation pane, click Table Recycle Bin.

  4. Select the database for which you want to enable the table recycle bin and click Enable.

  5. In the message that appears, click OK.

Restore tables

  1. Go to the Table Recycle Bin page, find the database to view the list of tables in the table recycle bin.

  2. Find the table and click Restore.

Delete tables

  1. Go to the Table Recycle Bin page, find the database to view the list of tables in the table recycle bin.

  2. Find the table and click Delete. To clear all tables in the recycle bin, click Clear Recycle Bin.

Disable the table recycle bin feature

  1. Go to the Table Recycle Bin page and find the database.

  2. Click Disable.