ALTER TABLE...RENAME PARTITION v16

Use the ALTER TABLE… RENAME PARTITION command to rename a table partition. The syntax takes two forms.

The first form renames a partition:

ALTER TABLE <table_name>
 RENAME PARTITION <partition_name>
 TO <new_name>;

The second form renames a subpartition:

ALTER TABLE <table_name>
 RENAME SUBPARTITION <subpartition_name>
 TO <new_name>;

Description

The ALTER TABLE… RENAME PARTITION command renames a partition.

The behavior for subpartition_name is the same as for the same variable used with the RENAME SUBPARTITION clause.

You must own the specified table to invoke ALTER TABLE… RENAME PARTITION or ALTER TABLE… RENAME SUBPARTITION.

Parameters

table_name

The name (optionally schema-qualified) of the table in which the partition or subpartition resides.

partition_name

The name of the partition to rename.

subpartition_name

The name of the subpartition to rename.

new_name

The new name of the partition or subpartition.

example_renaming_a_partition