SQL 作業無法順利完成

Microsoft.SQLServer.2008.A_SQL_job_failed_to_complete_successfully_1_5_Rule (Rule)

Knowledge Base article:

摘要

SQL Server Agent 作業失敗。SQL Server Agent 負責執行排定在特定時間或特定間隔要進行的 SQL Server 工作,以及偵測系統管理員已定義動作的特定狀況,例如,透過呼叫或電子郵件向某人發出警示,或解決該狀況的工作。SQL Server Agent 也可用於執行系統管理員所定義的複寫工作。

組態

這個規則只會針對擁有有關作業失敗之事件記錄檔通知的作業來偵測失敗。若要設定具有事件記錄檔通知的作業,您可以執行以下作業:

解決方式

若要排除這項失敗,請檢視與此警示相關聯的事件,以了解失敗的特定作業和作業步驟。另請檢查作業的歷程值,以判斷上次執行作業的日期。若要檢視作業的歷程值,您可以執行下列操作:

另請查看執行 SQL Server Agent 服務的帳戶,是否為 Domain Users 群組的成員。本機系統帳戶沒有網路存取權,因此如果您的作業需要網路上的資源,或是想要透過電子郵件或呼叫器通知操作員,則必須將執行 SQL Server Agent 服務的帳戶設定為 Domain Users 群組的成員。

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

2

Element properties:

TargetMicrosoft.SQLServer.2008.Agent
CategoryEventCollection
EnabledFalse
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
SQL 作業無法順利完成
{0}
Event LogApplication
CommentMom2008ID='{8CCE3391-B79E-4182-922E-BB540ED8396E}';MOM2008GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SQLServer.2008.A_SQL_job_failed_to_complete_successfully_1_5_Rule" Target="SQL2008Core!Microsoft.SQLServer.2008.Agent" Enabled="false" ConfirmDelivery="true" Remotable="true" Comment="Mom2008ID='{8CCE3391-B79E-4182-922E-BB540ED8396E}';MOM2008GroupID={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" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>208</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL!Microsoft.SQLServer.Agent"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Params/Param[3]</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>Failed</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.2008.A_SQL_job_failed_to_complete_successfully_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/Params/Param[1]$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>