Solved

Cannot delete or run SQL Maintenance Plans from SQL Management Studio

Posted on 2008-10-14
11
1,383 Views
Last Modified: 2012-05-05
I hope this is somewhat clear. Recent deployment of SQL Server 2008 Standard on a Windows 2003 Server. All mandatory service packs and hotfixes have been applied.

I have 2 issues:

1.      Deleting the initial maintenance plan that was created via the wizard from SSMS to backup the databases.

The error message is:

Exception has been thrown by the target of an invocation. (mscorlib)

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

Ive seen where some can overcome this by deleting the faulty plan id record in the sysmaintplan_subplans, sysmaintplan_log and the sysdtspackages tables. These tables are empty.

Subsequent maintenance plans can be created and deleted. However the original maintenance plan remains and the job cannot be deleted once a second Maintenance Plan is deleted. The job is displayed under SQL Server Agent | Jobs. If you attempt to delete the job from SSMS, a message is displayed that the job does not exist.

2.      Any Maintenance Plan created fails to execute successfully.

The error message is:

Execution failed. See the maintenance plan and SQL Server Agent job history logs for details.

Additional information:
      Job jobname.Subplan_1 failed (SqlManagerUI)

The job history log only states the job failed and the last step to run was step 1 (subplan_1).

This message occurs for any Maintenance Plan job defined.

Any guidance would be appreciated. Thank you.
0
Comment
Question by:DrewBryant1961
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 1

Expert Comment

by:Soccerman55
Comment Utility
This was the solution in SQL 2005, I would assume it would be pretty close to the same for SQL 2008

Execute these in the MSDB database
SELECT * FROM sysdtspackages90 (to get the Plan_ID of the Bad Plan)
DELETE FROM sysmaintplan_log WHERE plan_id = BadPlanID
DELETE FROM sysmaintplan_subplans WHERE plan_id = BadPlanID
DELETE FROM sysdtspackages90 WHERE plan_id = BadPlanID

After doing this, the plan goes away by itself, and the associated job can be deleted w/o error.
0
 

Author Comment

by:DrewBryant1961
Comment Utility
Thanks for your reply. I saw that, however there is not a sysdtspackages90 table. I removed the entry in the sysdtspackages table. The other sysmaintplan tables have nothing in them.

The job went away although the original maintenance plan remains and cannot be deleted.

Any new maintenance plans created from the wizard will not execute successfully although new plans can be created and deleted.

0
 
LVL 1

Expert Comment

by:radersolutions
Comment Utility
I'm having the same issue #2 here, on Server 2008 x64 with SQL 2008. Any ideas?
0
 
LVL 51

Expert Comment

by:Mark Wills
Comment Utility
Have you looked through the sysjobs tables ?
0
 
LVL 1

Expert Comment

by:radersolutions
Comment Utility
I just took a look, and didn't see anything useful. The jobs that were created by log shipping work fine, but the maintanance plan jobs fail every time. The only text available says that they failed, with no reason.
I get lines like this:
The job failed.  The Job was invoked by User MYDOMAIN\Administrator.  The last step to run was step 1 (backup_all_DBs).
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Accepted Solution

by:
radersolutions earned 500 total points
Comment Utility
I did some more googling, and I've figured it out:

I wasn't aware that SQL Server Integration Services was required for Maintanance Plans to work. Installed SSIS, and then they started working.

thanks!
0
 
LVL 51

Expert Comment

by:Mark Wills
Comment Utility
About to suggest exactly that - well, first to see if 2005 was still installed, then uninstall (via control panel) and re-install SSIS for 2008 / VS...

Beat me by seconds... Was typing up when your e-mail notice came in.
0
 
LVL 1

Expert Comment

by:radersolutions
Comment Utility
hehe.. Thanks for your help though. Your first comment got me to thinking that there was definitely something missing based on the fact that the error messages didn't have any real "errors" in them, like something was missing.

This is a fresh installation of 2008, no 2005 pre-existing.
0
 
LVL 51

Expert Comment

by:Mark Wills
Comment Utility
Pleased you are OK, but what about : DrewBryant1961 ?
0
 

Author Comment

by:DrewBryant1961
Comment Utility
Installed SQL Server Integration Services and new maintenance plans run fine.

The original plan will not run and cannot be deleted. I get the same exception error listed in issue 1 above.

This was a new install of SQL 2008 and I, too, wasn't aware that SQL Server Integration Services was required for Maintenance Plans to work.

Thanks for your replies.
0
 

Author Closing Comment

by:DrewBryant1961
Comment Utility
Thanks for your help.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now