Skip to content

Commit a66a429

Browse files
authored
Re-write many sections as they refer to older product vesions
1 parent 3f8b31e commit a66a429

1 file changed

Lines changed: 52 additions & 48 deletions

File tree

support/sql/database-engine/startup-shutdown/sql-server-agent-crashes-upon-start.md

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.reviewer: ramakoni1, v-jayaramanp, v-shaywood
66
ms.custom: sap:Startup, shutdown, restart issues (instance or database)
77
---
88

9-
# SQL Server Agent stops responding when you try to start it
9+
# SQL Server Agent shuts down unexpectedly when you try to start it
1010

1111
This article provides troubleshooting guidance for an issue in which the SQL Server Agent service stops responding or takes longer than you expect when you try to start it. Many different underlying problems can cause this issue. This article covers some of the most common scenarios.
1212

@@ -15,7 +15,7 @@ _Original KB number:_   2795690
1515

1616
## Symptoms
1717

18-
A SQL Server Agent stops responding when you try to start it, or it takes longer than you expect to start. Additionally, you might experience one or both of the following scenarios:
18+
A SQL Server Agent fails when you try to start it, or it takes longer than you expect to start. Additionally, you might experience one or both of the following scenarios:
1919

2020
- **Scenario 1**: The following error message is logged in the System event log:
2121
> The SQL Server Agent (MSSQLSERVER) service failed to start due to the following error:
@@ -26,63 +26,67 @@ A SQL Server Agent stops responding when you try to start it, or it takes longer
2626
Additionally, the following entries might be logged in the *SQLAgent.log* file:
2727

2828
```output
29-
<Time Stamp> - ? [431] Populating subsystems cache... \
30-
<Time Stamp> - ? [432] There are 7 subsystems in the subsystems cache \
31-
<Time Stamp> - ? [124] Subsystem 'ActiveScripting' successfully loaded (maximum concurrency: 40)\
32-
<Time Stamp> - ? [124] Subsystem 'ANALYSISCOMMAND' successfully loaded (maximum concurrency: 400)\
33-
<Time Stamp> - ? [124] Subsystem 'ANALYSISQUERY' successfully loaded (maximum concurrency: 400)\
34-
<Time Stamp> - ? [124] Subsystem 'CmdExec' successfully loaded (maximum concurrency: 40)\
35-
<Time Stamp> - ? [124] Subsystem 'PowerShell' successfully loaded (maximum concurrency: 2)\
36-
<Time Stamp> - ? [124] Subsystem 'SSIS' successfully loaded (maximum concurrency: 400)\
37-
<Time Stamp> - ? [124] Subsystem 'TSQL' successfully loaded (maximum concurrency: 80)\
38-
<Time Stamp> - ! [364] The Messenger service has not been started - NetSend notifications will not be sent\
39-
<Time Stamp> - ? [129] SQLSERVERAGENT starting under Windows NT service control\
40-
<Time Stamp> - + [396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect\
41-
<Time Stamp> - ? [110] Starting SQLServerAgent Monitor using '' as the notification recipient...\
42-
<Time Stamp> - ? [146] Request servicer engine started\
43-
<Time Stamp> - ? [133] Support engine started\
44-
<Time Stamp> - ? [167] Populating job cache...\
45-
<Time Stamp> - ? [131] SQLSERVER service stopping due to a stop request from a user, process, or the OS...\
46-
<Time Stamp> - ? [134] Support engine stopped\
47-
<Time Stamp> - ? [197] Alert engine stopped\
48-
<Time Stamp> - ? [168] There are 4731 job(s) [0 disabled] in the job cache\
49-
<Time Stamp> - ? [170] Populating alert cache...\
50-
<Time Stamp> - ? [171] There are 0 alert(s) in the alert cache\
51-
<Time Stamp> - ? [149] Request servicer engine stopped\
52-
<Time Stamp> - ? [248] Saving NextRunDate/Times for all updated job schedules...\
53-
<Time Stamp> - ? [249] 0 job schedule(s) saved\
54-
<Time Stamp> - ? [127] Waiting for subsystems to finish...\
55-
<Time Stamp> - ? [128] Subsystem 'ActiveScripting' stopped (exit code 1)\
56-
<Time Stamp> - ? [128] Subsystem 'ANALYSISCOMMAND' stopped (exit code 1)\
57-
<Time Stamp> - ? [128] Subsystem 'ANALYSISQUERY' stopped (exit code 1)\
58-
<Time Stamp> - ? [128] Subsystem 'CmdExec' stopped (exit code 1)\
59-
<Time Stamp> - ? [128] Subsystem 'PowerShell' stopped (exit code 1)\
60-
<Time Stamp> - ? [128] Subsystem 'SSIS' stopped (exit code 1)\
61-
<Time Stamp> - ? [175] Job scheduler engine stopped\
29+
<Time Stamp> - ? [431] Populating subsystems cache...
30+
<Time Stamp> - ? [432] There are 7 subsystems in the subsystems cache
31+
<Time Stamp> - ? [124] Subsystem 'ActiveScripting' successfully loaded (maximum concurrency: 40)
32+
<Time Stamp> - ? [124] Subsystem 'ANALYSISCOMMAND' successfully loaded (maximum concurrency: 400)
33+
<Time Stamp> - ? [124] Subsystem 'ANALYSISQUERY' successfully loaded (maximum concurrency: 400)
34+
<Time Stamp> - ? [124] Subsystem 'CmdExec' successfully loaded (maximum concurrency: 40)
35+
<Time Stamp> - ? [124] Subsystem 'PowerShell' successfully loaded (maximum concurrency: 2)
36+
<Time Stamp> - ? [124] Subsystem 'SSIS' successfully loaded (maximum concurrency: 400)
37+
<Time Stamp> - ? [124] Subsystem 'TSQL' successfully loaded (maximum concurrency: 80)
38+
<Time Stamp> - ! [364] The Messenger service has not been started - NetSend notifications will not be sent
39+
<Time Stamp> - ? [129] SQLSERVERAGENT starting under Windows NT service control
40+
<Time Stamp> - + [396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect
41+
<Time Stamp> - ? [110] Starting SQLServerAgent Monitor using '' as the notification recipient...
42+
<Time Stamp> - ? [146] Request servicer engine started
43+
<Time Stamp> - ? [133] Support engine started
44+
<Time Stamp> - ? [167] Populating job cache...
45+
<Time Stamp> - ? [131] SQLSERVER service stopping due to a stop request from a user, process, or the OS...
46+
<Time Stamp> - ? [134] Support engine stopped
47+
<Time Stamp> - ? [197] Alert engine stopped
48+
<Time Stamp> - ? [168] There are 4731 job(s) [0 disabled] in the job cache
49+
<Time Stamp> - ? [170] Populating alert cache...
50+
<Time Stamp> - ? [171] There are 0 alert(s) in the alert cache
51+
<Time Stamp> - ? [149] Request servicer engine stopped
52+
<Time Stamp> - ? [248] Saving NextRunDate/Times for all updated job schedules...
53+
<Time Stamp> - ? [249] 0 job schedule(s) saved
54+
<Time Stamp> - ? [127] Waiting for subsystems to finish...
55+
<Time Stamp> - ? [128] Subsystem 'ActiveScripting' stopped (exit code 1)
56+
<Time Stamp> - ? [128] Subsystem 'ANALYSISCOMMAND' stopped (exit code 1)
57+
<Time Stamp> - ? [128] Subsystem 'ANALYSISQUERY' stopped (exit code 1)
58+
<Time Stamp> - ? [128] Subsystem 'CmdExec' stopped (exit code 1)
59+
<Time Stamp> - ? [128] Subsystem 'PowerShell' stopped (exit code 1)
60+
<Time Stamp> - ? [128] Subsystem 'SSIS' stopped (exit code 1)
61+
<Time Stamp> - ? [175] Job scheduler engine stopped
6262
```
6363

64-
- **Scenario 3**: The database engine server displays a SQL Server process ID (SPID) from the "SQLAgent - Generic Refresher" service. Additionally, the following job is displayed as running in the input buffer of the SPID:
64+
- **Scenario 3**: The database engine displays a session_id from the "SQLAgent - Generic Refresher" service and the following job is displayed as query text running in for that session: `EXECUTE msdb.dbo.sp_sqlagent_refresh_job`
65+
66+
You can use the following query to check for such session and text
6567

6668
```sql
67-
EXECUTE msdb.dbo.sp_sqlagent_refresh_job
69+
SELECT s.session_id, r.status, r.wait_type, r.wait_time, s.program_name, t.text
70+
FROM sys.dm_exec_requests AS r
71+
RIGHT JOIN sys.dm_exec_sessions s
72+
ON r.session_id = s.session_id
73+
OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) t
74+
WHERE s.program_name = 'SQLAgent - Generic Refresher'
6875
```
6976

70-
> [!NOTE]
71-
> When this issue occurs, the SPID is in the RUNNABLE state, and regularly waits for the `PREEMPTIVE_OS_LOOKUPACCOUNTSID` wait type. Or, the SPID is in a waiting state for the `ASYNC_NETWORK_IO` wait type.
77+
When this issue occurs, the session is in a RUNNABLE state, and regularly waits for the `PREEMPTIVE_OS_LOOKUPACCOUNTSID` wait type. Or, the session is in a waiting state for the `ASYNC_NETWORK_IO` wait type.
7278

7379
## Cause 1: Multiple job entries
7480

75-
This issue can occur if multiple job entries exist in SQL Server.
81+
This issue can occur if a large number of jobs have been configured in SQL Server Agent and with many schedules. This can trigger the Generic refresher task to be continuously activated and thus busy.
7682

77-
> [!NOTE]
78-
> The issue can also occur if you unintentionally set up multiple subscriptions for your reports in the Reporting Services Configuration Manager.
83+
For example, the issue can also occur if you unintentionally set up multiple subscriptions for your reports in the SQL Server Reporting Services Configuration Manager.
7984

8085
### Workaround
8186

8287
To work around this issue, delete the jobs that you don't need.
8388

84-
> [!NOTE]
85-
> If there are many job entries because you unintentionally set up many subscriptions, delete the unnecessary subscriptions by using Reporting Services Configuration Manager.
89+
If there are many job entries because you unintentionally set up many subscriptions, delete the unnecessary subscriptions by using Reporting Services Configuration Manager.
8690

8791
## Cause 2: ODBC driver missing or corrupted
8892

@@ -92,7 +96,7 @@ For information about the ODBC driver requirements for different versions of SQL
9296

9397
### Solution
9498

95-
1. To verify that the ODBC driver is missing, run one of the following commands in an elevated Command Prompt window or PowerShell:
99+
1. To check if the SQL Server ODBC driver is missing, run one of the following commands in an elevated Command Prompt window or PowerShell:
96100
1. Command prompt:
97101

98102
```cli
@@ -135,11 +139,11 @@ For information about the ODBC driver requirements for different versions of SQL
135139
Attribute : {Driver, APILevel, FileExtns, FileUsage...}
136140
```
137141
138-
If the ODBC driver isn't listed in the output of the `Get-OdbcDriver` command, then the driver is missing.
142+
If the SQL Server ODBC driver isn't listed in the output of the `Get-OdbcDriver` command, then the driver is missing.
139143
140-
1. Verify that the ODBC driver for SQL Server is missing. <!-- Need to verify with SME what the user should look for to verify the driver is missing -->
144+
1. Check if the ODBC driver for SQL Server is present
141145
1. If the driver is missing, go to the next step.
142-
1. If the driver isn't missing, see [Cause 1](#cause-1-multiple-job-entries).
146+
1. If the driver is missing, go to [ODBC driver is missing](#sql-server-odbc-driver-is-missing)
143147
1. [Download the ODBC Driver for SQL Server](/sql/connect/odbc/download-odbc-driver-for-sql-server).
144148
1. Install the driver by using the GUI or a silent installation.
145149
1. To perform a silent installation, run the following command:

0 commit comments

Comments
 (0)