oracle 有人可以用简单的英语解释 ORA-29861 错误及其可能的原因吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2587572/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 02:30:47  来源:igfitidea点击:

Can someone explain ORA-29861 error in plain english and its possible cause?

oraclegrailsindexing

提问by hko19

I have an application implemented in Grails framework using underlying Hibernate. After it runs for a while, I got an Oracle DB error and resolved it by rebuilding the offending index. I wonder if anyone can propose the possible cause(s) and ways to prevent it from happening.

我有一个使用底层 Hibernate 在 Grails 框架中实现的应用程序。在它运行一段时间后,我收到了一个 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

引起:org.springframework.jdbc.UncategorizedSQLException:

Hibernate 操作:无法执行 JDBC 批量更新;未分类的 SQL 异常 SQL [更新 RSS_ITEM 设置 guid=?, pubdate=?, link=?, rss_source_id=?, title=?, description=?, rating_raw=?, rating_tuned=?, date_created=?, date_locked=? 其中 RSS_ITEM_ID=?]; SQL 状态 [99999];错误代码 [29861]; ORA-29861: 域索引被标记为 LOADING/FAILED/UNUSABLE

; 嵌套异常是 java.sql.BatchUpdateException: ORA-29861: 域索引被标记为 LOADING/FAILED/UNUSABLE

回答by vagovszkym

To locate broken index use:

要定位损坏的索引,请使用:

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');

To rebuild the index use:

要重建索引使用:

alter index INDEX_NAME rebuild;

回答by APC

Domain indexes are a special type of index. It is possible to build our own using OCI but the chances are you're using one of the index types offered by Oracle Text. I say this as your table seems to include free text columns.

域索引是一种特殊类型的索引。可以使用 OCI 构建我们自己的索引,但您可能正在使用 Oracle Text 提供的索引类型之一。我这样说是因为您的表格似乎包含自由文本列。

The most commonly used Text index is the CTXSYS.CONTEXT index type. The point about this index type is that it is not maintained transactionally, so as to minimize the effort involved in indexing large documents. This means when you insert or update a document into your table it is not indexed immediately. Instead is that a background process, such as a database job, which kicks off the index synchronization on a regular basis. The index is unusable while it is being synchronized. If the resync fails for any reason then you will need to drop and recreate the index.

最常用的 Text 索引是 CTXSYS.CONTEXT 索引类型。这种索引类型的要点在于它不是事务性维护的,以便最大限度地减少索引大型文档所涉及的工作量。这意味着当您在表中插入或更新文档时,它不会立即被索引。取而代之的是后台进程,例如数据库作业,它定期启动索引同步。索引在同步时不可用。如果由于任何原因重新同步失败,则您需要删除并重新创建索引。

Is this a regular occurrence for you? If so you may need to re-appraise your application. Perhaps a different sort of index (such as CTXSYS.CTXCAT) might be more appropriate. One thing which strikes me about your error message is that your UPDATE statement touches a lot of columns, including what looks like the primary key. This makes me think you have a single generic update statement which sets every column regardless of whether it has actually changed. This is bad practice with normal indexes; it will kill your application if you are using text indexes.

这对你来说是常态吗?如果是这样,您可能需要重新评估您的申请。也许不同类型的索引(例如 CTXSYS.CTXCAT)可能更合适。关于您的错误消息,让我印象深刻的一件事是您的 UPDATE 语句涉及很多列,包括看起来像主键的列。这让我觉得你有一个通用的更新语句,它设置每一列,而不管它是否真的改变了。对于普通索引,这是不好的做法;如果您使用文本索引,它会杀死您的应用程序。

回答by skaffman

http://ora-29861.ora-code.com/

http://ora-29861.ora-code.com/

Cause: An attempt has been made to access a domain index that is being built or is marked failed by an unsuccessful DDL or is marked unusable by a DDL operation.

Action: Wait if the specified index is marked LOADING Drop the specified index if it is marked FAILED Drop or rebuild the specified index if it is marked UNUSABLE.

原因:已尝试访问正在构建或被不成功的 DDL 标记为失败或被 DDL 操作标记为不可用的域索引。

操作:如果指定的索引被标记为 LOADING 则等待 如果它被标记为 FAILED 删除指定的索引 如果它被标记为 UNUSABLE 删除或重建指定的索引。

That should hopefully be enough context. Can you figure out the problem from that?

这应该是足够的背景。你能从中找出问题吗?