Background information
RANGE partitioning: Multiple rows with column values in an ordered, continuous, and non-overlapping range are assigned to a partition. For more information, see Set partitioning rules.
Partitioning plan: When you insert data into a RANGE-partitioned table, if the inserted data exceeds the upper limit of the current partition, the data cannot be inserted and an error is returned. A partitioning plan is an extended feature for RANGE partitioning in ODC, which allows you to automatically manage RANGE-partitioned tables based on the partitioning strategies that you set. You do not need to manually create new partitions to maintain RANGE-partitioned tables.
This topic describes how to use partitioning plans in ODC to implement automatic management over new and deleted table partitions.
Create a partitioning plan
Notice
In ODC V4.0.0 and later versions, the partitioning plan feature supports only RANGE-partitioned tables of the timestamp type and RANGE COLUMNS-partitioned tables of the date type. During the creation of partitioning plans, for other RANGE-partitioned and RANGE COLUMNS-partitioned tables, ODC skips over the corresponding partitioning plan and throws a warning log.
Assume that in the odc_test database under the mysql410 data source, you want to create two partitions every three months and retain the created partitions for 12 months.
| Parameter | Example value |
|---|---|
| Project Name | odc_4.2.0 |
| Data Source | mysql410 |
| Database Name | odc_test |
On the Tasks tab in the SQL development window, choose Partitioning Plan > Create Partitioning Plan.
In the Create Partitioning Plan panel, specify the following parameters.
Parameter Description Data Source Select the data source to which the partitioning plan belongs. The default value is the current data source. Partitioning Strategy The information about the partitioning strategy. Search for and select a RANGE-partitioned table in the database and edit its partitioning strategy. - You can select Only tables that are not set are displayed on the right side of Partition Strategy to display only tables with no partitioning strategies.
- You can also select multiple RANGE-partitioned tables and configure a partitioning strategy for them at a time.
- In the Partition Strategy column, click the edit icon and then you can edit the number of partitions to create, partitioning interval, retention period, and naming rules.
- Number of Partitions: the number of partitions to create.
- Partition Interval: the interval for creating a partition.
- Retention Period: The created partition is automatically cleared after the retention period expires.
The following figure shows the configuration for creating one partition every one month and retaining the partitions for one month for the current table. The partitions that are created after one month are automatically dropped.

Remarks The business background of the project, such as the change purpose and expected goal. After you specify the preceding information, click Submit in the lower-right corner of the panel.
After a task is generated, the Tasks panel appears. In the Task panel, you can view the approval status and information about the task.
View a partitioning plan task
Task information
In the partitioning plan 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 basic information and settings of the task.
Parameter Description Basic task information Displays information such as Task Status, Task No., Task Type, Connection, Remarks, Created By, and Created At. Task settings You can view the partitioning strategy of the RANGE-partitioned table selected when you created the partitioning plan task. In the Task Details panel, click Initiate Again in the lower-right corner to initiate the task again.
Task process
In the Task Details panel, click the Task Flow tab to view process information about the task, such as Initiate Task, Approval Status, Execution Status, and Completion Result.
You can click Initiate Again in the lower-right corner of the panel to initiate the task again.
Associated records
In the Task Details panel, click the Associated Records tab to view the task record information, such as Task ID, Database, Created At, Task Status, and View.
You can click Initiate Again in the lower-right corner of the panel to initiate the task again.
Task logs
On the Task Details panel, click the Task Logs tab to view all logs and alert logs of the task.
Parameter Description All Logs Displays the complete information of all task logs, including INFO, ERROR, and WARN logs. You can click Find, Download, or Copy to search for, download, or copy all logs. Alert Logs Displays the ERROR and WARN logs of the task. When a task fails, you can view the error message in the alert logs. You can click Find, Download, or Copy to search for, download, or copy alert logs. You can click Initiate Again to initiate the task again.