set head off
set feed off
set pages 0
set ver off

--Genera script de desactivación

prompt
prompt -- DESHABILITAR TRIGGERS: /tmp/distrig.sql 
prompt

spool /tmp/distrig.sql

prompt
prompt spool /tmp/distrig.log
prompt

select 'ALTER TRIGGER "'||OWNER||'"."'||TRIGGER_NAME||'" DISABLE;'
from dba_triggers
where owner=upper('&1')
and status!='DISABLED'
/

prompt
prompt spool off
prompt

spool off

-- Genera script de activación

prompt
prompt -- HABILITAR TRIGGERS: /tmp/entrig.sql 
prompt

spool /tmp/entrig.sql

prompt
prompt spool /tmp/entrig.log
prompt

select 'ALTER TRIGGER "'||OWNER||'"."'||TRIGGER_NAME||'" ENABLE;'
from dba_triggers
where owner=upper('&1')
and status!='DISABLED'
/

prompt
prompt spool off
prompt

spool off;
set head on
set feed on
set pages 80
set ver on
