I have added an extended event log that logs
blocked_process_report events and
I can exclude certain databases from the blocked_process_report by adding
But how do I exclude a database's
xml_deadlock_report events? The property "
sqlserver.database_name" appears to be set to "
master" for a deadlock event, no matter where the deadlock occured. I suppose this is because in theory multiple databases could be affected by the same deadlock.
The server in question contains a database which constantly has deadlocks, but which is managed by a different entity and does not concern me. I would like to prevent these events from filling up the log.
This is the script used to create the log:
CREATE EVENT SESSION [blocked_process] ON SERVER ADD EVENT sqlserver.blocked_process_report( ACTION(sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.sql_text,sqlserver.username) WHERE ([database_name]<>N'XXXXXXXXXXXXXXX')), ADD EVENT sqlserver.xml_deadlock_report( ACTION(package0.callstack,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.database_name,sqlserver.nt_username,sqlserver.session_nt_username,sqlserver.username)) ADD TARGET package0.event_file(SET filename=N'D:\xxx\blocked_process.xel',max_file_size=(65536),max_rollover_files=(5),metadatafile=N'D:\xxx\blocked_process.xem') WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=ON) GO