ORA-14758: Last partition in the range section cannot be dropped ORACLE 报错 故障修复 远程处理
文档解释
ORA-14758: Last partition in the range section cannot be dropped
Cause: An attempt was made to drop the last range partition of an interval partitioned table.
Action: Do not attempt to drop this partition.
ORA-14758错误指当某一分区被删除,而它所在的分区区间中仅剩一个分区时,就会发生该错误。
官方解释
ORA-14758: Last partition in the range section cannot be dropped
Cause: Attempted to drop the last partition in a range section by itself.
Action: Drop the entire range section.
常见案例
例如一个表table1,有两个分区:分区 p1 和 p2,如果按照一般流程进行操作:
SQL> ALTER TABLE table1 DROP PARTITION p1;
操作会报ORA-14758: Last partition in the range section cannot be dropped 错误
正常处理方法及步骤
1、改为一步删除p1和p2的区间:
SQL> ALTER TABLE table1 DROP PARTITION p1, p2;
2、两步结合操作删除p1和p2的区间:
SQL> ALTER TABLE table1 SPLIT PARTITION p2 INTO(PARTITION P2_SPLIT1, PARTITION P2_SPLIT2);
SQL> ALTER TABLE table1 DROP PARTITION P1,P2_SPLIT1;
在一步的操作中,只有P2_SPLIT2分区保留。