Subject RE: [firebird-support] Monitoring Firebird SQL
Author Nigel Weeks
There are no native methods of SQL tracking, but there are a number of
options you can do:



Use a proxy server on top:

a free one is called balance, which can output all traffic to the console
if you wish (very verbose, and not all that readable.)



Inside triggers and stored procedures:

Inside every Trig and SP, write a record to a trace table, outlining any
parameters passed in. Handy for tracking down slow queries, especially if
there's a timestamp on the log table.



At the Database Abstraction Layer:

If you use an abstraction layer, put a few extra lines of code to write
the command you're about to run, out to a file, or into another DB table:



<?php



function db_qry($sql){

if( $fh = fopen("c:/logs/query.log","w") ) {

fwrite($fh, date()." ".$sql)

fclose($fh);

}

return ibase_query($sql);

}



$rec = db_qry("select * from table where field = value");



?>



Remember that the above example is blocking - that is, only one query can be
written to the file at any one time. For faster logging, consider an
asynchronous method that passes data to a buffer that then gets synced to
the file.



Nige.





Nigel Weeks

Tech Support and Systems Developer

Rural Press Tasmania

The Examiner Newspaper

Ph. 03 6336 7234

Mob. 0408 133 738

Email. <mailto:nweeks@...> nweeks@...

_____

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of robertgilland
Sent: Tuesday, 29 May 2007 3:15 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Monitoring Firebird SQL



How can I know what SQL's are being processed by the firebird service?





[Non-text portions of this message have been removed]