BEGIN FOR c IN (SELECT owner,index_name FROM dba_indexes WHERE owner='SUPERMAG') LOOP BEGIN EXECUTE IMMEDIATE 'alter index '||c.owner||'.' || c.index_name || ' nologging'; EXCEPTION WHEN OTHERS THEN BEGIN dbms_output.put_line(c.owner||'.' || c.index_name); END; END; END LOOP; END; /