How to rebuild index?

Question:

I am trying to perform a reindex, as some of  the index has become, fragment. I am trying to use a plsql script to generate sql script from the all_indexes and all_constraints tables. At the end I should have 3 sql script, one for  foreign key constraints, primary keys, and non-unique index. Then I need to drop all related indexes, and execute the sql script.
 
Please advice, it's this the correct way, or that's another better way.
 
Thank you
gavin
 
Answer:

alter index INDEX_NAME rebuild (optional storage parameters)

If you have Oracle8i, release 8.1, REBUILD ONLINE works as well -- no
downtime.

much easier then drop / recreate.  faster as well as it reads the
existing already sorted index to rebuild with.
 
 

Hosted by www.Geocities.ws

1