I am interested in what methods of logging is frequent in an Oracle database. Our method is the following:
We create a log table for the table to be logged. The log table contains all the columns of the original table plus some special fields including timestamp, modification type (insert, update, delete), modifier's id. A trigger on the original table creates one log row for each insertion and deletion, and two rows for a modification. Log rows contain the data before and after the alteration of the original one.
Although state of the records can be mined back in time using this method, it has some drawbacks:
- Introduction of a new column in the original table does not automatically involves log modification.
- Log modification affects log table and trigger and it is easy to mess up.
- State of a record at a specific past time cannot be determined in a straightforward way.
- ...
What other possibilities exist? What kind of tools can be used to solve this problem?
I only know of log4plsql. What are the pros/cons of this tool?