=================================================================== =========================== SQL ============================ =================================================================== select 'alter table '||a.owner||'.'||a.table_name||' enable constraint '||a.constraint_name||';' from all_constraints a, all_constraints b where a.constraint_type = 'R' and a.r_constraint_name = b.constraint_name and a.r_owner = b.owner and b.table_name in ( '&TABLE1','&TABLE2'); / /*=================================================================== =========================== Test Data ============================ =================================================================== show user DROP TABLE grandchild; DROP TABLE child; DROP TABLE father; DROP TABLE father; CREATE TABLE father ( id number(10) not null, father_name varchar2(50) not null, father_details varchar2(50), CONSTRAINT father_pk PRIMARY KEY (id) ); insert into father values (1,'Mike','Columbia'); insert into father values (2,'John','Jefferson'); select * from father; DROP TABLE child; CREATE TABLE child ( id number(10) not null, father_id number(10) not null, child_name varchar2(50), CONSTRAINT child_pk PRIMARY KEY (id), CONSTRAINT fk1_in_child_to_tab_father FOREIGN KEY (father_id) REFERENCES father(id) ); insert into child values (100,1,'MikeCh1'); insert into child values (101,1,'MikeCh2'); insert into child values (104,1,'MikeCh2'); select * from child; DROP TABLE grandchild; CREATE TABLE grandchild ( id number(10) not null, child_id number(10) not null, father_id number(10) not null, grandchild_name varchar2(50), CONSTRAINT grchild_pk PRIMARY KEY (id), CONSTRAINT fk_in_grandchild_to_tab_father FOREIGN KEY (father_id) REFERENCES father(id), CONSTRAINT fk_in_grandchild_to_tab_child FOREIGN KEY (child_id) REFERENCES child(id) ); insert into grandchild values (1000,100,1,'MikeGc1'); insert into grandchild values (1001,100,1,'MikeGc2'); commit; ================================================================================== */