Re: Tuning 'Alter Modify" column

  • From: Jonathan Lewis <jlewisoracle@xxxxxxxxx>
  • To: Oracle L <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 25 Aug 2022 12:00:22 +0100

On Thu, 25 Aug 2022 at 11:12, yudhi s <learnerdatabase99@xxxxxxxxx> wrote:

Yes, there are triggers for before each row insert/update/delete and it's
doing some operation like perform count from some other table etc...there
for those update trigger. But as it's an Alter query but internally Oracle
doing update, so does the trigger will come into picture here?


That's not a safe question to ask - whatever answer you get it may be wrong
unless it's actually in the documentation with all possible variations
covered.
No matter how many tests someone has done with triggers and alter table
etc. they may not have covered exactly your circumstances.

Arguably a potentially relevant update trigger HAS to fire - what if you
had a trigger which said "if substr(c1,-3) = ' three spaces}'  then ..."
Your alter table would make some of the results of any previous firing of
that trigger potentially wrong. On the other hand if your update trigger
had a declaration like:

create or replace trigger t1_bru
before update of c2
on t1
for each row
...

then it would not have to fire if your alter table command was modifying c1.

The only safe option is for you to examine your triggers in great detail to
see what they would do for an update to the critical column.


Regards
Jonathan Lewis

Other related posts: