This topic describes how to reduce the number of hash and key partitions and all their subpartitions, and move their data to other partitions and subpartitions.
Syntax
The ALTER TABLE…COALESCE PARTITION statement is used to reduce the number of hash and key partitions and all their subpartitions, and move their data to other partitions and subpartitions.
ALTER TABLE table_name COALESCE PARTITION num;Parameters
| Parameter | Description |
| table_name | The name (optionally schema-qualified) of the partitioned table. |
| num | The number of partitions to be reduced. It must be less than the total number of partitions in the table. |
Examples
Reduce two partitions in the
sales_hash_hash partitioned table:ALTER TABLE sales_hash_hash COALESCE PARTITION 2;Reduce two partitions in the
sales_key_key partitioned table:ALTER TABLE sales_key_key COALESCE PARTITION 2;