Troubleshooting sql using_system_health_x_event_session
-
Upload
parikshit-savjani -
Category
Technology
-
view
82 -
download
3
description
Transcript of Troubleshooting sql using_system_health_x_event_session
![Page 1: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/1.jpg)
Troubleshooting SQL Server using system health Xevents session
MicrosoftParikshit Savjani
Click icon to add picture
![Page 2: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/2.jpg)
2
System Health Xevent Session
• A True Black Box Recorder within SQL Server
• Xevent session running continuously
• Collects • The sql_text and session_id for any sessions that encounter an error that has a severity
>=20, memory-related error (701).• The callstack, sql_text, and session_id for any sessions that have waited on latches for
> 15 seconds, locks for > 30 seconds.• Deadlock detected.• The ring_buffer events for the memory broker, scheduler monitor, memory node OOM,
security, and connectivity.• sp_server_diagnostics• CLR Allocation failures
• Data Collected in ring buffer target & *.xel files in Log Folder ( 4 Rollover Files of 5MB)
Tool for folks carrying the pager
![Page 3: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/3.jpg)
3
Click icon to add picture
How to make sense out of Black Box recorder data
![Page 4: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/4.jpg)
4
System Health Session Monitoring
• Increase System Health Xel File retention
• Create Import DB & Schema
• Import the xel files into the database
• Use SSRS reports to analyze the data captured by system health session
![Page 5: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/5.jpg)
5
System Health Log Retention
ALTER EVENT SESSION [system_health] ON SERVER STATE = STOP
go
ALTER EVENT SESSION [system_health] ON SERVER
DROP TARGET package0.event_file
ALTER EVENT SESSION [system_health] ON SERVER
ADD TARGET package0.event_file
(SET filename=N'system_health.xel'
,max_file_size=(25),
max_rollover_files=(5))
GO
ALTER EVENT SESSION [system_health] ON SERVER STATE = START
go
![Page 6: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/6.jpg)
6
SQL 2012 System Health Session Reporting Dashboard
Download System Health Session Reporting Dashboardhttp://gallery.technet.microsoft.com/scriptcenter/SQL-2012-System-Health-eb753bb6
• Create Import DB and Schema:
• Import the System Health Sessions into a Database
Exec spLoadSystemHealthSession Exec spLoadSystemHealthSession @path_to_health_session='D:\XELFiles\system_health*.xel',@UTDDateDiff=-6
• Check Import Status Select * from tbl_ImportStatus
![Page 7: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/7.jpg)
7
Import Database Schema
Name Description
tbl_ImportStatus Import Stats , each step Start time
tbl_scheduler_monitor Pulls out details from RING_BUFFER_SCHEDULER_MONITOR
tbl_Resource Details from sp_server_diagnostics RESOURCE component, mainly Memory info
tbl_IO_SUBSYSTEM Details from sp_server_diagnostics IO component
tbl_SYSTEM Details from sp_server_diagnostics System component
tbl_Summary Summary States for sp_server_diagnostic_component_result individual components
tbl_OS_WAIT_STATS_byDuration Top 10 Waits since Server Restart ( not deltas)
tbl_QUERY_PROCESSING Details from sp_server_diagnostics System component
tbl_BlockingXeOutput Details of any significant blocking > 30 seconds
tbl_security_ring_buffer Security Ring buffer Details
tbl_errors Details from RING_BUFFER_EXCEPTION
tbl_waitqueries Any queries with significant waits > 15 seconds or 30 seconds depending on wait_type
tbl_connectivity_ring_buffer Details from RING_BUFFER_CONNECTIVITY
tbl_DeadlockReport Times of Deadlock occurrences
![Page 8: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/8.jpg)
8
System Health Dashboard Reports
• Open the XEventreporting.sln & deploy the reports
• Start with Dashboard Report (dashboard.rdl)
![Page 9: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/9.jpg)
9
Stored Credentials for Report
If Kerberos is not configured, you may have to store credential ls at the data sources for each report.
![Page 10: Troubleshooting sql using_system_health_x_event_session](https://reader036.fdocuments.us/reader036/viewer/2022082915/545437eeaf795911308b5811/html5/thumbnails/10.jpg)
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION
Contact
Parikshit SavjaniPremier Field [email protected]://www.sqlserverfaq.net
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION