All Products
Search
Document Center

PURGE DATABASE

Last Updated: Jun 18, 2021

Description

You can execute the PURGE DATABASE statement to delete a database from the recycle bin.

Syntax

 PURGE DATABASE object_name;

Parameters

Parameter

Description

object_name

The name of the object in the recycle bin. After an object is moved to the recycle bin, the system renames the object.

Examples

  • Delete database __recycle_$_1_1597384386029184 from the recycle bin.
OceanBase(admin@test)> create database db1;
Query OK, 1 row affected (0.03 sec)

OceanBase(admin@test)> drop database db1;
Query OK, 0 rows affected (0.04 sec)

OceanBase(admin@test)> show recyclebin;
+--------------------------------+---------------+----------+----------------------------+
| OBJECT_NAME                    | ORIGINAL_NAME | TYPE     | CREATETIME                 |
+--------------------------------+---------------+----------+----------------------------+
| __recycle_$_1_1597384386029184 | db1           | DATABASE | 2020-08-14 13:53:06.029367 |
+--------------------------------+---------------+----------+----------------------------+
1 row in set (0.01 sec)

OceanBase(admin@test)> purge database __recycle_$_1_1597384386029184;
Query OK, 0 rows affected (0.03 sec)

OceanBase(admin@test)> show recyclebin;