All Products
Search
Document Center

Table recycle bin

Last Updated: Aug 13, 2020

Background

The table recycle bin feature of Distributed Relational Database Service (DRDS) allows you to restore table data that is deleted by mistake.

After you enable the table recycle bin feature for DRDS, 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 DRDS instances of 5.3.3-1670435 and later versions.
  • The table recycle bin feature for DRDS 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 DRDS 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.

Procedure

Enable the table recycle bin feature

  1. Log on to DRDS 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.
  5. Click Enabled.
    1
  6. In the dialog box that prompts, click OK.
    2

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.
    1

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.
    2

    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.
    dis

Manage the table recycle bin by using command lines

DRDS allows you to manage the table recycle bin by using command lines. For more information, see Manage the table recycle bin.