-
Junior Member
rebuild all the indexes of the table or schema
HI all
can anybody tell me about the rebuild all the indexes of the specified schema or specified table. i want single script for that.
thanks in advance
-
Expert Member
Re: rebuild all the indexes of the table or schema
Periodically, and typically after large deletes or inserts, it is worth rebuilding indexes.
The SQL for this is:
Alter index rebuild;
Alternatively, the following performs the same, but avoids writing to the redo logs and thus speeds up the index rebuild:
Alter index rebuild unrecoverable;
To rebuild all indexes
Sql > Set Heading off
Sql > Spool c:\s.sql
SELECT ' ALTER INDEX ' || INDEX_NAME || ' REBUILD ; '
FROM USER_INDEXES
Sql > Spool off
Sql >@ c:\s.sql
Try this
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules