While inserting data to a partitioned table, got below error.

 

SQL> insert into RANGE_TAB values(to_date(‘24032016′,’ddmmyyyy’),100);
insert into RANGE_TAB values(to_date(‘24032016′,’ddmmyyyy’),100);
*
ERROR at line 1:
ORA-14400: inserted partition key does not map to any partition

 

Solution:

This error is because, the value which we are trying to insert is not satisfying the partition key range criteria.

Lets check the partition details.

Here we can see the partition key is defined maximum upto 2016-03-01 00:00:00 . But we are trying to insert 2016-03-24 00:00:00 , which is not getting mapped to any partition. so it is failing.

So to fix it , add another partition, with high_value greater than the value which we are trying to insert.

SQL> alter table RANGE_TAB add partition p4 values less than (to_date(‘01042016′,’ddmmyyyy’));

SQL> insert into RANGE_TAB values(to_date(‘24032016′,’ddmmyyyy’),100);

1 row created.