SET serveroutput ON BEGIN FOR c IN (SELECT owner,table_name FROM dba_tables WHERE tablespace_name='SYSTEM') LOOP BEGIN EXECUTE IMMEDIATE 'analyze table '||c.owner||'.' || c.table_name || ' validate structure cascade'; EXCEPTION WHEN OTHERS THEN BEGIN dbms_output.put_line(c.owner||'.' || c.table_name); END; END; END LOOP; END; /