Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3903340
  • 博文数量: 534
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4800
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(534)

文章存档

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(253)

2006年(73)

分类: Oracle

2007-02-28 17:48:02

出现错误提示:
ORA-01450: maximum key length (51) exceeded

查找ORA-01450得到原因:
ORA-01450: maximum key length (string) exceeded
Cause:
  The combined length of all the columns specified in a CREATE INDEX statement exceeded the maximum index length. The maximum index length varies by operating system. The total index length is computed as the sum of the width of all indexed columns plus the number of indexed columns. Date fields have a length of 7, character fields have their defined length, and numeric fields have a length of 22. Numeric length = (precision/2) + 1. If negative, add +1.

Action:
  Select columns to be indexed so the total index length does not exceed the maximum index length for the operating system. See also your operating system-specific Oracle documentation.

建立索引字段太长, 查建表语句:
CREATE TABLE OSM_DML_10.OSM_TAB_14 (
  COL_0 VARCHAR2(646),
  COL_44 DATE,
  COL_45 VARCHAR2(457),
  CONSTRAINT OSM_TAB_14_PK PRIMARY KEY(COL_0)
  ) ORGANIZATION INDEX
  TABLESPACE OSM_TABP_2 NOCOMPRESS PCTTHRESHOLD 1 INCLUDING COL_44 OVERFLOW
/

应该是IOT表建立主建索引错误了. 提示最大长度为51, 测试一下(Oracle 9204):
CREATE TABLE OSM_DML_10.OSM_TAB_14 (
  COL_0 VARCHAR2(50),
  COL_44 DATE,
  COL_45 VARCHAR2(457),
  CONSTRAINT OSM_TAB_14_PK PRIMARY KEY(COL_0)
  ) ORGANIZATION INDEX
  TABLESPACE OSM_TABP_2 NOCOMPRESS PCTTHRESHOLD 1 INCLUDING COL_44 OVERFLOW
/
一样出错, 改为49就可以了.

---New Test SQL:
CREATE TABLE OSM_DML_10.OSM_TAB_5
    (
    COL_5  NUMBER(24, 0),
    COL_13 CHAR(30),
    COL_14 DATE,
    COL_15 FLOAT,
    COL_16 NUMBER(24, 0),
    COL_17 CHAR(351),
    COL_18 DATE,
    CONSTRAINT OSM_TAB_5_PK PRIMARY KEY(COL_13, COL_16))
    ORGANIZATION INDEX TABLESPACE OSM_TABP_0 NOCOMPRESS PCTTHRESHOLD 1 INCLUDING COL_5 OVERFLOW;

cause error: ORA-01450: maximum key length (51) exceeded
I think the complex primary index must exceeded 51 bytes, modify 30 to 20 is correct.

阅读(2182) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~