ORA-14400: inserted partition key does not map to any partition
數據庫表已經分區,如果插入數據時出現錯誤提示:
ORA-14400: 插入的分區關鍵字超出最高合法分區關鍵字。
原因是因為分區已經過期
ORA-14400: 插入的分區關鍵字超出最高合法分區關鍵字。
原因是因為分區已經過期
解決方法:
手工添加了一個分區,終止日期大於當前日期即可。
手工添加了一個分區,終止日期大於當前日期即可。
建表的SQL:
create table DATE
(
ID VARCHAR2(20) not null,
NEWYEAR VARCHAR2(20) not null,
NEWMONTH VARCHAR2(20) not null,
)
partition by range (NEWYEAR, NEWMONTH)
(
partition PT_2004_03 values less than ('2004', '04')
tablespace TS_LIU
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
),
partition PT_2004_04 values less than ('2004', '05')
tablespace TS_LIU
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
)
)
;
增加分區:
ALTER TABLE "DATE"
ADD PARTITION "PT_2007_12"
VALUES LESS THAN ('2007', '12')
TABLESPACE "TS_LIU"
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
)
另:在建立分區表的時候應該有一個pmin區接受小於最小分區的數據
以及一個pmax區接受大於最大分區的數據,否則下次忘記加分區,又會報同樣的錯誤
create table DATE
(
ID VARCHAR2(20) not null,
NEWYEAR VARCHAR2(20) not null,
NEWMONTH VARCHAR2(20) not null,
)
partition by range (NEWYEAR, NEWMONTH)
(
partition PT_2004_03 values less than ('2004', '04')
tablespace TS_LIU
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
),
partition PT_2004_04 values less than ('2004', '05')
tablespace TS_LIU
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
)
)
;
增加分區:
ALTER TABLE "DATE"
ADD PARTITION "PT_2007_12"
VALUES LESS THAN ('2007', '12')
TABLESPACE "TS_LIU"
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
)
另:在建立分區表的時候應該有一個pmin區接受小於最小分區的數據
以及一個pmax區接受大於最大分區的數據,否則下次忘記加分區,又會報同樣的錯誤