Subject Re: [firebird-support] Recording Update statements and User that executed
Author Thomas Steinmaurer
Marius,

> [Marius Labuschagne] "Hi,
>
> Is it possible to record any UPDATE statement that is executed against a
> database, from the database level?
>
> Something very strange happened to one of my Clients databases, where one
> field in a table was set to another field in the same table (both double
> precision fields). I suspect that this was executed by an end user using
> one of the database tools like IBExpert or Database Workbench, but there is
> no way that I can prove it.
>
> After analysis of the data and my application, I found that the particular
> UPDATE that was executed is not present at all anywhere in the source code
> of the application.
>
> Regards
> Marius J. Labuschagne "
>
> Hi,
>
> I think I could possibly use the trace manager to accomplish what I want to
> track.

While this might work, for DML change data capture scenarios, you might
want to investigate a trigger-based solution as well. This allows you to
capture new AND old column values, if you are in need to.

> The section below is my database section in my fbtrace.conf file, but the
> logfile is not created. Could anyone please advise me of where I am going
> wrong?
> I am running Firebird 2.5.2 in superclassic mode on a Windows 7 64 bit
> machine.
> I start the trace manager with the following command, and can see the traces
> in the cmd window: C:\Program Files\Firebird\Firebird_2_5\bin>fbtracemgr -se
> service_mgr -U sysdba -P masterkey -start -name my_trace -CONFIG
> fbtrace.conf

The logfile is only created, when you are running a system audit, which
means you are not starting a trace session on your own, but let the
engine start one automatically. This can be achieved by setting the:

AuditTraceConfigFile

configuration parameter in firebird.conf to your fbtrace.conf file.

So, when running a user trace session as above with fbtracemgr, trace
data is received by the trace client (in your case fbtracemgr.exe).

As tools make your life easier, you could investigate FB TraceManager.
http://www.upscene.com/products.misc.fbtm.php

It has everything you need to work with the Trace API efficiently.


--
With regards,
Thomas Steinmaurer
http://www.upscene.com/