重建索引引发的血案

alter index idx2_client_curversion rebuild online nologging;  --中断过,所以报错

ORA-08104: the index object 89645 is beging online built or rebuilt

 

[oracle@idecl-rac2 ~]$ oerr ora 8104

08104, 00000, "this index object %s is being online built or rebuilt"

// *Cause:  the index is being created or rebuild or waited for recovering

//          from the online (re)build

// *Action: wait the online index build or recovery to complete

 

一、这个应该SMON进程可以解决,可是要等SMON进程却不知道要多就,尝试手工唤醒smon

 

SELECT pid FROM v$process WHERE addr = ( SELECT paddr FROM v$bgprocess WHERE name = 'SMON' ); 

 

       PID

----------

        13

       

SQL> oradebug wakeup 13;

Statement processed.

 

依然无法删除

 

 

--参考网上解决方案:参考http://blog.csdn.net/tianlesoftware/article/details/6538928               

DECLARE

RetVal BOOLEAN;

OBJECT_ID BINARY_INTEGER;

WAIT_FOR_LOCK BINARY_INTEGER;

BEGIN

OBJECT_ID := 89645;

WAIT_FOR_LOCK := NULL;

RetVal := SYS.DBMS_REPAIR.ONLINE_INDEX_CLEAN ();

COMMIT;

END;

/

 

 

 

select dbms_repair.online_index_clean(89645) from dual;  --报错

执行上述块结果还是无法删除和重建索引

 

 

SQL> select obj#,flags from ind$ where obj#=89645;       

 

      OBJ#      FLAGS

---------- ----------

     89645       2563

    

    

    

由此导致的enqlock其他的等待事件随踵而至,平时20-40之间的session 急速增加到300多,并且active会话太多    

    

最终处理:重启数据库后,删除索引,新建之,遂好

 

再查询    

SQL> select obj#,flags from ind$ where obj#=89645;  --说明无状态是最好状态

 

no rows selected

本文出自 “学习只是一种途径” 博客,谢绝转载!

你可能感兴趣的:(职场,休闲,悲剧,建立索引,血案)