【问题标题】:ORA-20000: Oracle Text error: DRG-10599: column is not indexed where index exists on select "for update"ORA-20000:Oracle 文本错误:DRG-10599:在选择“for update”时存在索引的列未编入索引
【发布时间】:2019-12-19 11:37:16
【问题描述】:

我试图更新一个 CLOB 列,但由于该列未编入索引错误而失败。

我尝试删除并重新创建索引,但仍然遇到相同的错误:

create index idx_response_contxt on test (response) indextype is ctxsys.context;

declare
begin
    for i in (select response from test 
              where contains(response,'{"IdType">BANK}') > 0 for update) loop
    dbms_lob.write(i.response, 12, 5444, '111111111111');
    end loop;
end;
/

第 1 行出现错误:

ORA-20000:Oracle 文本错误:

DRG-10599:列未编入索引

ORA-06512:在第 4 行

似乎“for update”禁用了索引。如果我在没有包含函数的情况下运行,我没有收到任何错误,但代价非常高:

declare
begin
    for i in (select response from test where response like '%"IdType">BANK%' for update) loop    
        dbms_lob.write(i.response, 12, 5444, '111111111'); 
    end loop;
end;
/

有什么建议吗?谢谢!

【问题讨论】:

    标签: oracle


    【解决方案1】:

    您需要在创建索引时使用适当的参数,因为它将决定何时同步索引。它可以是实时的或周期性的。

    create index idx_response_contxt on test (response) 
    indextype is ctxsys.context PARAMETERS ('SYNC (ON COMMIT)'); -- real time synchronization
    

    上面的例子是实时重建索引。您可以在 PARAMETER 中使用不同的子句在可配置的时间进行重建。像'(SYNC (EVERY "SYSDATE+1/24")' 一样——将每小时同步一次,定期

    根据需要使用它。

    干杯!!

    【讨论】:

      【解决方案2】:

      我用“PARAMETERS ('SYNC (ON COMMIT)')”重建了索引并再次运行查询,但没有用,因为它仍然没有看到索引并给出“ORA-20000:Oracle 文本错误: DRG-10599:列未编入索引”错误。

      还有其他建议吗?谢谢。

      【讨论】:

        猜你喜欢
        • 2017-11-02
        • 1970-01-01
        • 2015-08-03
        • 1970-01-01
        • 2012-01-02
        • 1970-01-01
        • 1970-01-01
        • 2015-09-24
        • 1970-01-01
        相关资源
        最近更新 更多