Adding Range Partitioning

Description

You can add range partitions by using the ADD PARTITION clause of the ALTER statement.

Syntax

ALTER {TABLE | CLASS} <table_name>

ADD PARTITION <partition definitions comma list>

partition definition comma list:

PARTITION <partition_name> VALUES LESS THAN ( <range_value> ),...

Example

Currently, the partition before the 2008 Olympic Games is defined in the participant2 table. The following example shows how to add the before_2012 and before_2016 partitions; the former will store the information about the 2012 Olympic Games and the latter will store the information about the 2016 Olympic Games.

ALTER TABLE participant2 ADD PARTITION (

PARTITION before_2012 VALUES LESS THAN (2012),

PARTITION before_2016 VALUES LESS THAN MAXVALUE );

Caution