OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Developer Center

V4.3.3
  • Overview
    • What is ODC?
    • Features
    • Architecture
    • Limitations
    • ODC console
  • Quick Start
    • Client ODC
      • Overview
      • Install Client ODC
      • Use Client ODC
    • Web ODC
      • Overview
      • Deploy Web ODC
      • Use Web ODC
  • Data Source Management
    • Create a data source
    • Data sources and project collaboration
    • Database O&M
      • Session management
      • Global variable management
      • Recycle bin management
  • SQL Development
    • SQL editing and execution
    • Perform PL compilation and debugging
    • Use the command-line window
    • Edit and export the result set of an SQL statement
    • Execution analysis
    • Generate test data
    • Database objects
      • Table objects
        • Overview
        • Create a table
      • View objects
        • Overview
        • Create a view
        • Manage views
      • Function objects
        • Overview
        • Create a function
        • Manage functions
      • Stored procedure objects
        • Overview
        • Create a stored procedure
        • Manage stored procedures
      • Sequence objects
        • Overview
        • Create a sequence
        • Manage sequences
      • Package objects
        • Overview
        • Create a program package
        • Manage program packages
      • Trigger objects
        • Overview
        • Create a trigger
        • Manage triggers
      • Type objects
        • Overview
        • Create a type
        • Manage types
      • Synonym objects
        • Overview
        • Create a synonym
        • Manage synonyms
  • Import and Export
    • Import schemas and data
    • Export schemas and data
  • Database Change Management
    • User Permission Management
      • Users and roles
      • Automatic authorization
    • Project collaboration management
    • Risk levels, risk identification rules, and approval processes
    • SQL check specifications
    • SQL window specification
    • Database change management
    • Logical database change management
    • Batch database change management
    • Online schema changes
    • Synchronize shadow tables
    • Schema comparison
  • Data Lifecycle Management
    • Archive data
    • Clean up data
    • Partitioning Plan Management
      • Manage partitioning plans
      • Set partitioning strategies
      • Examples
    • SQL plan task
  • Data Desensitization and Auditing
    • Desensitize data
    • Operation records
  • Notification Management
    • Overview
    • View notification records
    • Manage Notification Channel
      • Create a notification channel
      • View, edit, and delete a notification channel
      • Configure a custom channel
    • Manage notification rules
  • System Integration
    • Login integration
    • Approval integration
    • SQL approval integration
    • Bastion host integration
  • Deployment Guide
    • Deployment overview
    • Preparations before deployment
    • Deploy ODC in single-node mode
    • Deploy ODC in high-availability mode
    • Deployment verification
  • Upgrade Guide
    • Upgrade Overview
    • Preparations before upgrade
    • Update single-node ODC
    • Update high-avaliability ODC
    • Upgrade verification
    • Rollback after upgrade failed
  • Troubleshooting
    • ODC troubleshooting process
    • Collect Message
      • View the runtime environment and version information
      • View web ODC logs
      • View client ODC logs
      • View end-to-end ODC-related logs
      • View ODC MetaDB data
      • Query the index status in OceanBase Database V4.x
      • Query the index status in OceanBase Database V1.4.x to V3.2.x
      • Collect JVM runtime information
      • Use tcpdump to capture packets
    • FAQ
      • Installation of client ODC
      • Web ODC deployment and startup
      • Connection Information
      • Command-line window
      • DDL statement display
  • Release Note
    • V4.3
      • ODC V4.3.3
      • ODC V4.3.2
      • ODC V4.3.1
      • ODC V4.3.0
    • V4.2
      • ODC V4.2.4
      • ODC V4.2.3
      • ODC V4.2.2
      • ODC V4.2.1
      • ODC V4.2.0
    • V4.1
      • ODC V4.1.3
      • ODC V4.1.2
      • ODC V4.1.1
      • ODC V4.1.0
    • V4.0
      • ODC V4.0.2
      • ODC V4.0.0
    • V3.4
      • ODC V3.4.0
    • V3.3
      • ODC V3.3.3
      • ODC V3.3.2
      • ODC V3.3.1
      • ODC V3.3.0
    • V3.2
      • ODC V3.2.3
      • ODC V3.2.2
      • ODC V3.2.1
      • ODC V3.2.0

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Developer Center
  3. V4.3.3

Clean up data

Last Updated:2026-09-03 09:10:53

Background information
Prerequisites
Considerations
Create a data cleanup task
View a data cleanup task
Task information
Execution records
Operation records
References

This topic describes how to clean up archived data by submitting a ticket.

Background information

After you archive data in the source database to the destination database, OceanBase Developer Center (ODC) allows you to delete the data from the source database to improve the query performance and reduce the online storage costs.

The example in this topic describes how to create a data cleanup task to clean up the employee table in the test2 database in ODC.

Note

The data used in this topic are examples. You can replace them with actual data as needed.

Prerequisites

  • The table to be cleaned up has a primary key.

Considerations

  • Pay attention to the following rules:

    • CPU and memory exhaustion prevention is not supported for a MySQL data source.
  • Data sources supported for data cleanup are as follows:

    • OceanBase MySQL data sources

    • OceanBase Oracle data sources

    • MySQL data sources

    • Oracle data sources

    • PostgreSQL data sources

  • Data cleanup is not supported in the following cases:

    • The source table in the MySQL or OceanBase MySQL data source does not have a primary key or non-null unique index.

    • The source table in the OceanBase MySQL data source contains fields of the XMLType data type.

    • The source table in the Oracle, OceanBase Oracle, or PostgreSQL data source does not have a primary key.

    • The source table in the OceanBase Oracle data source contains fields of the JSON or XMLType data type.

    • The archiving condition contains a LIMIT clause.

    • The table contains a foreign key.

Create a data cleanup task

  1. In the SQL window, create a table named employee by using an SQL statement.

    1

    CREATE TABLE `employee` (
    `emp_no` int(120) NOT NULL COMMENT 'employee number',
     `birthday` date DEFAULT NULL COMMENT 'employee birthday',
     `name` varchar(120) DEFAULT NULL COMMENT 'employee name',
     `time` date NOT NULL COMMENT 'time' COMMENT 'create time',
     PRIMARY KEY (`time`)
    ) partition by range columns(time) (
     partition p2023_01
     values
      less than ('2023-01-01'),
      partition p2023_02
    values
      less than ('2023-02-01')
    )
    
  2. On the Tickets tab in the left-side navigation pane of the homepage, click Data Cleanup and then click Create New.

    2

  3. On the Create Data Cleanup Task page, configure the following parameters.

    3

    Parameter
    Description
    Need Verification Before Cleanup You can select this option to choose to verify whether the data in the table to be cleaned up is consistent with that in the destination table. If not, the cleanup will not be executed.
    Source Database The database to which the table belongs.
    Target Database The database to which the destination table belongs.
    Cleanup Scope
    • Partially Cleaned: specifies to clean up only tables that meet filtering conditions in the database.
      • You can configure filtering conditions by using constants or referencing variables defined in Custom Variable. For example, in time<'${create_time}', create_time is the name of a variable configured in Custom Variable and time is a field in the table to be cleaned up.
      • You can select Specify Partition and specify the partitions to be cleaned up.
    • Whole Library Cleaning: specifies to clean up all tables in the database.
    Custom Variable Optional. You can define variables and set time offsets to filter rows to be cleaned up.
    Execution Mode The execution mode of the task. Valid values: Execute Now, Scheduled Execution, and Periodic Execution.
    Task Settings Configure a throttling strategy.
    • Specify Task Duration: You can select this option and specify a duration for the task. If the task is not completed within the specified duration, it will be suspended and wait for the next scheduling.
    • Search strategy: You can select full table scan or condition matching.
    • Row Limit: limits the total number of data rows operated per second.
    • Data Size Limit: limits the total size of data operated per second.
    • Use Primary Key for Cleanup: specifies whether to use the primary key to clean up data.
    Description Optional. Additional information about the task, which cannot exceed 200 characters in length.
  4. Click Create, preview the SQL statement for data cleanup, and click OK.

    4

  5. After the task is generated, choose Tickets > Data Cleanup to view the task.

    5

View a data cleanup task

Task information

  1. In the data cleanup task list on the Tickets tab, click View in the Actions column of a task.

  2. In the task details panel, click the Task Information tab and view information such as the task type, source database, destination database, variable configurations, cleanup scope, and execution mode.

    6

Execution records

In the task details panel, click the Execution Records tab and view the task status and execution details.

7

Operation records

In the task details panel, click the Operating Records tab and view the task approval status and operation records.

8

References

  • Archive data

Previous topic

Archive data
Last

Next topic

Manage partitioning plans
Next
on this page
Background information
Prerequisites
Considerations
Create a data cleanup task
View a data cleanup task
Task information
Execution records
Operation records
References