The instance database and table recycle bin manages databases and tables deleted by all tenants. This topic describes how to manage the recycle bin, including enabling or disabling it, viewing recycled objects, and clearing the recycle bin.
Background information
Before you use the cluster database and table recycle bin, note the following:
After you enable the database and table recycle bin for a cluster instance, the recycle bin is automatically enabled for all tenants under the instance. Enabling the recycle bin for a single tenant is not supported.
Databases and tables deleted by all tenants under the cluster are moved to the recycle bin. You can restore them from the recycle bin. Storage space is released only after objects are deleted from the recycle bin.
Enabling or disabling the recycle bin affects only new sessions. Sessions created before the change are not affected.
Standby instances cannot enable the database and table recycle bin independently. The setting and parameters are inherited from the primary cluster instance when the standby instance is created. The standby instance recycle bin is read-only and does not support edit operations.
Delete and restore operations on databases and tables in the primary instance recycle bin are automatically synchronized to the standby instance.
Note
Operations on the primary instance recycle bin are independent of the standby instance. That is, operations on the primary recycle bin do not immediately change the content in the standby recycle bin. Data in the standby recycle bin is updated during primary-standby synchronization.
Manage the instance database and table recycle bin
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Instances.
In the instance list, click the target cluster name to open the Instance Workbench.
In the left-side navigation pane of the instance workbench, click Recycle Bin to manage the instance database and table recycle bin.
Enable the instance database and table recycle bin
Open the instance database and table recycle bin page.
Click Enable Recycle Bin.
After the recycle bin is enabled, the database and table recycle bin is enabled for all tenants under the instance. Databases and tables deleted afterward appear in the recycle bin.
View the instance database and table recycle bin
Open the instance database and table recycle bin page.
View deleted objects on the recycle bin page.
Click the Databases tab to view deleted databases, including Original Database Name, Tenant Name/ID, Tenant Mode, Storage Used, Recycle Time (UTC+8), Auto Cleanup Time (UTC+8), Status, and Actions.
Click the button in the Actions column and select Delete, or select multiple databases and click Batch Delete at the bottom of the page to permanently delete the selected databases. After you confirm the deletion, the status of the specified database changes to Deleting until the deletion task is completed.
Click the button in the Actions column and select Restore, or select multiple databases and click Batch Restore at the bottom of the page to restore the selected databases. After you confirm the restore, the status of the specified database changes to Restoring until the restore task is completed.
Click the Tables tab to view deleted tables, including Original Table Name, Original Database, Tenant/ID, Tenant Mode, Storage Used, Recycle Time (UTC+8), Auto Cleanup Time (UTC+8), Status, and Actions.
Click the button in the Actions column and select Delete, or select multiple tables and click Batch Delete at the bottom of the page to permanently delete the selected tables.
Click the button in the Actions column and select Restore, or select multiple tables and click Batch Restore at the bottom of the page to restore the selected tables.
Clear the instance database and table recycle bin
Notice
The default auto cleanup period for the recycle bin is 7 days (consistent with the backup and restore period). The maximum period is 1096 days. However, manually clearing the recycle bin or setting an auto cleanup period shorter than the backup and restore period may prevent 100% lossless recovery.
Open the instance database and table recycle bin page.
On the recycle bin page, click Configure to the right of Auto Cleanup to set the auto cleanup period.
In the dialog box, set the auto cleanup period and click OK. After configuration, the system clears the recycle bin once at the daily major compaction time and once at the configured auto cleanup time each day.
Click Empty Recycle Bin in the upper-right corner of the page to manually clear the recycle bin.
Disable the instance database and table recycle bin
Notice
- If tenants exist under the instance, the recycle bin is disabled for all tenants at the same time.
- Disabling the recycle bin does not immediately clear databases and tables already in the recycle bin. You can clear them manually or wait for them to be cleared automatically after they expire.
Open the instance database and table recycle bin page.
On the recycle bin page, click Disable Recycle Bin in the upper-right corner.
In the dialog box, confirm the risks and click Disable.
