MSSQL 2016: 無法將資料庫標記為可疑。sysdatabases.dbid 上的 Getnext NC 掃描失敗

Microsoft.SQLServer.2016.Could_not_mark_database_as_suspect._Getnext_NC_scan_on_sysdatabases.dbid_failed_1_5_Rule (Rule)

SQL Server 復原程序嘗試開啟指定資料庫的可疑旗標,但是在 sysdatabases 中找不到適當的資料列,或是無法更新記憶體中的資料庫資訊。需要將資料庫標記為可疑的原因,應該透過 SQL Server 錯誤記錄檔或事件檢視器中的其他訊息指出。

Knowledge Base article:

摘要

SQL Server 復原程序嘗試開啟指定資料庫有疑問的旗標,但找不到 sysdatabases 中的適當資料列或無法更新記憶體中的資料庫資訊。資料庫應標記為可疑的原因應由 SQL Server 錯誤記錄檔或事件檢視器中的其他訊息所指明。

資料庫會因為許多原因而變成可疑。可能的原因包括作業系統拒絕存取資料庫資源,以及一個或多個資料庫檔案無法使用或損毀。

解決方式

檢閱 SQL Server 錯誤記錄檔與事件記錄檔,找到顯示資料庫應標記為可疑之原因的訊息。然後解決資料庫中所有資料的完整性問題。

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

2

Element properties:

TargetMicrosoft.SQLServer.2016.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID3413
Event Source$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2016: 無法將資料庫標記為可疑。sysdatabases.dbid 上的 Getnext NC 掃描失敗
{0}
Event LogApplication
CommentMom2016ID='{76A35FC2-AABD-412E-A238-649B9DBC235B}';MOM2016GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.Windows.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2016.Could_not_mark_database_as_suspect._Getnext_NC_scan_on_sysdatabases.dbid_failed_1_5_Rule" Target="SQL2016Core!Microsoft.SQLServer.2016.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2016ID='{76A35FC2-AABD-412E-A238-649B9DBC235B}';MOM2016GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>3413</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2016.Could_not_mark_database_as_suspect._Getnext_NC_scan_on_sysdatabases.dbid_failed_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>