3.5.8 ALTER TABLE… RENAME PARTITION

Table of Contents Previous Next


3 Enhanced SQL Features : 3.5 Partitioning Command Syntax : 3.5.8 ALTER TABLE… RENAME PARTITION

Use the ALTER TABLE… RENAME PARTITION command to rename a table partition. The syntax takes two forms:
ALTER TABLE table_name
RENAME PARTITION partition_name
TO new_name;
ALTER TABLE table_name
RENAME SUBPARTITION subpartition_name
TO new_name;
You can rename a partition with the RENAME PARTITION or RENAME SUBPARTITION clause.
You can rename a subpartition with RENAME PARTITION or RENAME SUBPARTITION clause.
The ALTER TABLERENAME PARTITION and ALTER TABLERENAME SUBPARTITION commands rename a partition or subpartition. You must own the specified table to invoke ALTER TABLERENAME PARTITION or ALTER TABLE RENAME SUBPARTITION.
Query the ALL_TAB_PARTITIONS view to display the partition names:
The following command renames the americas partition to n_america:
ALTER TABLE sales
RENAME PARTITION americas TO n_america;
Querying the ALL_TAB_PARTITIONS view demonstrates that the partition has been successfully renamed:

3 Enhanced SQL Features : 3.5 Partitioning Command Syntax : 3.5.8 ALTER TABLE… RENAME PARTITION

Table of Contents Previous Next