[Tfug] RDBMS audit trails?

Claude Rubinson rubinson at u.arizona.edu
Wed Jul 30 17:01:06 MST 2008


On Wed, Jul 30, 2008 at 04:24:02PM -0700, Bexley Hall wrote:
> Hi,
> 
> Sorry for what *might* seem like a newbie question... <:-(
> 
> Are there built-in mechanisms to implement audit trails in
> most RDBMS's?

Nothing that's standardized.  Both PostgreSQL and MySQL provide
mechanisms for monitoring what's going on with the database.  My
memory may be failing me but I believe that MySQL writes to log files
while PostgreSQL stores the data within the db (or maybe vice versa).

> E.g., I *think* I can do this by creating a bunch of triggers in
> PostgreSQL.  (??)  But, what about things like MSAccess, MySQL,
> etc.?
>
> I'm just looking for entries like:
> 
> record #, who, when

It's trivial to set up triggers to do such a thing but by doing so
you're doubling your number of transactions.  If you have a low number
of transactions, a decent RDBMS won't sneeze at this.  But it's ugly,
not particularly scalable, and certainly not a "best practice."
You're generally better off using the built-in mechanisms or one of
the many available log analyzers out there.

Claude




More information about the tfug mailing list