Pages

Search This Blog

Monday, December 12, 2011

[Oracle] Enable / Disable all triggers in Schema

Disable Triggers
BEGIN
FOR i IN (SELECT trigger_name
FROM user_triggers) LOOP
EXECUTE IMMEDIATE 'ALTER TRIGGER ' || i.trigger_name || ' DISABLE';
END LOOP;
END;
/
Enable Triggers
BEGIN
FOR i IN (SELECT trigger_name
FROM user_triggers) LOOP
EXECUTE IMMEDIATE 'ALTER TRIGGER ' || i.trigger_name || ' ENABLE';
END LOOP;
END;
/



No comments: