数据库文件空间(汇总)

Microsoft.SQLServer.2008.DBFileGroup.DBFileSpaceMonitorRollUp (DependencyMonitor)

监视文件组中的可用空间。

Knowledge Base article:

摘要

监视文件组中的可用空间以及托管文件组的介质的可用空间。只有为其中一个文件启用了自动增长时,才将托管文件的介质上的可用空间作为可用空间的一部分包括在内。

原因

不正常状态是由此文件组可用空间不足引起的。导致可用空间不足的原因有:

使用以下链接查看性能数据: 数据库文件组可用空间性能数据

不自动增长

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

启用自动增长

启用了自动增长后,会将磁盘可用空间作为可用空间的一部分包括在内。除了文件大小与已用空间的差值之外,启用了自动增长的文件的可用空间将是最大大小与文件大小的差值和磁盘上剩余可用空间这两者的较小值。

启用了自动增长的数据库文件的可用空间不足可能表示该文件正在接近所在逻辑驱动器的限制值。对于具有最大大小的启用了自动增长的文件,可用空间不足还可能表示该文件正在接近为文件指定的最大大小。

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

解决方法

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

请参阅 SQL Server 联机丛书: 文件和文件组体系结构

可替代参数

名称

说明

默认值

警报优先级

定义警报优先级。

正常

警报严重性

定义警报严重性。

MatchMonitorHealth

已启用

启用或禁用工作流。

生成警报

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

Element properties:

TargetMicrosoft.SQLServer.2008.DBFileGroup
Parent MonitorMicrosoft.SQLServer.2008.Database.DBFileGroupSpaceMonitor
AlgorithmBestOf
Source MonitorMicrosoft.SQLServer.2008.Monitoring.DBFileSpaceMonitor
RelationshipMicrosoft.SQLServer.2008.DBFileGroupHostsDBFile
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
RemotableTrue
AccessibilityPublic
Alert Message
文件组空间用尽
计算机“{3}”上 SQL 实例“{2}”中的数据库“{1}”的文件组 «{0}» 空间用尽。有关详细信息,请参阅知识部分。

Source Code:

<DependencyMonitor ID="Microsoft.SQLServer.2008.DBFileGroup.DBFileSpaceMonitorRollUp" Accessibility="Public" Enabled="true" Target="SQL2008Core!Microsoft.SQLServer.2008.DBFileGroup" ParentMonitorID="Microsoft.SQLServer.2008.Database.DBFileGroupSpaceMonitor" Remotable="true" Priority="Normal" RelationshipType="SQL2008Core!Microsoft.SQLServer.2008.DBFileGroupHostsDBFile" MemberMonitor="Microsoft.SQLServer.2008.Monitoring.DBFileSpaceMonitor">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.DBFileGroup.DBFileSpaceMonitorRollUp.AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL!Microsoft.SQLServer.DBFileGroup"]/GroupName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</AlertParameter2>
<AlertParameter3>$Target/Host/Host/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</AlertParameter3>
<AlertParameter4>$Target/Host/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<Algorithm>BestOf</Algorithm>
<MemberUnAvailable>Error</MemberUnAvailable>
</DependencyMonitor>