You can execute the SHOW RECYCLEBIN statement to query for objects in the recycle bin.
Considerations
You can delete tenants only in the sys tenant. Therefore, MySQL and Oracle user tenants can be moved only to the recycle bin of the sys tenant after they are dropped. In the sys tenant, you can view databases, tables, and indexes of the current tenant as well as those of all other tenants in the recycle bin. In a MySQL user tenant, you can view only databases, tables, and indexes in the recycle bin. In an Oracle user tenant, you can view only tables and indexes in the recycle bin.
Background
When you drop a database object or tenant, note that:
If the recycle bin is enabled, the object or tenant is moved to the recycle bin and can be viewed in the recycle bin.
If the recycle bin is disabled, the object or tenant is not moved to the recycle bin and cannot be viewed in the recycle bin.
Procedure
Log on to the database as an administrator of the
systenant or a user tenant.Note
- The administrator user of a MySQL user tenant is
rootand that of an Oracle user tenant isSYS. - If you want to view tenants in the recycle bin, log on to the database as an administrator of the
systenant.
Example (the command can vary in practice):
obclient -h10.xx.xx.xx -P2883 -uroot@sys -p***** -AFor more information, see Database connection overview.
- The administrator user of a MySQL user tenant is
Execute the following statement to view the objects in the recycle bin.
obclient [(none)]> SHOW RECYCLEBIN; +-------------------------------------+-------------------+--------+----------------------------+ | OBJECT_NAME | ORIGINAL_NAME | TYPE | CREATETIME | +-------------------------------------+-------------------+--------+----------------------------+ | RECYCLE_$_100017_1672050541224936 | oracle001 | TENANT | 2023-01-16 11:01:40.258000 | | __recycle_$_100017_1673426335319344 | __idx_500788_idx1 | INDEX | 2023-01-11 16:38:55.318878 | | __recycle_$_100017_1673426335329040 | __idx_500788_idx2 | INDEX | 2023-01-11 16:38:55.328312 | | __recycle_$_100017_1673426335331800 | t1 | TABLE | 2023-01-11 16:38:55.331481 | +-------------------------------------+-------------------+--------+----------------------------+ 4 rows in setParameters in the returned results:
OBJECT_NAMEindicates the name of an object in the recycle bin.ORIGINAL_NAMEindicates the original name of the object.TYPEindicates the type of the object in the recycle bin. Valid values:systenant:INDEX,TABLE,DATABASE, andTENANT. In the example above,oracle001is a tenant object in the recycle bin.MySQL user tenants:
INDEX,TABLE, andDATABASE.Oracle user tenants:
INDEXandTABLE.
CREATETIMEindicates the time when the object was placed in the recycle bin.
More information
For more information about the recycle bin, see the following topics: