August 19, 2014 at 12:08 pm
I have an XE running to catch failing queries, and I keep seeing this error; "auto statistics internal"
I can't find any information on what the error indicates or how to fix it. Can anyone help?
Here is the script for my XE:
IF EXISTS(SELECT 1 FROM sys.dm_xe_sessions)
DROP EVENT SESSION
what_queries_are_failing ON SERVER
DECLARE @filename1 VARCHAR(256)
DECLARE @filename2 VARCHAR(256)
DECLARE @sql NVARCHAR(1000)
SET @filename1 = (
SELECT SUBSTRING(physical_name, 1, PATINDEX('%DBAMonitoringDatabase%', physical_name)-1) + 'what_queries_are_failing.xel'
FROM sys.master_files
WHERE DB_NAME(database_id) = 'DBAMonitoringDatabase'
AND file_id = 2
)
SET @filename2 = (
SELECT SUBSTRING(physical_name, 1, PATINDEX('%DBAMonitoringDatabase%', physical_name)-1) + 'what_queries_are_failing.xem'
FROM sys.master_files
WHERE DB_NAME(database_id) = 'DBAMonitoringDatabase'
AND file_id = 2
)
--drop event session what_queries_are_failing on server
SET @sql = 'Create EVENT SESSION
what_queries_are_failing
ON SERVER
ADD EVENT sqlserver.error_reported
(
ACTION (sqlserver.sql_text, sqlserver.tsql_stack, sqlserver.database_id, sqlserver.username, sqlserver.client_hostname)
WHERE ([severity]> 10)
)
ADD TARGET package0.asynchronous_file_target
(set filename = ''' + @filename1 + ''',
metadatafile = ''' + @filename2 + ''',
max_file_size = 5,
max_rollover_files = 5)
WITH (MAX_DISPATCH_LATENCY = 5SECONDS)
'
EXEC sp_executesql @sql
-- Start the session
ALTER EVENT SESSION what_queries_are_failing
ON SERVER STATE = Start
GO
Jared
CE - Microsoft
October 16, 2014 at 1:49 am
Hi Jared,
I came up to the same error message with an XE session, and could not find any information about this error.
Did you find an answer to this?
Igor Micev,My blog: www.igormicev.com
October 16, 2014 at 6:09 am
I found this:
9104 essentially means that auto statistics failed for some reason (deadlock, resource crunch, ...). Since the engine can go on without auto-created or auto-refreshed statistics, the engine doesn't surface this error.
Jared
CE - Microsoft
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply