- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 62 Insurance
- 536K On-Premises Infrastructure
- 138.2K Analytics Software
- 38.6K Application Development Software
- 5.7K Cloud Platform
- 109.4K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
Disable triggers just for current session.
during a maintenance operation on the table, I would like to disable table triggers for just current session! for example I would like to archive some rows using "row archival" but when I updated rows for ora_archive_state='1', a before update trigger causes to change update_date and update_user columns but actually this is not an application operation so it shouldn't be firing triggers. Also this could be used to prevent some logging operation via triggers or (unfortunately) a trigger calling a web service etc. of course we can add a WHEN clause to trigger and filter the operation with action/module/client_identiferi/user etc but if I need to do this operation for many tables, every trigger on those tables must be changed and developers must be developed their code based on that. forcing a developer or at least leaving the option to do this might be terrible idea. so as a database admin or developer admin, I would be glad if I can disable triggers on a table just for that session.
it could be something like:
Alter table A_table disable all triggers for current session;
edit: when I googled this, I found a package :sys.dbms_xstream_gg.set_foo_trigger_session_contxt(fire=>true); bu undocumented and can be used for only goldengate. So this has already been implemented.