Wednesday, March 12, 2008

Check Which Constraints Are Not Enabled

rem -----------------------------------------------------------------------
rem Filename: constraints_not_enabled_check.sql
rem Purpose: Check which Database Constraints are not Enabled
rem -----------------------------------------------------------------------

alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
col owner format a10
col column_name format a30
set linesize 132
select a.last_change,a.constraint_type,b.owner,b.constraint_name,b.table_name,b.column_name
from user_constraints a,user_cons_columns b
where a.constraint_name = b.constraint_name
and a.status != 'ENABLED';

No comments: