数据库空间百分比更改

Microsoft.SQLServer.2012.Database.DBSizePercentageChangeMonitor (UnitMonitor)

监视在一定的采样期间数据库可用空间值的显著更改。

Knowledge Base article:

摘要

监视在一定的采样期间数据库可用空间值的显著更改。值的快速显著更改可能表示存在问题。

原因

不正常状态是由在一定的采样期间可用空间的显著更改引起的。可能的原因有:

使用以下链接来查看性能数据: 数据库性能数据

此监视器根据每个文件配置聚合文件组内每个文件的可用空间:

不自动增长

对于不进行自动增长的文件,可用空间为文件的初始大小与已用空间的差值。

启用自动增长

除了文件大小与已用空间的差值之外,启用了自动增长的文件的可用空间将是最大大小与文件大小的差值和磁盘上剩余可用空间这两者的较小值。

可用空间计算还要考虑: 如果文件的增长量大于磁盘剩余的可用空间量,文件可能无法增长;如果最大大小与当前文件大小之间的差值小于增长量,文件也将无法增长。在这些情况下,磁盘上剩余的可用空间不作为可用空间的一部分包括在内,因为我们不能再增长了。

解决方法

可以通过以下任一方法解决此问题:

可替代参数

名称

说明

默认值

警报优先级

定义警报优先级。

正常

警报严重性

定义警报严重性。

MatchMonitorHealth

已启用

启用或禁用工作流。

生成警报

定义工作流是否生成警报。

间隔(秒)

运行工作流的重复间隔时间(秒)。

900

阈值下限

此监视器的阈值下限。

25

样本数

指示在状态发生更改之前测量值应违反阈值的次数。

5

同步时间

使用 24 小时格式指定的同步时间。可以忽略。

 

超时(秒)

指定允许工作流在被关闭并标记为失败之前运行的时间。

300

阈值上限

此监视器的阈值上限。

45

Element properties:

TargetMicrosoft.SQLServer.2012.Database
Parent MonitorMicrosoft.SQLServer.2012.Database.DBSpaceMonitor
CategoryPerformanceHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2012.DBPercentageChange
RemotableTrue
AccessibilityPublic
Alert Message
数据库总可用空间的显著百分比更改
计算机 {2} 上 SQL 实例 {1} 中的数据库 {0} 的可用空间发生显著更改。有关详细信息,请参阅“警报上下文”选项卡。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.Database.DBSizePercentageChangeMonitor" Accessibility="Public" Enabled="false" Target="SQL2012Core!Microsoft.SQLServer.2012.Database" ParentMonitorID="Microsoft.SQLServer.2012.Database.DBSpaceMonitor" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.DBPercentageChange" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.Database.DBSizePercentageChangeMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UnderThreshold1" MonitorTypeStateID="UnderThreshold1" HealthState="Success"/>
<OperationalState ID="OverThreshold1UnderThreshold2" MonitorTypeStateID="OverThreshold1UnderThreshold2" HealthState="Warning"/>
<OperationalState ID="OverThreshold2" MonitorTypeStateID="OverThreshold2" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<ServerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ServerName>
<SqlInstanceName>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</SqlInstanceName>
<ObjectName>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/PerformanceCounterObject$:Database</ObjectName>
<CounterName>DB Total Free Space (%)</CounterName>
<InstanceName/>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<Value>$Data/Property[@Name='DBFreeSpacePercent']$</Value>
<Threshold1>25</Threshold1>
<Threshold2>45</Threshold2>
<NumSamples>5</NumSamples>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>