All Products
Search
Document Center

ApsaraDB for OceanBase:Add partitions and subpartitions

Last Updated:Jun 03, 2024

This topic describes the supported conversion scope of ALTER TABLE DDL operations for adding partitions and subpartitions during data migration from an Oracle database to an Oracle tenant of OceanBase Database.

Syntax

add_table_partition:
ADD {
PARTITION [ partition ] add_range_partition_clause
  [, PARTITION [ partition ] add_range_partition_clause ]...
| PARTITION [ partition ] add_list_partition_clause
  [, PARTITION [ partition ] add_list_partition_clause ]...
| PARTITION [ partition ] add_system_partition_clause
  [, PARTITION [ partition ] add_system_partition_clause ]...
  [ BEFORE { partition_name | partition_number } ]
| PARTITION [ partition ] add_hash_partition_clause
} [ dependent_tables_clause ]


add_range_partition_clause:
range_values_clause
[ table_partition_description ]
[ external_part_subpart_data_props ]
[ ( { range_subpartition_desc [, range_subpartition_desc] ...
    | list_subpartition_desc [, list_subpartition_desc] ...
    | individual_hash_subparts [, individual_hash_subparts] ...
    }
  ) | hash_subparts_by_quantity ]
[ update_index_clauses ]

add_list_partition_clause:
list_values_clause
[ table_partition_description ]
[ external_part_subpart_data_props ]
[ ( { range_subpartition_desc [, range_subpartition_desc] ...
    | list_subpartition_desc [, list_subpartition_desc] ...
    | individual_hash_subparts [, individual_hash_subparts] ...
    }
  ) | hash_subparts_by_quantity ]
[ update_index_clauses ]

add_system_partition_clause:
[table_partition_description]
[update_index_clauses]

add_hash_partition_clause:
partitioning_storage_clause
[ update_index_clauses ]
[ parallel_clause ]
[ read_only_clause ]
[ indexing_clause ]

dependent_tables_clause:
DEPENDENT TABLES
( table ( partition_spec [, partition_spec]... 
          [, table ( partition_spec [, partition_spec]... ]
        )
)

Supported DDL

  • Adding LIST and RANGE partitions is supported.

  • Adding LIST and RANGE subpartitions is supported.

Unsupported DDL

  • Adding HASH partitions is not supported. An error is returned when you perform this operation.

  • Adding HASH subpartitions is not supported. An error is returned when you perform this operation.

  • Adding SYSTEM partitions is not supported. An error is returned when you perform this operation.

Ignored clauses and options

Note

The following clauses and options are ignored and are not resolved or converted when they are specified in the synchronized DDL operations.

  • The dependent_tables_clause clause for specifying partition attributes.

  • The update_index_clauses clause for updating indexes in a table.