Hi,
I'd like to disable 'all' the triggers at once in a schema for data loading, how can I do it without issuing the following for every single table?
ALTER TABLE xxx
DISABLE ALL TRIGGERS;
Thanks.
Printable View
Hi,
I'd like to disable 'all' the triggers at once in a schema for data loading, how can I do it without issuing the following for every single table?
ALTER TABLE xxx
DISABLE ALL TRIGGERS;
Thanks.
There is an internal table called user_triggers
this will hold all the triggers pertains to your schema.
just build a sql like this
select 'alter table '|| table_name||' disable all triggers ; '
from user_triggers;
spool this output to a file and execute.
Once bulk loading is complete,
build the same script to enable it.
that's it.
Hi,
Here is a script that can be used without any Damage.
spool Disable.sql
select 'Alter Trigger '||Trigger_Name||' Disable ;'
From User_Triggers;
spool off
@Disable.sql
To Enable Use this one
spool Enable.sql
Select 'Alter Trigger '||Trigger_name ||' Enable ;'
From User_Triggers;
spool off
@Enable.sql
Hope this will help you.
Thanks