Wednesday, January 27, 2016

ORA-08104 this index object 4145783 is being online built or rebuilt

*
ERROR at line 1:
ORA-20000: this index object "LDBO"."IDXCONTRACTBILL"  is being online built or
rebuilt
ORA-06512: at "SYS.DBMS_STATS", line 23829
ORA-06512: at "SYS.DBMS_STATS", line 23880
ORA-06512: at line 1


SQL>
SQL>
SQL>
SQL> E

this index object is being online built or rebuilt


Cause:

A session failure during an online index rebuild can leave the data dictionary in a state reflecting a rebuild is on going when in fact it is not.
Solution:

The dbms_repair.online_index_clean function has been created to cleanup online index rebuilds. More details about the function on metalink – Session Was Killed During The Rebuild Of Index ORA-08104 [ID 375856.1]
Run the following to resolve:
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;
end;
/


select min(object_id) from dba_objects where object_name = 'IDXCONTRACTBILL'


392745


declare
   ret boolean;
    begin
        ret:=dbms_repair.ONLINE_INDEX_CLEAN(392745);
    end;
    /

exit


drop index LDBO.IDXCONTRACTBILL;


CREATE INDEX LDBO.IDXCONTRACTBILL ON LDBO.CONTRACTDETAILS (FIRMNUMBER,NFINANCIALYEAR,CONTRACT);



ALTER INDEX LDBO.IDXCONTRACTBILL REBUILD ONLINE;
ALTER INDEX LDBO.IDXCONTRACTINDEX REBUILD ONLINE;

exec DBMS_STATS.GATHER_TABLE_STATS (ownname => 'LDBO' , tabname => 'CONTRACTDETAILS',cascade => true, estimate_percent => 100,method_opt=>'for all columns size 254', granularity => 'ALL', degree => DBMS_STATS.DEFAULT_DEGREE, no_invalidate => false, force=> TRUE );



ALTER INDEX LDBO.IDXCONTRACTBILL REBUILD ONLINE pctfree 20;

No comments:

Post a Comment

Followers