During the process of an online index rebuild operation, when the related session is unexpectedly interrupted, even though there is no rebuild process, it seems that like the rebuild process is still in progress.
For this reason, it is caused ORA-08104 error when trying to perform the rebuild process again.
Rebuild process ends with error as follows.
SQL> ALTER INDEX user.index rebuild online;
ALTER INDEX user.index rebuild online
ERROR at line 1:
ORA-08104: this index object 1234567 is being online built or rebuilt
You can resolve this problem by running the dbms_repair.online_index_clean function.
Example use is as follows:
You must type the problematic index id instead of index_object_id. You can access this information from dba_objects, user_indexes or all_indexes. You need to connect and run with SYS.
-bash-4.3$ sqlplus / as sysdba
SQL*Plus: Release 18.104.22.168.0 Production on Thu Jan 26 09:58:08 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Oracle Database 11g Enterprise Edition Release 22.214.171.124.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
lv_ret := dbms_repair.online_index_clean(index_object_id);