I will explain Alter Index Rebuild Online in Oracle in this post.
Alter Index Rebuild Online
Indexes in our tables may become corrupted or fragmented as a result of intensive DML operations (Insert, Delete, etc.) of the tables. Indexes are broken and UNUSABLE when they are moved to new tablespaces outside of DML operations. Index should rebuild in this cases. Corrupted, Unusable or broken Indexes are Rebuilded as follows.
SQL> alter index <index_name> rebuild; SQL> alter index MID_IX rebuild;
You can rebuild indexes Online to prevent Lock and downtime.
SQL> ALTER INDEX <index name> REBUILD ONLINE; SQL> ALTER INDEX MID_IX REBUILD ONLINE;
Rebuild Indexes in parallel that are widely used in production environment will speed up your job and finish in less time. It is recommended that you do not give more parallel than your CPU count when using Parallel. Indexes can be rebuilt in parallel and online as follows.
SQL> ALTER INDEX <index name> REBUILD ONLINE PARALLEL <parallel_count>; SQL> ALTER INDEX MID_IX REBUILD ONLINE PARALLEL 4;
You can read the following post to learn more details about Index maintenance in Oracle.
756 views last month, 5 views today