Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disable triggers just for current session.

Mustafa KALAYCISep 14 2020 — edited Sep 14 2020

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;

thanks.

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.

Comments
Post Details
Added on Sep 14 2020
5 comments
2,910 views