Background information
ODC allows you to delete data in the source database after it is archived in the destination database. This improves database query performance and reduces online storage costs.
This topic describes how to clean up archived data by submitting a data cleanup ticket.
Prerequisites
The tables to be cleaned up contain primary keys.
Create a data archive task
Assume that you want to clear the student table in the odc_test database.
| Parameter | Example value |
|---|---|
| Data Source | mysql_4.2.0 |
| Source Database Name | odc_test |
| Table Name | student |
In the left-side navigation pane on the SQL development page, click Tasks and choose Data Cleanup > Create Data Cleanup Task.
On the Create Data Cleanup Task page, specify the following parameters.
Parameter Description Source Database Select the database to which the table belongs. Variable Configuration You can specify filtering conditions to archive only desired rows. For example, you can use the condition create_time < '${bizdate}, wherebizdateis the task execution time by default. You can configure the offset in the frontend.Cleanup Scope Select Partial Tables or All Tables to clear some or all archived tables in the database. Operation Mode Select Execute Immediately, Timed Execution, or Periodic Execution. Remarks The description of the change. The description can contain up to 200 characters. This parameter is optional. Click Create.
After the task is generated, you can view the task information in the Data Cleanup Task list on the Tasks page.
View data cleanup tasks
Task information
In the data cleanup task list in the Task Center page, click View in the Actions column.
In the Task Details panel, click the Task Information tab to view the task type, source database, destination database, variable configuration, archive scope, and execution method.
Task process
In the Task Details panel, click the Task Process tab to view the task status, approval status, execution status, and execution result of the task.
Execution records
In the Task Details panel, click the Execution Records tab to view the task status and perform retry or rollback operations.
Task logs
In the Task Details panel, click the Operating Records tab to view the approval status and records of the task.