The following example creates a table sales that is range partitioned by date and hash subpartitioned by country. Use the following command to create the sales table:
The table definition creates four partitions (q1_2012, q2_2012, q3_2012, and q4_2012), each partition consisting of two subpartitions with system-generated names.
To set the subpartition template on the sales table, invoke the following command:
The sales table is modified with the subpartition template set to eight. Now, if you try to add a new partition q1_2013, a new partition will be created consisting of eight subpartitions as described in the subpartition template.
Query the ALL_TAB_PARTITIONS view, the q1_2013 partition is successfully added comprising of eight subpartitions with system-generated names assigned to them.
Example - Resetting a SUBPARTITION TEMPLATE
The following example creates a list-partitioned table sales that is list partitioned by country and hash subpartitioned by part_no. Use the following command to create the sales table:
The table contains three partitions (americas, asia, and europe), each partition consists of three subpartitions with system-generated names.
The following command resets the subpartition template on the sales table.
The sales table is modified with the subpartition template reset to default 1. Now, try to add a new partition east_asia using the following command:
Query the ALL_TAB_PARTITIONS view, a new partition east_asia will be created consisting of one subpartition with a system-generated name assigned to them.