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

 

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

Issue :-

while dropping an index  the following error thrown 

drop index  inx_lltoftthflgfeas;

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


Reason

A process could end up dead if it has been killed from the OS with the command kill -9  or killed the session with ALTER SYSTEM KILL SESSION command

If the process was killed while doing an:

CREATE INDEX <ind> ONLINE;
then the index could end up in a state where it needs clearing up.

One would think a drop of the index would solve the problem. However,

that will only return an error:ORA-8104 "This index object %s is being online built or rebuilt."

Solution 

The solution is to use the ONLINE_INDEX_CLEAN procedure in the DBMS_REPAIR package 

SMON will eventually cleanup the locked index so no actions are actually needed. 

However, letting SMON do the cleanup can be a bit of 'hit and miss' as SMON will try to cleanup every 60 minutes
and if it cannot get a lock on the object with NOWAIT it will just try again later. 

In a highly active database with many transactions this can cause the create to take a long time as SMON won't get
the lock with NOWAIT. 

Other cases like uncommitted transactions against the table will also result in SMON not create the index.

As long as the index is not created all access to the index will result in ORA-8104 or ORA-8106.

So to solve this situation a manual cleanup can be done using the new function

On the server login as sysdba

SQL> conn / as sysdba
SQL> DECLARE
isClean BOOLEAN;
BEGIN
isClean := DBMS_REPAIR.ONLINE_INDEX_CLEAN();
END;
/

Then drop the index.  Index will be dropped without any error






Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post