简体   繁体   中英

Split Partition is giving error when partitioning

I have a partitioned table where the definition during creation was

  PARTITION  BY RANGE (CREATED_DT)
(
PARTITION p2016
   VALUES LESS THAN (TO_DATE('01-JAN-2016','dd-mon-yyyy')),   
PARTITION p2017
   VALUES LESS THAN (TO_DATE('01-JAN-2017','dd-mon-yyyy')),  
PARTITION p2018
   VALUES LESS THAN (TO_DATE('01-JAN-2018','dd-mon-yyyy')),
PARTITION p2019
   VALUES LESS THAN (TO_DATE('01-JAN-2019','dd-mon-yyyy')),
PARTITION p 
    VALUES LESS THAN (MAXVALUE)   
)

Now I want to split p2016 into 3 partitions where I am issuing the following command:

ALTER TABLE BKP_COST_EVENT SPLIT PARTITION p2016 INTO
( PARTITION p14 VALUES LESS THAN (TO_DATE('01-JAN-2015','dd-MON-yyyy')),
  PARTITION p13 VALUES LESS THAN (TO_DATE('01-JAN-2014','dd-MON-yyyy')),
  PARTITION p2016_1 );

But I am getting the following error:

Error report -
ORA-14080: partition cannot be split along the specified high bound
14080. 00000 -  "partition cannot be split along the specified high bound"
*Cause:    User attempted to split a partition along a bound which
           either collates higher than that of the partition to be split or
           lower than that of a partition immediately preceding the one
           to be split
*Action:   Ensure that the bound along which a partition is to be split
           collates lower than that of the partition to be split and
           higher that that of a partition immediately preceding the one
           to be split

What am I doing wrong and how to correct it?

Change the order of the partitions given in your ALTER TABLE:

ALTER TABLE BKP_COST_EVENT SPLIT PARTITION p2016 INTO
( PARTITION p13 VALUES LESS THAN (TO_DATE('01-JAN-2014','dd-MON-yyyy')),
  PARTITION p14 VALUES LESS THAN (TO_DATE('01-JAN-2015','dd-MON-yyyy')),
  PARTITION p2016_1 );

db<>fiddle here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM