Monday, November 23, 2015

Play with MERGE partition command

The partition name and high value



The error message has self-explanation.

ALTER TABLE TEST_UNBILLED  
MERGE PARTITIONS P2014_02_01, P2014_02_07 INTO PARTITION P2014_02_07
UPDATE INDEXES;

Table altered.



ALTER TABLE TEST_UNBILLED  
MERGE PARTITIONS P2014_02_07, P2014_02_11 INTO PARTITION P2014
UPDATE INDEXES;

Table altered.



SYS> ALTER TABLE TEST_UNBILLED
  2  MERGE PARTITIONS P2014_02_14, P2014 INTO PARTITION P2014
  3  UPDATE INDEXES;
MERGE PARTITIONS P2014_02_14, P2014 INTO PARTITION P2014
                 *
ERROR at line 2:
ORA-14273: lower-bound partition must be specified first


Elapsed: 00:00:00.01


SYS> ALTER TABLE TEST_UNBILLED
  2  MERGE PARTITIONS P2014, P2014_02_14 INTO PARTITION P2014
  3  UPDATE INDEXES;
MERGE PARTITIONS P2014, P2014_02_14 INTO PARTITION P2014
                 *
ERROR at line 2:
ORA-14275: cannot reuse lower-bound partition as resulting partition


Elapsed: 00:00:00.01