DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: REBUILD INDEXES SCRIPTS

  1. #1
    Join Date
    Aug 2001
    Posts
    390
    Does any body have the indexes rebuild scripts on NT or 2000 so I can make it as a batch file to run weekly ???

    this is a statement:

    SELECT 'ALTER INDEX ' ||INDEX_NAME||' REBUILD TABLESPACE INDX_TS;' FROM DBA_INDEXES
    WHERE OWNER='OWNER_NAME';

    I need to put it in as a scripts so I can run it as a batch file.

    thanks in advance.


  2. #2
    Join Date
    Jul 2001
    Location
    Singapore(Asia)-WebCentre business company
    Posts
    456
    well u can always come up with ur own tailored script to rebuild whatever indexes u wanted.
    chk the Oracle Scripts column within this site shld hv some copy somewhere
    ngwh,
    Singapore.

  3. #3
    Join Date
    Sep 2001
    Location
    Makati, Philippines
    Posts
    857
    from sqlplus:
    set heading off
    set underline off
    set pagesize 0
    select 'alter index '||index_name||' rebuild tablespace '||tablespace_name||';'
    from dba_indexes where owner='OWNER_NAME';
    spool rebuild_index_scriptssql
    /
    spool off
    exit

    from your batch file (execute_rebuild_index_script.bat):
    sqlplus system/manager @rebuild_index_scripts.sql

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width