ORA-14022: creation of LOCAL partitioned cluster indices is not supported ORACLE 报错 故障修复 远程处理
文档解释
ORA-14022: creation of LOCAL partitioned cluster indices is not supported
Cause: An attempt was made to create a LOCAL partitioned cluster index, which is currently illegal
Action: Remove LOCAL along with s, if any, from the CREATE INDEX statement.
ORA-14022:不支持创建局部分区的集群索引。
官方解释
常见案例
create table parts_sales ( item_name varchar2(30), quantity number, amt number )
partition by range (quantity) (
partition p10 values less than (10),
partition p20 values less than (20),
partition p30 values less than (30)
);
此时,当要求在此表上创建一个局部分区的集群索引时,则会出现ORA-14022错误:
create index parts_sales_idx on parts_sales (item_name)
local;
正常处理方法及步骤
1. 要想解决这个问题,可以使用全局分区的集群索引。首先,删除存在的局部分区索引:
drop index parts_sales_idx;
2. 然后创建全局分区的集群索引:
create index parts_sales_idx on parts_sales
(item_name);
3. 这样可以避免ORA-14022错误,但是如果查询速度很慢,也可以考虑使用本地索引。例如:
create index parts_sales_idx on parts_sales
(item_name)
local;