All Products
Search
Document Center

Recycle bin

Last Updated: Sep 01, 2020

Distributed Relational Database Service (DRDS) supports the table recycle bin feature. For more information, see Table recycle bin . This topic describes how to manage the table recycle bin by using the command lines.

Drop a table forcibly

Add the PURGE parameter to the end of the DROP statement to forcibly drop a table without moving it into the recycle bin.

  1. DROP TABLE table-name PURGE

Show the recycle bin

  1. SHOW recyclebin
  2. mysql> show recyclebin;
  3. +------+--------------------------+---------------+---------------------+
  4. | ID | NAME | ORIGINAL_NAME | CREATED |
  5. +------+--------------------------+---------------+---------------------+
  6. | 0 | BIN_2FGVWOE1F8JDYTR0EKIQ | rb1 | 2018-07-05 10:23:17 |
  7. +------+--------------------------+---------------+---------------------+
  8. 1 row in set (0.01 sec)

Recover a table

  1. FLASHBACK TABLE bin-name TO BEFORE DROP [RENAME TO new-name]
  2. mysql> flashback table BIN_2FGVWOE1F8JDYTR0EKIQ to before drop;
  3. Query OK, 0 rows affected (0.14 sec)

Clean up a table

  1. PURGE TABLE bin-name
  2. mysql> purge table BIN_2B0KUPYRZJ6C1UV4BBYF;
  3. Query OK, 0 rows affected (0.13 sec)

Empty the recycle bin

  1. PURGE recyclebin