There will be at times where we would be wondering as what happened in the history that caused the SQL Server slow down or poor performance.
one such clue to look at initially is the CPU pressure.
using the Below Query we can pull the CPU Utilization history for the last 30 minutes.
You can see CPU Utilized by SQL Server and Other Windows Processes.
DECLARE @ts_now bigint SET @ts_now = (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info); SELECT
SystemIdle
100 TOP(50) SQLProcessUtilization AS [SQL Server Process CPU Utilization], AS [System Idle Process], - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM ( SELECT
record record.value('(./Record/@id)[1]', 'int') AS record_id, .value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS
record [SystemIdle], .value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS [SQLProcessUtilization], [timestamp] FROM ( SELECT [timestamp], CONVERT(xml, record) AS [record] FROM sys.dm_os_ring_buffers WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' AND record LIKE '%<SystemHealth>%') AS x ) AS y ORDER BY record_id DESC;
...Happy SQLing
Thanks for Visiting and Sharing your Views
one such clue to look at initially is the CPU pressure.
using the Below Query we can pull the CPU Utilization history for the last 30 minutes.
You can see CPU Utilized by SQL Server and Other Windows Processes.
DECLARE @ts_now bigint SET @ts_now = (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info); SELECT
SystemIdle
100 TOP(50) SQLProcessUtilization AS [SQL Server Process CPU Utilization], AS [System Idle Process], - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM ( SELECT
record record.value('(./Record/@id)[1]', 'int') AS record_id, .value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS
record [SystemIdle], .value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS [SQLProcessUtilization], [timestamp] FROM ( SELECT [timestamp], CONVERT(xml, record) AS [record] FROM sys.dm_os_ring_buffers WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' AND record LIKE '%<SystemHealth>%') AS x ) AS y ORDER BY record_id DESC;
...Happy SQLing
Thanks for Visiting and Sharing your Views
No comments:
Post a Comment