Subpartition templates

Updated at:

This topic describes the supported transformations for subpartition templates in CREATE TABLE DDL. These transformations apply when you migrate data from an Oracle database to an Oracle tenant in OceanBase Database.

The subpartition template, subpartition_template, is defined as follows. For more information, see the official Oracle Database documentation.

SUBPARTITION TEMPLATE
  ( { range_subpartition_desc [, range_subpartition_desc] ...
    | list_subpartition_desc [, list_subpartition_desc] ...
    | individual_hash_subparts [, individual_hash_subparts] ...
    }
  ) | hash_subpartition_quantity

You can use the SUBPARTITION TEMPLATE keyword to define a subpartition template. The template uses the same syntax as custom partitions. For more information, see Custom partitions. The following is an example:

CREATE TABLE 
T (C1 DATE, C2 NUMBER)PARTITION BY RANGE (C1) SUBPARTITION BY RANGE (C2)
SUBPARTITION TEMPLATE 
(SUBPARTITION SP_TEMP VALUES LESS THAN (999))
(
  PARTITION SALES_Q1_1998 VALUES LESS THAN (TO_DATE('01-APR-1998','DD-MON-YYYY', 'NLS_DATE_LANGUAGE=AMERICAN')),
  PARTITION SALES_Q3_1999 VALUES LESS THAN (TO_DATE('01-OCT-1999','DD-MON-YYYY', 'NLS_DATE_LANGUAGE=AMERICAN')),
  PARTITION SALES_Q2_2000 VALUES LESS THAN (TO_DATE('01-JUL-2000','DD-MON-YYYY', 'NLS_DATE_LANGUAGE=AMERICAN')),
  PARTITION SALES_Q3_2000 VALUES LESS THAN (TO_DATE('01-OCT-2000','DD-MON-YYYY', 'NLS_DATE_LANGUAGE=AMERICAN')),
  PARTITION SALES_Q4_2000 VALUES LESS THAN (MAXVALUE)
  );