ORACLE 禁用启用所有触发器


--禁用所有触发器
declare
  v_owner varchar2(60) := 'trig';--指定用户名
begin

    for cur in (select t.TRIGGER_NAME from all_triggers t where t.OWNER = v_owner)
    loop
          execute immediate 'alter trigger '|| cur.trigger_name ||' disable';
    end loop;      
end;



--启用所有触发器
declare
    v_owner varchar2(60) := 'trig';--指定用户名
begin

    for cur in (select t.TRIGGER_NAME from all_triggers t where t.OWNER = v_owner)
    loop
          execute immediate 'alter trigger '|| cur.trigger_name ||' enable';
    end loop;      
end;

 

你可能感兴趣的:(数据库)