ORA-14074: partition bound must collate higher than that of the last partition
1. 建立分割槽表
create table zhanglei_test (c1 number, c2 varchar2(10))
partition by range(c1)
(partition p10 values less than (10),
partition p20 values less than (20),
partition p30 values less than (30),
partition pmax values less than (maxvalue)
)
2. 建立index
alter table zhanglei_test add constraint PK_test primary key (c1)
3. 插入記錄
insert into zhanglei_test (c1,c2) values (1,'hello');
insert into zhanglei_test (c1,c2) values (2,'hello');
insert into zhanglei_test (c1,c2) values (3,'hello');
insert into zhanglei_test (c1,c2) values (4,'hello');
insert into zhanglei_test (c1,c2) values (5,'hello');
insert into zhanglei_test (c1,c2) values (6,'hello');
insert into zhanglei_test (c1,c2) values (7,'hello');
insert into zhanglei_test (c1,c2) values (8,'hello');
insert into zhanglei_test (c1,c2) values (9,'hello');
insert into zhanglei_test (c1,c2) values (10,'hello');
insert into zhanglei_test (c1,c2) values (11,'hello');
insert into zhanglei_test (c1,c2) values (12,'hello');
......
insert into zhanglei_test (c1,c2) values (33,'hello');
insert into zhanglei_test (c1,c2) values (34,'hello');
insert into zhanglei_test (c1,c2) values (35,'hello');
insert into zhanglei_test (c1,c2) values (36,'hello');
insert into zhanglei_test (c1,c2) values (37,'hello');
insert into zhanglei_test (c1,c2) values (38,'hello');
insert into zhanglei_test (c1,c2) values (39,'hello');
insert into zhanglei_test (c1,c2) values (40,'hello');
4. 檢視index狀態
select * from user_indexes
where table_name in ('ZHANGLEI_TEST')
--valid
SELECT * FROM USER_TAB_PARTITIONS
WHERE TABle_name in ('ZHANGLEI_TEST')
5.擴分割槽,報錯ORA-14074
ALTER TABLE ZHANGLEI_TEST ADD PARTITION P40 VALUES LESS THAN (40);
ERROR at line 1:
ORA-14074: partition bound must collate higher than that of the last partition
ORA-14074: 分割槽界限必須調整為高於最後一個分割槽界限
6.兩種處理辦法:
a. SPLIT PARTITION
ALTER TABLE ZHANGLEI_TEST SPLIT PARTITION pmax AT (60) INTO (PARTITION P60, PARTITION PMAX) UPDATE GLOBAL INDEXES ;
ALTER TABLE ZHANGLEI_TEST SPLIT PARTITION pmax AT (70) INTO (PARTITION P70, PARTITION PMAX) UPDATE GLOBAL INDEXES ;
ALTER TABLE ZHANGLEI_TEST SPLIT PARTITION pmax AT (80) INTO (PARTITION P80, PARTITION PMAX) UPDATE GLOBAL INDEXES ;
ALTER TABLE ZHANGLEI_TEST SPLIT PARTITION pmax AT (90) INTO (PARTITION P90, PARTITION PMAX) UPDATE GLOBAL INDEXES ;
ALTER TABLE ZHANGLEI_TEST SPLIT PARTITION pmax AT (100) INTO (PARTITION P100, PARTITION PMAX) UPDATE GLOBAL INDEXES ;
ALTER TABLE ZHANGLEI_TEST SPLIT PARTITION pmax AT (110) INTO (PARTITION P110, PARTITION PMAX) UPDATE GLOBAL INDEXES ;
b. SPLIT PARTITION & ADD PARTITION
ALTER TABLE ZHANGLEI_TEST DROP PARTITION "PMAX" UPDATE GLOBAL INDEXES
ALTER TABLE ZHANGLEI_TEST ADD PARTITION "P100" VALUES LESS THAN (100) ;
ALTER TABLE ZHANGLEI_TEST ADD PARTITION "PMAX" VALUES LESS THAN (MAXVALUE);
備註:不光是maxvalue,只要add partition value的值小於當前partition的值,都會報同樣的錯誤。
參考文獻:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-626170/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-14257: cannot move partition other than a Range or Hash partition
- partition table and partition indexIndex
- PARTITION partition01
- PARTITION partition02
- PARTITION partition04
- ORA-14758: Last partition in the range section cannot be droppedAST
- Pruning、Reference Partition、Exchange Partition
- partition timestamp(0) not use partition
- PARTITION SPILT
- hive partitionHive
- over (partition by)
- exchange partition
- oracle partitionOracle
- split partition
- Clique Partition
- Partition Pruning和Partition-Wise Joins
- oracle partition by group by,詳解partition by和group by對比Oracle
- partition table update partition-key result in changing tablespace
- sql shard/partitionSQL
- Partition Pruning
- partition table test
- partition table(1)
- partition table(2)
- exchange partition(轉)
- When to Partition a Table
- oracle分割槽partition及分割槽索引partition index(一)Oracle索引Index
- oracle composite partition組合分割槽_composite partition rangeOracle
- 7.74 DATAOBJ_TO_PARTITIONOBJ
- 86. Partition List
- exchange partition原理探究
- exchange partition 實驗
- oracle partition的方法Oracle
- exchange partition 的用法
- 關於Hash Partition
- B. Range and Partition
- oracle partition by 語法Oracle
- 【Oracle】ORA-14400: inserted partition key does not map to any partitionOracle
- 【實驗】【PARTITION】RANGE分割槽表截斷表分割槽(Truncate Partition)