ALTER TABLE...SET SUBPARTITION TEMPLATE v13

Use the ALTER TABLE… SET SUBPARTITION TEMPLATE command to update the subpartition template for a table. The syntax is:

ALTER TABLE <table_name> SET SUBPARTITION TEMPLATE <num>;

To reset the subpartitions number to default using the subpartition template, the syntax is:

ALTER TABLE <table_name> SET SUBPARTITION TEMPLATE ();

Parameters

table_name

The name (optionally schema-qualified) of the partitioned table.

num

The number of subpartitions to be added for a partition.

Description

The ALTER TABLE… SET SUBPARTITION TEMPLATE command can be used to update the subpartition template in the table. If you are specifying a subpartition descriptor for a partition then a subpartition descriptor is used instead of a subpartition template. The subpartition template can be used whenever a subpartition descriptor is not specified for a partition. If either subpartition descriptor or subpartition template is not specified, then by default a single subpartition is created.

Note

The partitions added to a table after invoking ALTER TABLE… SET SUBPARTITION TEMPLATE command will use the new SUBPARTITION TEMPLATE.

The ALTER TABLE… SET SUBPARTITION TEMPLATE () command can be used to reset the subpartitions number to default 1.

example_setting_a_subpartition_template