set termout off pages 0 feedback off lines 132 delete exceptions / commit / spool temp.tmp prompt spool enacon_except.log select 'alter table '||a.table_name||' enable constraint '||a.constraint_name|| chr(10)||'using index tablespace '||nvl(b.TABLESPACE_NAME,'utilbill_index')||chr(10)|| 'exceptions into exceptions;' from user_constraints A, USER_INDEXES B where a.status = 'DISABLED' and b.index_name (+) = a.constraint_name / spool off @temp.tmp spool off set termout on feedback on echo on pages 66 col "Count" format 99999 col "table name" format a40 ttitle 'Constraint enable errors - IMPORTANT !!!' select 'ORA'||'-uh-oh: '||table_name "table name" , constraint constraint, count(*) "Count" from exceptions group by table_name,constraint order by table_name,constraint / select 'ORA'||'-uh-oh: '||constraint_name||' NOT ENABLED on table '||table_name from user_constraints where status = 'DISABLED' /