Rebuild All Indexes on a Schema in Oracle

spool index_rebuild.sql select ‘alter index ‘||owner||’.’||index_name ||’ rebuild online nologging;’ from dba_indexes where owner=upper(‘SAMPLE’); spool off