SQL Server Agent 作業失敗。SQL Server Agent 負責執行排定在特定時間或間隔執行的 SQL Server 工作,以及偵測系統管理員已定義動作的特定狀況,如透過呼叫或電子郵件向某人發出警示,或解決該狀況的工作。SQL Server Agent 也用於執行系統管理員定義的複寫工作。注意: 根據預設會停用此規則。必要時請使用覆寫加以啟用。
SQL Server Agent 作業失敗。SQL Server Agent 負責執行排定在特定時間或間隔執行的 SQL Server 工作,以及偵測系統管理員已定義動作的特定狀況,如透過呼叫或電子郵件向某人發出警示,或解決該狀況的工作。SQL Server Agent 也用於執行系統管理員定義的複寫工作。
此規則只會偵測具有事件記錄檔通知之作業的作業失敗。若要設定具有事件記錄檔通知的作業,您可以執行下列動作:
執行 SQL Server Management Studio。
展開伺服器群組,然後展開伺服器。
展開 [管理],然後展開 [SQL Server Agent]。
在適當的作業上按一下滑鼠右鍵,然後選擇 [屬性]。
選取 [通知] 區段。
啟用 [寫入 Linux 應用程式事件記錄檔] 核取方塊。
選取 [當作業失敗時] 或 [當作業完成時]。
若要對此失敗進行疑難排解,請檢閱與警示相關聯的事件,以判定失敗的特定作業與作業步驟。同時,也請查看作業的歷程結果,以判定該作業上次運作的日期。若要檢視作業執行歷程記錄,您可以執行下列作業:
執行 SQL Server Management Studio。
展開伺服器群組,然後展開伺服器。
展開 [管理],然後展開 [SQL Server Agent]。
在適當的作業上按一下滑鼠右鍵,然後選擇 [檢視作業記錄]。
另請查看 SQL Server Agent 所使用的服務帳戶,是否為網域使用者群組的成員。LocalSystem 帳戶沒有網路存取權限,因此,若您的工作需要網路上的資源,或是希望透過電子郵件或呼叫器通知操作員,則必須將執行 SQL Server Agent 服務的帳戶,設定為網域使用者群組的成員。
名稱 | 描述 | 預設值 |
已啟用 | 啟用或停用該工作流程。 | 否 |
間隔 (秒) | 每次重複執行工作流程之間的時間間隔 (秒)。 | 300 |
優先順序 | 定義警示優先順序。 | 1 |
Severity | Defines Alert Severity. | 2 |
Synchronization Time | Synchronization Time |
|
Timeout (seconds) | Specifies the time the workflow is allowed to run before being closed and marked as failed. | 200 |
Timeout for database connection (seconds) | The workflow will fail and register an event, if it cannot access the database during the specified period. | 15 |
Target | Microsoft.SQLServer.Linux.Agent | ||
Category | EventCollection | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Remotable | True | ||
Alert Message |
| ||
Comment | Mom2017ID='{8CCE3391-B79E-4182-922E-BB540ED8396E}';MOM2017GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74} |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ | DataSource | Microsoft.SQLServer.Linux.DataSource.EventCollectionFilteredAgent | Default |
GenerateAlert | WriteAction | System.Health.GenerateAlert | Default |
<Rule ID="Microsoft.SQLServer.Linux.CollectionRule.Agent.A_SQL_job_failed_to_complete_successfully_1_5_Rule" Target="SqlDiscL!Microsoft.SQLServer.Linux.Agent" Enabled="false" ConfirmDelivery="true" Remotable="true" Comment="Mom2017ID='{8CCE3391-B79E-4182-922E-BB540ED8396E}';MOM2017GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Microsoft.SQLServer.Linux.DataSource.EventCollectionFilteredAgent">
<MachineName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<EventDisplayNumber>208</EventDisplayNumber>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.Linux.CollectionRule.Agent.A_SQL_job_failed_to_complete_successfully_1_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/Property[@Name='EventID']$. $Data/Property[@Name='Message']$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/Params/Param[1]$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>