欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ORA-14037 :解决办法

程序员文章站 2022-06-11 12:19:16
...

ORA-14037: 分区 P2 的分区界限过高 CREATE TABLE PROVINCE_INFO( PROVINCE_ID VARCHAR2(8) NOT NULL, PROVINCE_NAME VARCH

ORA-14037: 分区 "P2" 的分区界限过高

CREATE TABLE PROVINCE_INFO
(
PROVINCE_ID VARCHAR2(8) NOT NULL,
PROVINCE_NAME VARCHAR2(40) NOT NULL,
CREATE_DT DATE
)
PARTITION BY RANGE (PROVINCE_ID)(
PARTITION P1 VALUES LESS THAN ('8'),
PARTITION P2 VALUES LESS THAN ('9'),
PARTITION P3 VALUES LESS THAN ('10'),
PARTITION P4 VALUES LESS THAN ('11'),
PARTITION P5 VALUES LESS THAN (MAXVALUE)
);

ORA-14037 :解决办法

查Oracle 错误文档 ORA-14037

ORA-14037 partition bound of partition "string" is too high
Cause: High bound of the partition whose name (explicitly specified by the
user) is displayed in this message did not collate lower than that of the
following partition, which is illegal.
Action: Ensure that high bound of every partition (except for the last one)
collates lower than that of a following partition.

问题原因:是分区p2的分区界限比P3的大了,按通常的理解 9 比10小,但是oracle比较字符串时,,会首先从第一个字符比较。因为"9">"1",所以会认为"9"

解决办法:

create table PROVINCE_INFO
(
PROVINCE_ID varchar2(8) not null,
PROVINCE_NAME varchar2(40) not null,
CREATE_DT DATE
)
partition by range (PROVINCE_ID)
(
PARTITION p1 VALUES LESS THAN ('08'),
PARTITION p2 VALUES LESS THAN ('09'),
PARTITION p3 VALUES LESS THAN ('10'),
PARTITION p4 VALUES LESS THAN ('11'),
PARTITION p5 VALUES LESS THAN (maxvalue)
);

ORA-14037 :解决办法