出现错误提示:
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.
阅读(2228) | 评论(0) | 转发(0) |