Results 1 to 2 of 2

Thread: rebuild all the indexes of the table or schema

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    22

    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


  2. #2
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact