Yes this script will produce a line of sql for each index owned by the user identified in the 'owner = ' clause.
If you send this output to a file eg rebuild.sql - place 'spool rebuild.sql' before this sql then run the rebuild.sql script eg
set heading off
set pages 0
set feed off
set echo off
spool rebuild.sql
select 'alter index '|| index_name || ' rebuild nologging;' from dba_indexes where owner = ' your owners name';
spool off
@rebuild
This will set the environment for the sql (the set cmds) open the file rebuild.sql and insert the select cmds to the file. Close the file and then run the file (@rebuild)
Bookmarks