Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auditing
Message
General information
Forum:
Oracle
Category:
Troubleshooting
Title:
Miscellaneous
Thread ID:
00564673
Message ID:
00566820
Views:
15
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform