Hi everyone,We would like to set up fbtrace for all events which are writing to a database. So all select kind of statements should be excluded.
We have in our database also stored procedures. Some are only selecting data and others are changing datas. We thought we could trace the execution of stored procedures but add all stored procedures which are only selecting data to the exclude_filter. However this seems not to work.Is exclude_filter connected with stored procedures or only with ‘normal’ sql statements?
And if it’s not connected any ideas how we could achieve our goal.
We would like to set up fbtrace for all events which are writing to a database. So all select kind of statements should be excluded.Be careful, it could generate a lot of trace logs and make some impact on performance.We have in our database also stored procedures. Some are only selecting data and others are changing datas. We thought we could trace the execution of stored procedures but add all stored procedures which are only selecting data to the exclude_filter. However this seems not to work.Is exclude_filter connected with stored procedures or only with ‘normal’ sql statements?SQL query filters (include_ filter and exclude_filter) affects only what was send by application, i.e. 'normal' sql statements.It not 'see' body of PSQL objects such as stored procedures, triggers and so on.
I didn't expect that the body of a stored procedure is analysed but I expected that exclude filter will consider the name of a stored procedure.
Let's say I have the following trace configuration:
exclude_filter = %(MyTable|MyStoredProcedure)%
log_statement_start = true
log_procedure_start = true
If I execute a statement
SELECT * FROM MyTable
I don't get any entry into the tracelog.
However if I execute a statement
SELECT * FROM MyStoredProcedure(1)
then I get the following tracelog:
2022-07-18T09:55:11.9800 (XXXX:XXXXX) EXECUTE_PROCEDURE_START
C:\MyDatabase.FDB (ATT_279, MyUser:NONE, ISO88591,
TCPv6:::X/XXXX5)
C:\MyTool:19460
(TRA_3855, READ_COMMITTED | REC_VERSION | NOWAIT |
READ_WRITE)
Procedure MYSTOREDPROCEDURE:
param0 = bigint, "1"
So to me it seems there is no way to filter Stored Procedure calls by the name of the stored procedure. Can you confirm that this is really the actual behaviour and not any misconfiguration on my side?
Thanks a lot for the support!
Daniel