最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

细说ORA-08104错误

来源:动视网 责编:小采 时间:2020-11-09 10:35:05
文档

细说ORA-08104错误

细说ORA-08104错误:在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提高数据可用性 在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提
推荐度:
导读细说ORA-08104错误:在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提高数据可用性 在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提


在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提高数据可用性

在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提高数据可用性的能力。如果在联机重建索引的过程中出现错误,如用户终止,网络中断等,那么当我们再次重建索引时,,有可能会产生ORA-08104错误。这是由于先前的操作痕迹没有清除而造成的。

在线重建索引的过程中,Oracle数据库会修改数据字典表,并生成中间表(IOT)来记录索引重建期间发生的dml操作。如果重建过程异常中断,smon进程会清理重建痕迹,但是如果系统非常繁忙导致smon应接不暇或者dml操作过多导致smon无法获取相关表上的锁,从而无法清理重建痕迹,当我们再次重建索引时,就会产生ora-08104错误。

下面我们构造一个ora-08104错误

--session 1
SQL> alter index ind1 rebuild online;
--session 2
SQL> update tab1 set rn = rn+1;
--session 1 网络故障,断线
--session 2
SQL> update tab1 set rn = rn+1;

已更新499999行。

SQL> COMMIT;
--session 3
SQL> alter index ind1 rebuild online;
alter index ind1 rebuild online
*
第 1 行出现错误:
ORA-08104: 该索引对象 87859 正在被联机建立或重建

要解决ora-08104错误,就要清除重建痕迹,总结方法如下:

  • ONLINE_INDEX_CLEAN Function
  • This function performs a manual cleanup of failed or interrupted online index builds or rebuilds. This action is also performed periodically by SMON, regardless of user-initiated cleanup.

    This function returns TRUE if all indexes specified were cleaned up and FALSE if one or more indexes could not be cleaned up.

    Syntax

    DBMS_REPAIR.ONLINE_INDEX_CLEAN ( object_id IN BINARY_INTEGER DEFAULT ALL_INDEX_ID, wait_for_lock IN BINARY_INTEGER DEFAULT LOCK_WAIT) RETURN BOOLEAN;

    Parameters

    Table 79-8 ONLINE_INDEX_CLEAN Function Parameters

    ParameterDescription

    object_id

    Object id of index to be cleaned up. The default cleans up all object ids that qualify.

    wait_for_lock

    This parameter specifies whether to try getting DML locks on underlying table [[sub]partition] object. The default retries up to an internal retry limit, after which the lock get will give up. If LOCK_NOWAIT is specified, then the lock get does not retry.

    declare
    isclean boolean;
    begin
    isclean :=false;
    while isclean=false
    loop
    isclean := DBMS_REPAIR.ONLINE_INDEX_CLEAN(dbms_repair.all_index_id,dbms_repair.lock_wait);
    dbms_lock.sleep(10);
    end loop;
    10 end;
    11 /

    PL/SQL 过程已成功完成。

    更多详情见请继续阅读下一页的精彩内容:

    相关阅读:

    ORA-01172、ORA-01151错误处理

    ORA-00600 [2662]错误解决

    ORA-01078 和 LRM-00109 报错解决方法

    ORA-00471 处理方法笔记

    ORA-00314,redolog 损坏,或丢失处理方法

    ORA-00257 归档日志过大导致无法存储的解决办法

    文档

    细说ORA-08104错误

    细说ORA-08104错误:在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提高数据可用性 在线重建索引 (alter index index_name rebuild online)虽然延长了索引重建的时间,却也赋予了我们在线重建索引,提
    推荐度:
    标签: 错误 数据库 or
    • 热门焦点

    最新推荐

    猜你喜欢

    热门推荐

    专题
    Top