Oracle 分区 - 错误 ORA14400 - 插入的分区键未映射到任何分区

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24454591/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 05:41:09  来源:igfitidea点击:

Oracle Partition - Error ORA14400 - inserted partition key does not map to any partition

oracledatabase-partitioning

提问by Alan

I'm trying to insert information in a partition table, but I don't know what I'm doing wrong! Show me this error: ORA-14400: inserted partition key does not map to any partition"

我正在尝试在分区表中插入信息,但我不知道我做错了什么!告诉我这个错误:ORA-14400: inserted partition key does not map to any partition

The table dba_tab_partitionsshows this informations below:

下表dba_tab_partitions显示了以下信息:

1   PDIA_98_20091023    0
2   PDIA_98_20091022    0
3   PDIA_98_20091021    0
4   PDIA_98_20091020    0
5   PDIA_98_20091019    0

Please help me rs

请帮助我 rs

回答by Maheswaran Ravisankar

select partition_name,column_name,high_value,partition_position
from ALL_TAB_PARTITIONS a , ALL_PART_KEY_COLUMNS b 
where table_name='YOUR_TABLE' and a.table_name = b.name;

This query lists the column name used as key and the allowed values. make sure, you insert the allowed values(high_value). Else, if default partition is defined, it would go there.

此查询列出用作键的列名称和允许的值。确保插入允许的值(high_value)。否则,如果定义了默认分区,它就会去那里。



EDIT:

编辑:

I presume, your TABLE DDL would be like this.

我想,您的 TABLE DDL 应该是这样的。

CREATE TABLE HE0_DT_INF_INTERFAZ_MES
  (
    COD_PAIS NUMBER,
    FEC_DATA NUMBER,
    INTERFAZ VARCHAR2(100)
  )
  partition BY RANGE(COD_PAIS, FEC_DATA)
  (
    PARTITION PDIA_98_20091023 VALUES LESS THAN (98,20091024)
  );

Which means I had created a partition with multiple columns which holds value less than the composite range (98,20091024);

这意味着我创建了一个包含多个列的分区,其值小于复合范围 (98,20091024);

That is first COD_PAIS <= 98and Also FEC_DATA < 20091024

那是第一COD_PAIS <= 98也是FEC_DATA < 20091024

Combinations And Result:

组合和结果:

98, 20091024     FAIL
98, 20091023     PASS
99, ********     FAIL
97, ********     PASS
 < 98, ********     PASS


So the below INSERTfails with ORA-14400; because (98,20091024)in INSERTis EQUALto the one in DDLbut NOTless than it.

所以下面INSERT失败了 ORA-14400; 因为(98,20091024)INSERT平等的一个中DDL,但不是比它少。

SQL> INSERT INTO HE0_DT_INF_INTERFAZ_MES(COD_PAIS, FEC_DATA, INTERFAZ)
                                  VALUES(98, 20091024, 'CTA');  2
INSERT INTO HE0_DT_INF_INTERFAZ_MES(COD_PAIS, FEC_DATA, INTERFAZ)
            *
ERROR at line 1:
ORA-14400: inserted partition key does not map to any partition

But, we I attempt (97,20091024), it goes through

但是,我们尝试(97,20091024 ),它通过

SQL> INSERT INTO HE0_DT_INF_INTERFAZ_MES(COD_PAIS, FEC_DATA, INTERFAZ)
  2                                    VALUES(97, 20091024, 'CTA');

1 row created.