問題描述:
今天項目在使用的過程中報如下錯誤:
經過查詢得知這是索引失效造成的。
當使用類似 alter table xxxxxx move tablespace xxxxxxx 命令後,索引就會失效。
查看索引狀態爲UNUSABLE狀態:
SELECT
index_name,
index_type,
tablespace_name,
table_type,
status
FROM
user_indexes
WHERE
index_name = 'PK_ITEM_CONSULT';
解決辦法:
只需要重建索引即可。
ALTER INDEX INDEX_NAME REBUILD;