监视 Linux 上的数据库的“自动关闭”设置。注意: 默认情况下,此监视器为禁用状态。请根据需要使用替代进行启用。
此监视器检查此数据库的“自动关闭”设置。因为此监视器是整体标准要求的一部分,如果该设置不符合指定的标准,将生成警报。
AUTO_CLOSE 选项允许将数据库文件作为常规文件进行管理,因此,该选项对于桌面数据库很有用。它们可以移动、复制以制作备份,或者甚至通过电子邮件发送给其他用户。但是,在数据库设置为 AUTOCLOSE = ON 时,启动数据库自动关闭的操作将清除 SQL Server 实例的计划缓存。清除计划缓存将导致对所有后续执行计划进行重新编译,并可能导致查询性能暂时性地突然降低
数据库镜像要求将 AUTO_CLOSE 设置为 OFF。
只有在确保应用程序使用模式将在相对较长的期间中保持数据库关闭的情况下,自动关闭才有意义。某些单用户应用和某些多租户数据库宿主情况可能会从 AUTO_CLOSE ON 中获益。对于所有其他用法,通常这样做并不好,除非真正理解应用程序行为和使用模式
|
当“自动关闭”设置为 ON 时,数据库将在最后一个用户退出后完全关闭,它占用的资源也将释放。
AUTO_CLOSE {ON | OFF}
如果“自动关闭”选项与所需的设置不匹配,将生成一个警告警报。在初始状态下,监视器配置为在此设置为 "ON" 时发出警报。
可以通过以下任一方法解决此问题:
更改此数据库的配置设置,使其与预期值匹配。
对于此特定数据库或所有数据库覆盖此单元监视器的预期值。
或者,如果不对此数据库考虑此监视器:
使用覆盖选项禁用此特定数据库或所有数据库的此监视器。
使用覆盖选项禁用此特定数据库或所有数据库的顶级聚合配置监视器。
名称 | 说明 | 默认值 |
警报优先级 | 定义警报优先级。 | 正常 |
警报严重性 | 定义警报严重性。 | 警告 |
启用 | 启用或禁用工作流。 | 否 |
预期值 | 数据库配置设置的预期值。要查看适用值集,请参阅此监视器的知识库文章的“配置”部分。 | 关 |
生成警报 | 定义工作流是否生成警报。 | 是 |
间隔(秒) | 运行工作流的重复间隔时间(秒)。 | 43200 |
同步时间 | 使用 24 小时格式指定的同步时间。可以忽略。 |
|
超时(秒) | 指定工作流在关闭之前允许运行的时间,并标记为失败。 | 300 |
数据库连接超时(秒) | 如果在指定期间无法访问数据库,工作流将失败并注册一个事件。 | 15 |
Target | Microsoft.SQLServer.Linux.Database | ||
Parent Monitor | Microsoft.SQLServer.Linux.Rollup.Database.AutomaticConfiguration | ||
Category | ConfigurationHealth | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.Linux.MonitorType.Database.DBConfigurationStatus | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SQLServer.Linux.Monitor.Database.AutoCloseConfiguration" Accessibility="Public" Enabled="false" Target="SqlDiscL!Microsoft.SQLServer.Linux.Database" ParentMonitorID="Microsoft.SQLServer.Linux.Rollup.Database.AutomaticConfiguration" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Linux.MonitorType.Database.DBConfigurationStatus" ConfirmDelivery="false">
<Category>ConfigurationHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Linux.Monitor.Database.AutoCloseConfiguration.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ConfigurationValueOK" MonitorTypeStateID="ConfigurationValueOK" HealthState="Success"/>
<OperationalState ID="ConfigurationValueNotOK" MonitorTypeStateID="ConfigurationValueNotOK" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<DatabaseName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
<ConfigName>AutoClose</ConfigName>
<ExpectedValue>OFF</ExpectedValue>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>43200</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>