ORA-14064: Index with Unusable partition exists on unique/primary constraint key
Cause: User attempted to add or enable a primary key/unique constraint on column(s) of a table on which there exists an index one or more partitions of which are marked Index Unusable.
Action: Drop the existing index or rebuild unusable partitions it using ALTER INDEX REBUILD PARTITION
ORA-14064,这是一个Oracle数据库报错信息,用于指示索引中存在不可用的分区,该分区位于unique / primary constraint key之上。
1.查询出存在不可用分区的索引,使用下面的查询:
SELECT OWNER, INDEX_NAME FROM DBA_INDEXES WHERE STATUS = ‘UNUSABLE’;
2.可以使用 “ALTER INDEX … REBUILD” 指令来重建索引,这样就可以恢复索引正常使用了:
ALTER INDEX Owner.index_name REBUILD;
3.也可以使用“DROP INDEX”指令来删除该索引,接着重新建立一个新的索引:
DROP INDEX Owner.Index_name
CREATE INDEX Index_name ON Table(column_name);