<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Auditing your MySQL Data</title>
	<atom:link href="http://ronaldbradford.com/blog/auditing-your-mysql-data-2008-07-15/feed/" rel="self" type="application/rss+xml" />
	<link>http://ronaldbradford.com/blog/auditing-your-mysql-data-2008-07-15/</link>
	<description>Expert times and information on MySQL</description>
	<lastBuildDate>Fri, 12 Mar 2010 22:45:29 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Roland Bouman</title>
		<link>http://ronaldbradford.com/blog/auditing-your-mysql-data-2008-07-15/comment-page-1/#comment-383</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Mon, 14 Jul 2008 22:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://ronaldbradford.com/blog/?p=1106#comment-383</guid>
		<description>Hi Ronald,

Nice post! I have a few comments though...

&quot;In this case, the support for a TRIGGER on Instance Startup to run&quot;

Well, you can actually do this, kind of:

http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_init-file

&quot;I want to keep a history of all changes to two tables, and have a means of viewing this history.&quot;
and
&quot;An alternative is to keep a full copy of all versions including current in the Audit Table.&quot;

I don&#039;t see you keeping track of the DELETEs. You can of course query it and deduce that a row must have been deleted, but it seems more sensible to ensure the history database is a full history, including DELETE events (so you can reconstruct the current situation from a history database alone). Of course that would involve another TRIGGER.

Another thing I was wondering about is why you don&#039;t add at least a datetime or timestamp, and possibly other data such as current user, user host etc. to the audit tables. I mean, if you see something strange, You&#039;d like to know when it happened, and who did it, no?

&quot;I do not generally like to use ‘SELECT *’ however in this situation, the trigger is significantly simplified. This is of benefit if you are maintaining audit triggers on many tables.&quot;

mm, personally I don&#039;t like this trigger code that much...For each updated or inserted row you select the current row from the table...why? All data for the current row is available in the NEW.% columns, so there is no need to query anything...If is of course tedious to type all that, but you can easily generate the TRIGGER code from the I_S. Once you write that script, you can easily extend the history to include more tables as a bonus...

see: http://www.quest-pipelines.com/newsletter-v6/1005_A.htm

(spirit of the code is there, not sure if everything works)

kind regards,

Roland</description>
		<content:encoded><![CDATA[<p>Hi Ronald,</p>
<p>Nice post! I have a few comments though&#8230;</p>
<p>&#8220;In this case, the support for a TRIGGER on Instance Startup to run&#8221;</p>
<p>Well, you can actually do this, kind of:</p>
<p><a href="http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_init-file" rel="nofollow">http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_init-file</a></p>
<p>&#8220;I want to keep a history of all changes to two tables, and have a means of viewing this history.&#8221;<br />
and<br />
&#8220;An alternative is to keep a full copy of all versions including current in the Audit Table.&#8221;</p>
<p>I don&#8217;t see you keeping track of the DELETEs. You can of course query it and deduce that a row must have been deleted, but it seems more sensible to ensure the history database is a full history, including DELETE events (so you can reconstruct the current situation from a history database alone). Of course that would involve another TRIGGER.</p>
<p>Another thing I was wondering about is why you don&#8217;t add at least a datetime or timestamp, and possibly other data such as current user, user host etc. to the audit tables. I mean, if you see something strange, You&#8217;d like to know when it happened, and who did it, no?</p>
<p>&#8220;I do not generally like to use ‘SELECT *’ however in this situation, the trigger is significantly simplified. This is of benefit if you are maintaining audit triggers on many tables.&#8221;</p>
<p>mm, personally I don&#8217;t like this trigger code that much&#8230;For each updated or inserted row you select the current row from the table&#8230;why? All data for the current row is available in the NEW.% columns, so there is no need to query anything&#8230;If is of course tedious to type all that, but you can easily generate the TRIGGER code from the I_S. Once you write that script, you can easily extend the history to include more tables as a bonus&#8230;</p>
<p>see: <a href="http://www.quest-pipelines.com/newsletter-v6/1005_A.htm" rel="nofollow">http://www.quest-pipelines.com/newsletter-v6/1005_A.htm</a></p>
<p>(spirit of the code is there, not sure if everything works)</p>
<p>kind regards,</p>
<p>Roland</p>
]]></content:encoded>
	</item>
</channel>
</rss>
