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;
The ALTER TABLE
… RENAME PARTITION
command renames a partition.
Query the ALL
view to display the partition names:
ALTER TABLE sales RENAME PARTITION americas TO n_america;
Querying the ALL
view demonstrates that the partition has been successfully renamed:
Use the ALTER TABLE… SET INTERVAL
command to convert an existing range-partitioned table to interval partitioning. The database automatically creates a new partition of a specified range or interval for the partitioned table when INTERVAL
is set. The syntax is:
ALTER TABLE table_name SET INTERVAL (constant | expression);
The ALTER TABLE… SET INTERVAL
command can be used to convert the range-partitioned table to use interval partitioning. A new partition of a specified interval is created and data can be inserted into the new partition.
The SET INTERVAL ()
command can be used
to disable interval partitioning. The database converts an interval partitioned table to range-partitioned and sets the boundaries of the interval partitions to the boundaries for the range partitions.
Query the ALL_TAB_PARTITIONS
view before a database creates an interval partition.
Then, query the ALL_TAB_PARTITIONS
view again after the insert. The interval partition is successfully created and data is inserted. A system-generated name of the interval partition is created that varies for each session.