Tag: merge

  • OracleDB12c New Feature: Merging and Splitting Multiple Partitions

    In Oracle11g, you can merge or split two partitions. This feature is enhanced in 12c to merge and split multiple partitions in a single SQL thus reducing the maintenance operations. When merging range partitions, they must be adjacent.

    Merging Partitions Example:

    ALTER TABLE SALESDATA
    MERGE PARTITIONS S2012Q1, S2012Q2, S2012Q3, S2012Q4 INTO S2012;

    If range partitions are merged, you may use the “TO” clause.

    ALTER TABLE SALESDATA
    MERGE PARTITIONS S2012Q1 TO S2012Q4 INTO S2012;

    Read more about this feature and restrictions in Oracle Documentation.

    Splitting Partitions Example:

    ALTER TABLE SALESDATA SPLIT PARTITION S2014 INTO
    (PARTITION S2014Q1 VALUES LESS THAN TO_DATE('01-APR-14','DD-MON-YY')),
    (PARTITION S2014Q2 VALUES LESS THAN TO_DATE('01-JUL-14','DD-MON-YY')),
    (PARTITION S2014Q3 VALUES LESS THAN TO_DATE('01-OCT-14','DD-MON-YY')),
    (PARTITION S2014Q4 );

    Read more in Oracle Documentation