MySQL Forums
Forum List  »  MySQL Workbench

Creating audit trail table in mysql db
Posted by: Krishna Kumar
Date: March 18, 2013 12:06AM

I need some help in creating an audit trail table. Here is my scenario:

Suppose there are n number of tables in the database. Whatever insert,update,delete happen across any table in the database, have to be captured in a table called "Audit_Trail", where we have the below columns in the audit trail tables.

Server_Name
AT_date
AT_time
Table_name
Column_name
Action
Old_value
New_Value

The server on which table, on which column, on which date and time need to be captured. Also, the "Action" column tracks whether an action is an insert, update or delete and we have to capture the old value and new value as well.

So what is the best way to do this? Can we create a database level trigger which can fire trigger in case of any insert, update or delete?

Thanks in advance!
Krishna

Options: ReplyQuote


Subject
Views
Written By
Posted
Creating audit trail table in mysql db
4203
March 18, 2013 12:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.