Oracle Database: Deaktivierte Constraints
Sie möchten herausfinden, welche Constraints aktuell deaktiviert sind? Das folgende SQL-Statement gibt Auskunft:
SELECT owner , table_name , constraint_name , decode(CONSTRAINT_TYPE, 'C','Check', 'P','Primary Key', 'U','Unique', 'R','Foreign Key', 'V','With Check Option') type , STATUS FROM dba_constraints WHERE STATUS = 'DISABLED' ORDER BY owner, table_name, constraint_name;
Sie möchten ein deaktiviertes Constraint wieder aktivieren? Mit folgenden SQL-Statement ist dies möglich:
ALTER TABLE <table_owner>.<table_name>
ENABLE CONSTRAINT <constraint_name>;
Beispiel:
ALTER TABLE scott.dept
ENABLE CONSTRAINT pk_dept;
Lutz Fröhlich
held-informatik
de
info