ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-14037 分区界限过高的原因分析及解决 [转]

ORA-14037 分区界限过高的原因分析及解决 [转]

原创 Linux操作系统 作者:zhouxianwang 时间:2012-07-19 17:08:13 0 删除 编辑

在使用以下语句列表分区法创建分区表时 

SQL> create table T_parttab_str
  2  (
  3    PROVINCE_ID varchar2(8) not null,
  4    con_autoid      NUMBER(10) not null,
  5    RI_ID       NUMBER(10),
  6    MATER_NO    NVARCHAR2(20),
  7    MATER_NUM   NUMBER(15,6),
  8    MATER_TYPE  NVARCHAR2(2)
  9  )
 10  partition by range (PROVINCE_ID)
 11  subpartition by hash (con_autoid)
 12  subpartitions 8 store  in (tp_data,tp_hotdata)
 13  (
 14    PARTITION p1 VALUES LESS THAN ('2'),
 15  PARTITION p2 VALUES LESS THAN ('3'),
 16  PARTITION p3 VALUES LESS THAN ('4'),
 17  PARTITION p4 VALUES LESS THAN ('5'),
 18  PARTITION p5 VALUES LESS THAN ('6'),
 19  PARTITION p6 VALUES LESS THAN ('7'),
 20  PARTITION p7 VALUES LESS THAN ('8'),
 21  PARTITION p8 VALUES LESS THAN ('9'),
 22  PARTITION p9 VALUES LESS THAN ('10'),
 23  PARTITION p10 VALUES LESS THAN ('11'),
 24  PARTITION p11 VALUES LESS THAN ('12'),
 25    PARTITION p32 VALUES LESS THAN (maxvalue)
 26  )
 27  ;

create table T_parttab_str
(
  PROVINCE_ID varchar2(8) not null,
  con_autoid      NUMBER(10) not null,
  RI_ID       NUMBER(10),
  MATER_NO    NVARCHAR2(20),
  MATER_NUM   NUMBER(15,6),
  MATER_TYPE  NVARCHAR2(2)
)
partition by range (PROVINCE_ID)
subpartition by hash (con_autoid)
subpartitions 8 store  in (tp_data,tp_hotdata)
(
  PARTITION p1 VALUES LESS THAN ('2'),
PARTITION p2 VALUES LESS THAN ('3'),
PARTITION p3 VALUES LESS THAN ('4'),
PARTITION p4 VALUES LESS THAN ('5'),
PARTITION p5 VALUES LESS THAN ('6'),
PARTITION p6 VALUES LESS THAN ('7'),
PARTITION p7 VALUES LESS THAN ('8'),
PARTITION p8 VALUES LESS THAN ('9'),
PARTITION p9 VALUES LESS THAN ('10'),
PARTITION p10 VALUES LESS THAN ('11'),
PARTITION p11 VALUES LESS THAN ('12'),
  PARTITION p32 VALUES LESS THAN (maxvalue)
)

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

SQL>

查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.

 原来是分区p8的分区界限比P9的大了,按通常的理解 9 比10小,但是oracle比较字符串时,会首先从第一个字符比较。因为"9">"1",所以会认为"9"<"10",所以就出错了。

将上面的改为

SQL> create table T_parttab_str
  2  (
  3    PROVINCE_ID varchar2(8) not null,
  4    con_autoid      NUMBER(10) not null,
  5    RI_ID       NUMBER(10),
  6    MATER_NO    NVARCHAR2(20),
  7    MATER_NUM   NUMBER(15,6),
  8    MATER_TYPE  NVARCHAR2(2)
  9  )
 10  partition by range (PROVINCE_ID)
 11  subpartition by hash (con_autoid)
 12  subpartitions 8 store  in (tp_data,tp_hotdata)
 13  (
 14    PARTITION p1 VALUES LESS THAN ('02'),
 15  PARTITION p2 VALUES LESS THAN ('03'),
 16  PARTITION p3 VALUES LESS THAN ('04'),
 17  PARTITION p4 VALUES LESS THAN ('05'),
 18  PARTITION p5 VALUES LESS THAN ('06'),
 19  PARTITION p6 VALUES LESS THAN ('07'),
 20  PARTITION p7 VALUES LESS THAN ('08'),
 21  PARTITION p8 VALUES LESS THAN ('09'),
 22  PARTITION p9 VALUES LESS THAN ('10'),
 23  PARTITION p10 VALUES LESS THAN ('11'),
 24  PARTITION p11 VALUES LESS THAN ('12'),
 25    PARTITION p32 VALUES LESS THAN (maxvalue)
 26  )
 27  ;

Table created

SQL>

 成功创建。

建议:

       范围分区时,分区键尽量不用字符型。如果字符型时要注意保持字符位数一致以避免出现意想不到的情况

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27036311/viewspace-736061/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-06-04

  • 博文量
    138
  • 访问量
    449092