PROMPT $RMINC_TOP/sql/RUN_IXRB.sql
PROMPT RDBMS 8i or RDBMS 9i Index Rebuild
PROMPT Calls         $RMINC_TOP/sql/idxrbld.sql
PROMPT
PROMPT Rebuild Indexes (RMINC)
PROMPT Rebuilds all of the indexes that aren't owned by SYS or SYSTEM
PROMPT and that have more than 2 extents.  This is setup so you can 
PROMPT call it from the Concurrent Manager if you set it up as a 
PROMPT concurrent program.
PROMPT
PROMPT You should run this off hours as a concurrent request.
PROMPT  
PROMPT You might want to set this up so that the concurrent program is
PROMPT set up to RUN ALONE, just to minimize performance issues as 
PROMPT concurrent requests try to access some of the larger indexes
PROMPT that are being rebuilt.
PROMPT
PROMPT
PROMPT Copyright 2003, All Rights Reserved, Reed-Matthews, Inc.
PROMPT

set pagesize 200
clear buffer
set head off
set termout off
set feedback off
spool &1..RMINC_idxrbld.sql;
select 'whenever sqlerror continue' from dual;
SELECT 'alter index '||owner||'.'||segment_name||' rebuild compute statistics online nologging tablespace '||
       tablespace_name||';'
        from sys.dba_segments
    where owner not in ('SYS','SYSTEM') and segment_type='INDEX'
    and sys.dba_segments.extents > 2 order by extents;
spool off;
spool &1
set echo on
set termouton
set feedback on
@&1..RMINC_idxrbld.sql
host rm &1..RMINC_idxrbld.sql
exit;
