Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Auditing: Trigger or Audit_Trail?
"Teresa Redmond" <NJZLIRWUWYGI_at_spammotel.com> a écrit dans le message de
news:afd4289902170a172b40a4a2f9e36762_at_news.teranews.com...
> Hello all,
>
> I'm spending a lot of time reading and studying, trying to decide
> whether to pursue auditing via the Audit Trail tables or via a trigger
> on the tables that I want to audit.
>
> My question is this: if I have one schema that I would like to audit
> (131 tables and 196000 records, and not a fast growing db), and what I
> want to audit is DML (delete and update only) and who does it, when,
> and from where, am I better off using the Audit Trail or using
> triggers? If I use the Audit Trail can I change it so that it will do
> just what I want, or is this "not good to do"?
>
> I've got lots of example code that I'm trying to follow to do this, I
> just need to know which is the better to do. Thanks so much!
>
> --
> Teresa Redmond
> Programmer/Analyst III
> Anteon Corporation
> tredmond at anteon dot com
imho, if this can be done by the core engine, i use that. If it can't do what i want, i create a trigger.
In your case, you can use:
audit delete, update on <your objects>
and then do something like the following to report:
Column username FORMAT A11 HEADING User Column terminal FORMAT A11 HEADING Terminal Column owner FORMAT A10 HEADING Owner Column obj_name FORMAT A15 HEADING Object Column action_name FORMAT A14 HEADING Action TRUNC Column returncode FORMAT 99990 HEADING RC Column time_ FORMAT A17 HEADING Time Select username, terminal, owner, obj_name, action_name, returncode, to_char(timestamp,'DD/MM/YY HH24:MI:SS') time_from dba_audit_object
Regards
Michel Cadot
Received on Mon Mar 01 2004 - 12:08:28 CST