Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auditing
Message
Information générale
Forum:
Oracle
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00564673
Message ID:
00566820
Vues:
16
This message has been marked as the solution to the initial question of the thread.
Sounds like you have some trigger that updates a table using the date
and user all you need to use is the :new.fieldname and :old.fieldname
values to this

You have a few choices.
1) Use Oracles internal logging (DBMS_LOGMNR)
2) Write a trigger to log.
3) Audit in the application.
4) Write your own logging procedures (can do complicated things like log attempts to view or drop tables.)


I choose to audit in the application but sometimes need to consult the
databases

A trigger that woul dlog might look something like:
create or replace trigger TR_TABLENAME_AUDIT
AFTER INSERT OR UPDATE ON "TABLENAME" FOR EACH ROW
BEGIN
         INSERT INTO AUDIT (LOGDATE,LOGUSER,LOGFIELD,OLDVAL,NEWVAL)
         VALUES (SYSDATE,USER,'FIELDNAME',:old.fieldname,:new.fieldname);

END;
/
SHO ERR
I tried once to make triggers that log each field level change
but found writing one that will work on any table not worth the work so
when I did this before I wrote code that will generate the triggers based on the column names that can be run when structures change. But all you need
is the :old and :new values.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform