資料庫備份狀態

Microsoft.SQLServer.2008.Database.DBBackupStatusMonitor (UnitMonitor)

此監視器會檢查 Microsoft® SQL Server™ 所報告的資料庫備份狀態。

Knowledge Base article:

摘要

此監視器會檢查 Microsoft® SQL Server™ 所報告的資料庫備份是否存在及其存在時間。其檢查方式是對 SQL 執行個體的 master 資料庫執行查詢,並傳回該資料庫備份的存在時間。

原因

資料庫太久沒有備份。

解決方式

您應該執行資料庫備份來解決這個問題。

若要避免此問題再次發生,建議您根據應用程式和商務需求排程自動備份。

外部資源

Database Backup Status 監視器沒有邏輯可追蹤資料庫是否為次要複本。

因為 AOG 具有需要包含至少一個資料庫備份的進階備份邏輯,所以此監視器可能會產生誤判警示。

此監視器預設會停用,而且,如果想要為您的環境啟用監視案例,則建議為所有非用於儲存資料庫備份的伺服器,將監視器保持在停用狀態。

外部資源

SQL Server 資料庫備份的最佳作法建議

Element properties:

TargetMicrosoft.SQLServer.2008.Database
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2008.DBBackupStatus
RemotableTrue
AccessibilityPublic
Alert Message
應該執行資料庫備份
位於電腦 '{0}' 上 SQL Server 執行個體 '{1}' 中的資料庫 '{2}' 已經 {3} 天沒有備份過了。
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.Database.DBBackupStatusMonitor" Accessibility="Public" Enabled="false" Target="SQL2008Core!Microsoft.SQLServer.2008.Database" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.DBBackupStatus" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.Database.DBBackupStatusMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</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>
<AlertParameter4>$Data/Context/Property[@Name='$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Good" MonitorTypeStateID="Good" HealthState="Success"/>
<OperationalState ID="Bad" MonitorTypeStateID="Bad" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ConnectionString>$Target/Host/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</ConnectionString>
<DatabaseName>$Target/Property[Type="SQL!Microsoft.SQLServer.Database"]/DatabaseName$</DatabaseName>
<Threshold>7</Threshold>
<IntervalSeconds>86400</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>