Maintenance Plan Job Failed.
Applies to: Microsoft SQL Server 2005 Developer Edition SP4.
Problem Description.
We had a maintenance plan running successfully on a server for months, and
all of a sudden it started to fail. The maintenance plan was created to schedule
a rebuild of indexes and update statistics.
On examining the history of the maintenance plan job, we found it failed while
rebuilding indexes as shown below.
The job outcome was the following:
Date 4/10/2012 10:51:21 AM
Log Job History (MaintenancePlan - Monday.Monday)
Step ID 0
Server SERVERDB
Job Name MaintenancePlan - Monday.Monday
Step Name (Job outcome)
Duration 00:05:34
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
The job failed. The Job was invoked by User Domain\user. The last step to run
was step 1 (Monday).
The outcome of step 1 was the following:
Date 4/10/2012 10:51:21 AM
Log Job History (MaintenancePlan - Monday.Monday)
Step ID 1
Server SERVERDB
Job Name MaintenancePlan - Monday.Monday
Step Name Monday
Duration 00:05:34
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: DOMAIN\windowsaccount. ...12-04-10 10:51:52.17 Source: Rebuild
Index Task Executing query "USE [database] ".: 10% complete End Progress
Progress: 2012-04-10 10:51:52.86 Source: Rebuild Index Task Executing query
"ALTER INDEX [PK_AssetInventoryItem_1] ON [dbo].[As".: 11% complete End Progress
Progress: 2012-04-10 10:51:52.86 Source: Rebuild Index Task Executing query "USE
[database] ".: 11% complete End Progress Progress: 2012-04-10 10:51:52.86
Source: Rebuild Index Task Executing query "ALTER INDEX [AssetLicenseOverride_UniqueKey]
ON [d".: 11% complete End Progress Progress: 2012-04-10 10:51:52.86 Source:
Rebuild Index Task Executing query "USE [database] ".: 11% complete End Progress
Progress: 2012-04-10 10:51:52.87 Source: Rebuild Index Task Executing query
"ALTER INDEX [IX_AssetRecord] ON [dbo].[AssetRecord".: 12% complete End Progress
Progress: 2012-04-10 10:51:52.87 ... The package execution fa... The step
failed.
Cause.
The maintenance plan job started to fail after a database was put offline. We
modified the maintenance plan to not include that database but the job kept
failing.
Workaround.
Put the database online again or detach it, and the job will execute
successfully.