begin
for i in (select constraint_name, table_name from user_constraints) LOOP
execute immediate 'alter table '||i.table_name||' ENABLE constraint '||i.constraint_name||'';
end loop;
end;
/
begin
for cur in (select owner, constraint_name , table_name
from all_constraints
where owner = 'SCOTT' ) loop
execute immediate 'ALTER TABLE '||cur.owner||'.'||cur.table_name||' MODIFY CONSTRAINT "'||
cur.constraint_name||'" ENABLE NOVALIDATE ';
end loop;
end;
begin
for cur in (select fk.owner, fk.constraint_name , fk.table_name
from all_constraints fk, all_constraints pk
where fk.CONSTRAINT_TYPE = 'R' and
pk.owner = 'SCOTT' and
fk.r_owner = pk.owner and
fk.R_CONSTRAINT_NAME = pk.CONSTRAINT_NAME )
loop
execute immediate 'ALTER TABLE "'||cur.owner||'"."'||cur.table_name||'" MODIFY CONSTRAINT "'||
cur.constraint_name||'" ENABLE NOVALIDATE';
end loop;
end;
for i in (select constraint_name, table_name from user_constraints) LOOP
execute immediate 'alter table '||i.table_name||' ENABLE constraint '||i.constraint_name||'';
end loop;
end;
/
begin
for cur in (select owner, constraint_name , table_name
from all_constraints
where owner = 'SCOTT' ) loop
execute immediate 'ALTER TABLE '||cur.owner||'.'||cur.table_name||' MODIFY CONSTRAINT "'||
cur.constraint_name||'" ENABLE NOVALIDATE ';
end loop;
end;
begin
for cur in (select fk.owner, fk.constraint_name , fk.table_name
from all_constraints fk, all_constraints pk
where fk.CONSTRAINT_TYPE = 'R' and
pk.owner = 'SCOTT' and
fk.r_owner = pk.owner and
fk.R_CONSTRAINT_NAME = pk.CONSTRAINT_NAME )
loop
execute immediate 'ALTER TABLE "'||cur.owner||'"."'||cur.table_name||'" MODIFY CONSTRAINT "'||
cur.constraint_name||'" ENABLE NOVALIDATE';
end loop;
end;
No comments:
Post a Comment