CPU 使用率(\%)

Microsoft.SQLServer.2012.DBEngine.CPUUsagePercentMonitor (UnitMonitor)

针对 2012 数据库引擎的 CPU 使用率(\%)

Knowledge Base article:

摘要

提供一个测量方法,以便测量处理器实际处理 SQL Server 的进程线程所用的时间量。

原因

所有已分配的 CPU 都在忙于处理 SQL Server 任务。

解决方法

通过使用性能监视器 SQL Server 计数器以及与 DMV 相关的性能(例如 sys.dm_exec_query_stats),评估 SQL Server 使用较高百分比的 CPU 的原因。

排除 SQL Server 2008 中的性能问题

http://technet.microsoft.com/zh-cn/library/dd672789(v=sql.100).aspx

创建扩展事件会话

http://technet.microsoft.com/zh-cn/library/hh213147.aspx

Element properties:

TargetMicrosoft.SQLServer.2012.DBEngine
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2012.DBEngine.CPUUsagePercent.MonitorType
RemotableTrue
AccessibilityPublic
Alert Message
SQL 数据库引擎 2012 CPU 使用率(\%)过高
计算机“{1}”上 SQL 实例“{0}”的 CPU 使用率过高。有关详细信息,请参阅“警报上下文”选项卡。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.DBEngine.CPUUsagePercentMonitor" Accessibility="Public" Enabled="true" Target="SQL2012Core!Microsoft.SQLServer.2012.DBEngine" ParentMonitorID="SystemHealth!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.DBEngine.CPUUsagePercent.MonitorType" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.DBEngine.CPUUsagePercentMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Normal" MonitorTypeStateID="Normal" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>300</IntervalSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<Threshold>95</Threshold>
<NumSamples>6</NumSamples>
<SyncTime/>
</Configuration>
</UnitMonitor>