All Products
Search
Document Center

ApsaraDB for OceanBase:Recycle bin management

Last Updated:Jun 06, 2024

Background information

The recycle bin temporarily stores deleted database objects. ODC allows you to search for and recover the deleted database objects.

Technically, the recycle bin is a data dictionary table that stores the information about deleted database objects. Deletion here refers to the DROP operation. Data that is deleted by the DELETE operation will not be moved to the recycle bin. Therefore, an object deleted by the DROP operation is not permanently deleted and still occupies storage space. You can use the PURGE operation or empty the recycle bin in ODC to release the space.

Query the recycle bin

Assume that you want to query the database objects under the data sourcemysql420in the SQL development window.

  1. In the left-side navigation pane, choose O&M Management > Recycle Bin.

    image

  2. Select the data sourcemysql420and click OK.

    image

  3. On the Recycle Bin page, you can query all database objects deleted from the data sourcemysql420.

    image

    Parameter

    Description

    Original Name

    The name of the deleted object specified by its creator. You can click Original Name to sort the objects by original name in ascending or descending order.

    Object Name

    The name that ODC gives to the object. Unlike the original name, the object name is never repeated and can uniquely identify an object.

    Object Type

    The type of the deleted object.

    Recycled At

    The timestamp when the object was deleted. The timestamps help you track deleted objects with ease.

Edit the recycle bin

Assume that you want to query the ccc table in the data sourcemysql420in the SQL development window.

Parameter

Example

Data Source

mysql420

Database Table

ccc

  1. In the recycle bin list, select the ccc table and click Restore.

    image

  2. On the Restore Database Object page, you can rename the object and click Restore.

    image

    In addition, the navigation bar on the recycle bin page provides buttons with the following features.

    Feature

    Description

    Delete

    ClickDeleteto purge the selected objects from the recycle bin and release the storage space.

    Restore

    ClickRecoverto recover the selected objects from the recycle bin to its original location.

    Clear

    ClickClearto clear the recycle bin so that all the deleted objects in the recycle bin are purged and the storage space is released.

    Search

    Enter the name of a deleted object in the search field to search for it.

    Settings

    ClickSettingsto specify whether to enable the recycle bin and the Truncate Table feature.

    • If the recycle bin is enabled, the structure of deleted objects will be moved to the recycle bin.

    • If the Truncate Table feature is enabled, the data of deleted objects will be retained.

    Refresh

    ClickRefreshto refresh the list of deleted objects in the recycle bin.

    Select All

    Click thecheck boxicon to select or deselect all objects.

    image

  3. In the SQL Confirmation dialog box, confirm the SQL statement and click Execute.

    image