我有一个在Grails框架中使用底层Hibernate实现的应用程序.运行一段时间后,我收到一个Oracle DB错误,并通过重建违规索引来解决.我想知道有没有人可以提出可能的原因和方法来防止它发生.
Caused by:
org.springframework.jdbc.UncategorizedsqlException:Hibernate operation: Could not execute JDBC batch update;
uncategorized sqlException for sql [update RSS_ITEM set guid=?,
pubdate=?,link=?,RSS_source_id=?,title=?,description=?,
rating_raw=?,rating_tuned=?,date_created=?,date_locked=? where
RSS_ITEM_ID=?]; sql state [99999]; error code [29861]; ORA-29861:
domain index is marked LOADING/Failed/UNUSABLE; nested exception is java.sql.BatchUpdateException:
ORA-29861:
domain index is marked LOADING/Failed/UNUSABLE
要找到破损的索引使用:
select index_name,index_type,status,domidx_status,domidx_opstatus from user_indexes where index_type like '%DOMAIN%' and (domidx_status <> 'VALID' or domidx_opstatus <> 'VALID');
重建索引使用:
alter index INDEX_NAME rebuild;