Rebuilding Indexes: Alter Index Rebuild
Rebuilding Indexes: Alter Index Rebuild
Rebuilding Indexes: Alter Index Rebuild
Periodically, and typically after large deletes or inserts, it is worth rebuilding indexes. The SQL for this is:
Alter index <index_name> rebuild;
Alternatively, the following performs the same, but avoids writing to the redo logs and thus speeds up the index rebuild:
Alter index <index_name> rebuild unrecoverable;
Note: If performing this under Oracle 7.3 then be sure to specify the destination tablespace, ie:
Alter index <index_name> rebuild tablespace <tablespace>;
This page represents one page of many pages of notes I made whilst working with Oracle 7 through to 10i. I now no longer work with Oracle databases, but hope that these notes will continue to be of benefit to others.