Dropping Range Partitioning
Description
You can drop a partition by using the DROP PARTITION clause of the ALTER statement.
Syntax
ALTER {TABLE | CLASS} <table_name>
DROP PARTITION <partition_name>
- table_name : Specifies the name of the partitioned table.
- partition_name : Specifies the name of the partition to be dropped.
Example
The following example shows how to drop the before_2000 partition in the participant2 table.
ALTER TABLE participant2 DROP PARTITION before_2000;
Caution
- When dropping a partitioned table, all stored data in the partition are also dropped.
- If you want to change the partitioning of a table without losing data, use the ALTER TABLE...REORGANIZE PARTITION statement (see Range Partitioning Redefinition).
- The number of rows deleted is not returned when a partition is dropped. If you want to delete the data, but want to maintain the table and partitions, use the DELETE statement.