Background information
ODC allows you to regularly archive table data in a source database to another database, so that query performance and business operations are not affected by the increase of online data.
This topic describes how to archive data by submitting a data archiving ticket.
Prerequisites
The table to be archived contains a primary key.
Create a data archive task
Assume that you want to archive the student table in the odc_test database to the test database.
| Parameter | Example value |
|---|---|
| Data Source | mysql_4.2.0 |
| Source Database Name | odc_test |
| Destination Database Name | test |
| Table Name | student |
In the left-side navigation pane in the SQL development window, click Tasks and choose Data Archive > Create Data Archive Task.
On the Create Data Archive Task page, specify the following parameters.
Parameter Description Source Database Select the database to which the table belongs. Destination Database Select the database where the table is archived. Variable Configuration Optional. 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.Archive Scope Select Partial Tables or All Tables to archive some or all tables in the source 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 Archive list on the Tasks page.
View data archiving tasks
Task information
In the data archive task list on 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.