From a nonpartitioned table to a partitioned table

 

Use the ADD partitioning-clause of the ALTER TABLE statement to change a nonpartitioned table into a partitioned table. Altering an existing table to use partitions is similar to creating a new partitioned table.

For example, to add range partitioning to the nonpartitioned table PAYROLL, use the following code:

ALTER TABLE PRODLIB.PAYROLL 
ADD PARTITION BY RANGE(EMPNUM)
(STARTING(MINVALUE) ENDING(500) INCLUSIVE, 
STARTING(501) ENDING(1000) INCLUSIVE, 
STARTING(1001) ENDING MAXVALUE))

 

Parent topic:

Modification of existing tables

 

Related concepts


Creation of partitioned tables