Table recycle bin
The table recycle bin in PolarDB-X 1.0 lets you recover tables dropped by accident. When enabled, running DROP TABLE moves the table to the recycle bin instead of permanently deleting it. You have up to 2 hours to restore the table before it is automatically deleted.
How it works
When you run DROP TABLE on a database with the recycle bin enabled, PolarDB-X 1.0 moves the table to the recycle bin rather than deleting it immediately. The table is no longer visible in the database but remains recoverable for up to 2 hours. After 2 hours, the table is permanently deleted.
Tables in the recycle bin continue to occupy storage space until they are restored or deleted. To free up storage before the 2-hour window expires, delete the tables manually from the recycle bin.
OnlyDROP TABLEtriggers the recycle bin. Tables cleared withTRUNCATE TABLEare not moved to the recycle bin and cannot be recovered through this feature.
Limitations
| Limitation | Details |
|---|---|
| Minimum version | PolarDB-X 1.0 5.3.3-1670435 or later |
| Default state | Disabled. Must be enabled per database before use. |
| Supported operations | DROP TABLE only. TRUNCATE TABLE is not supported. |
| Storage | Tables in the recycle bin continue to occupy storage space until restored or deleted. |
| Management | PolarDB-X 1.0 allows you to manage the table recycle bin by using the command line. |
| Known issue | If the cant find file error appears when running DROP TABLE after enabling the recycle bin, disable the recycle bin and run DROP TABLE again. |
Enable the recycle bin
Log on to the PolarDB-X console and select the region where your instance is deployed.
On the Instances page, click the instance name.
In the left-side navigation pane, click Table Recycle Bin.
Select the database for which you want to enable the recycle bin, then click Enable.
In the confirmation dialog, click OK.
Restore a table
On the Table Recycle Bin page, find the database and locate the table you want to restore.
Click Restore.
A table can be restored only within 2 hours of being dropped. After 2 hours, the table is permanently deleted and cannot be recovered.
Delete tables from the recycle bin
On the Table Recycle Bin page, find the database and locate the table.
To delete a single table, click Delete. To remove all tables in the recycle bin at once, click Clear Recycle Bin.
Disable the recycle bin
On the Table Recycle Bin page, find the database.
Click Disable.