索引错误 ORA-01502: index ‘index_name' or partition of such index is in unusable state

错误原因:

  这个错误一般是因为索引状态为UNUSABLE引起的。你可以通过下面SQL,查看索引的状态

 

SELECT OWNER, INDEX_NAME,STATUS  FROM DBA_INDEXES WHERE INDEX_NAME='INDEX_NAME' 
SELECT OWNER, INDEX_NAME,STATUS  FROM ALL_INDEXES WHERE INDEX_NAME='INDEX_NAME' 

SELECT  INDEX_NAME,STATUS  FROM USER_INDEXES WHERE INDEX_NAME='INDEX_NAME' 

此时需要修改索引即可 :

ALTER INDEX INDEX_NAME REBUILD

你可能感兴趣的:(Orcale)