SQL Server尝试启动代理时崩溃

本文讨论在 SQL Server 实例中创建多个作业时SQL Server代理服务遇到的问题。

原始产品版本:SQL Server
原始 KB 编号: 2795690

症状

SQL Server代理在尝试启动时崩溃,或者启动时间超出预期。 此外,你可能会遇到以下一种或多种方案:

  • 方案 1:系统事件日志中记录了以下错误消息:

    该服务未及时响应启动或控制请求。

  • 方案 2:代理的状态在控制面板显示为“正在启动”,并且以下错误消息记录在SQLAgent.log文件中:

    尚未定义空闲 CPU 条件 - OnIdle 作业计划将不起作用。

    此外,以下条目可能记录在 SQLAgent.log 文件中:

    <Time Stamp> - ? [431] Populating subsystems cache... \
    <Time Stamp> - ? [432] There are 7 subsystems in the subsystems cache \
    <Time Stamp> - ? [124] Subsystem 'ActiveScripting' successfully loaded (maximum concurrency: 40)\
    <Time Stamp> - ? [124] Subsystem 'ANALYSISCOMMAND' successfully loaded (maximum concurrency: 400)\
    <Time Stamp> - ? [124] Subsystem 'ANALYSISQUERY' successfully loaded (maximum concurrency: 400)\
    <Time Stamp> - ? [124] Subsystem 'CmdExec' successfully loaded (maximum concurrency: 40)\
    <Time Stamp> - ? [124] Subsystem 'PowerShell' successfully loaded (maximum concurrency: 2)\
    <Time Stamp> - ? [124] Subsystem 'SSIS' successfully loaded (maximum concurrency: 400)\
    <Time Stamp> - ? [124] Subsystem 'TSQL' successfully loaded (maximum concurrency: 80)\
    <Time Stamp> - ! [364] The Messenger service has not been started - NetSend notifications will not be sent\
    <Time Stamp> - ? [129] SQLSERVERAGENT starting under Windows NT service control\
    <Time Stamp> - + [396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect\
    <Time Stamp> - ? [110] Starting SQLServerAgent Monitor using '' as the notification recipient...\
    <Time Stamp> - ? [146] Request servicer engine started\
    <Time Stamp> - ? [133] Support engine started\
    <Time Stamp> - ? [167] Populating job cache...\
    <Time Stamp> - ? [131] SQLSERVERAGENT service stopping due to a stop request from a user, process, or the OS...\
    <Time Stamp> - ? [134] Support engine stopped\
    <Time Stamp> - ? [197] Alert engine stopped\
    <Time Stamp> - ? [168] There are 4731 job(s) [0 disabled] in the job cache\
    <Time Stamp> - ? [170] Populating alert cache...\
    <Time Stamp> - ? [171] There are 0 alert(s) in the alert cache\
    <Time Stamp> - ? [149] Request servicer engine stopped\
    <Time Stamp> - ? [248] Saving NextRunDate/Times for all updated job schedules...\
    <Time Stamp> - ? [249] 0 job schedule(s) saved\
    <Time Stamp> - ? [127] Waiting for subsystems to finish...\
    <Time Stamp> - ? [128] Subsystem 'ActiveScripting' stopped (exit code 1)\
    <Time Stamp> - ? [128] Subsystem 'ANALYSISCOMMAND' stopped (exit code 1)\
    <Time Stamp> - ? [128] Subsystem 'ANALYSISQUERY' stopped (exit code 1)\
    <Time Stamp> - ? [128] Subsystem 'CmdExec' stopped (exit code 1)\
    <Time Stamp> - ? [128] Subsystem 'PowerShell' stopped (exit code 1)\
    <Time Stamp> - ? [128] Subsystem 'SSIS' stopped (exit code 1)\
    <Time Stamp> - ? [175] Job scheduler engine stopped\
    
  • 方案 3:数据库引擎服务器显示来自“SQLAgent - 泛型刷新器”服务 (SPID) 的SQL Server进程 ID。 此外,以下作业显示为在 SPID 的输入缓冲区中运行:

EXECUTE msdb.dbo.sp_sqlagent_refresh_job

注意

SPID 处于 RUNNABLE 状态,并定期等待 PREEMPTIVE_OS_LOOKUPACCOUNTSID 等待类型,或者 SPID 处于等待类型等待状态 ASYNC_NETWORK_IO

原因

出现此问题的原因是SQL Server中有多个作业条目。

注意

如果在Reporting Services Configuration Manager中无意中为报表设置了多个订阅,也可能会出现此问题。

解决方法

若要解决此问题,请删除不需要的作业。

注意

如果由于无意中设置了许多订阅而存在许多作业条目,请使用 Reporting Services Configuration Manager 删除不必要的订阅。

更多信息