auditing 50 columns using oracle trigger

后端 未结 5 881
故里飘歌
故里飘歌 2020-12-11 20:08

I need to create a trigger in oracle 11g for auditing a table .

I have a table with 50 columns that need to be audited

5条回答
  •  萌比男神i
    2020-12-11 20:43

    the way i like to do it:

    1. create an audit table that is parallel to your existing original table.
    2. add a timestamp and user columns to this audit table.
    3. whenever the original table is inserted or updated, then just insert into the audit table.
    4. the audi table should have a trigger to set the timestamp and user values - all other values come in as the new values.

    then you can query at any time who did what, and when.

提交回复
热议问题