This recipe provides different ways to collect changes to data contained in the tables for auditing purposes.
Determine the following:
- Do you need to audit all changes or only some?
- What information about the changes do you need to collect: just the fact of change?
- New value of a field or tuple, is old value also needed here?
- Is it enough to record the user doing the change, or is the IP address and other connection information also needed?
- How secure (tamper-proof) must the auditing info be? For example, does it need to be kept separately, away from the database being audited?
Based on answers to the aforementioned questions, you can start selecting the right auditing method from the ones presented next.