SQL Server 代理作业失败。SQL Server 代理负责运行计划在特定时间或间隔发生的 SQL Server 任务,还负责检测管理员已为其定义了操作(例如通过页面或电子邮件向某人发出警报)或可解决问题的任务的特定情况。SQL Server 代理还用于运行管理员定义的复制任务。注意: 默认情况下,此规则为禁用状态。请根据需要使用替代进行启用。
SQL Server 代理作业失败。SQL Server 代理负责运行计划在特定时间或间隔发生的 SQL Server 任务,还负责检测管理员已为其定义了操作的特定情况(例如通过页面或电子邮件向某人发出警报)或将解决此情况的任务。SQL Server 代理还用于运行管理员定义的复制任务。
此规则只为针对作业失败发送事件日志通知的作业检测失败。要将作业配置为发送事件日志通知,可以执行以下操作:
运行 SQL Server Management Studio。
展开一个服务器组; 然后展开一台服务器。
展开“管理”; 然后展开“SQL Server 代理”。
右键单击适当的作业并选择“属性”。
选择“通知”部分。
选中复选框“写入 Linux 应用程序事件日志”。
选择“当作业失败时”或“当作业完成时”。
要对此失败进行故障排除,请查看与警报相关联的事件,以确定失败的具体作业及作业步骤。同时检查作业的历史输出,以确定作业正常运行的最后日期。要查看作业执行历史记录,可以执行以下操作:
运行 SQL Server Management Studio。
展开一个服务器组; 然后展开一台服务器。
展开“管理”; 然后展开“SQL Server 代理”。
右键单击适当的作业并选择“查看作业历史记录”。
同时检查 SQL Server 代理使用的服务帐户是否为域用户组的成员。LocalSystem 帐户没有网络访问权限,因此在作业需要跨网络的资源,或者需要通过电子邮件或呼叫程序通知操作员时,必须将 SQL Server 代理服务在其下运行的帐户设置为域用户组的成员。
名称 | 说明 | 默认值 |
启用 | 启用或禁用工作流。 | 否 |
间隔(秒) | 运行工作流的重复间隔时间(秒)。 | 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>
<NetbiosComputerName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<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>
<SqlExecTimeoutSeconds>60</SqlExecTimeoutSeconds>
<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>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>Event ID: $Data/Property[@Name='EventID']$. $Data/Property[@Name='Message']$</AlertParameter3>
</AlertParameters>
<Suppression>
<SuppressionValue>$Data/Params/Param[1]$</SuppressionValue>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>