rem ----------------Rebuild Script
Start---------------------------------
rem
-----------------------------------------------------------------------
rem Filename: idxrebld.sql
rem Purpose: Re-build all user indexes on-line
rem Notes: - Run this script from sqlplus as a DBA user.
rem
-----------------------------------------------------------------------
set serveroutput on size 1000000
set line 1024 feed off trimspool on echo off
spool H:\sql\indx\index_rebuild_run.sql
begin
for c1 in (
select i.owner, i.index_name, s.tablespace_name,
i.initial_extent, i.next_extent, i.min_extents, i.max_extents,
i.pct_increase, s.bytes
from sys.dba_segments s, sys.dba_indexes i
where s.segment_type = 'INDEX'
and i.index_name = s.segment_name
and i.index_name between 'A%' and 'Z%'
and i.owner = 'YOUR_SCHEMA' order by i.index_name )
loop
dbms_output.put_line('ALTER INDEX "'||c1.owner||'"."'||c1.index_name||
'" REBUILD ONLINE;');
end loop;
end;
/
spool off
PAUSE
-- Run the generated script
set echo on time on timing on feed on
@H:\sql\indx\index_rebuild_run
spool off
exit
rem ----------------Rebuild Script End---------------------------------
-----Original Message-----
From: George
[mailto:oracledba-ezmlmshield-x11158895.[Email address protected]
Sent: Monday, June 27, 2005 9:28 PM
To: LazyDBA Discussion
Subject: Rebuild Indexes
Can any body having scripts which will show what are the indexes need to
be rebuild ?
Thanks in advance
George
DISCLAIMER:
This message contains privileged and confidential information and is
intended only for the individual named.If you are not the intended
recipient you should not disseminate,distribute,store,print, copy or
deliver this message.Please notify the sender immediately by e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system.E-mail transmission cannot be guaranteed to be secure or
error-free as information could be
intercepted,corrupted,lost,destroyed,arrive late or incomplete or
contain viruses.The sender therefore does not accept liability for any
errors or omissions in the contents of this message which arise as a
result of e-mail transmission. If verification is required please
request a hard-copy version.
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com To unsubscribe:
see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com By using this list you agree
to these terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page