Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Altering Maintenance Plans

Author  Topic 

Gyto
Posting Yak Master

144 Posts

Posted - 2011-03-04 : 07:32:06
Hi there,

I have been experimenting with making changes to the Jobs created by Maintenance plans - specifically adding additional steps to them. However, I notice that if you add additional step(s) to a Job and then make changes to the Maintenance Plan that created it, when you save the changes to the Maintenance Plan it will overwrite the existing Jobs with new copies and the step(s) you added manually will be lost.

Does anyone know if there is there a way to avoid this happening?

Thanks,

Matt

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-03-04 : 18:04:26
No way to avoid this - that is the way it works.

Now, if you really need those additional steps then don't schedule the maintenance plan. Create a separate agent job and add a step to execute the maintenance plan and your other steps. Make sure you copy/paste the command line from the maintenance plan job or it won't work. If you just try to schedule the maintenance plan as a normal SSIS package it doesn't work - it requires a command line option to set the disabled flag.

For example, here is an example of the command line from a maintenance plan:

/SQL "Maintenance Plans\My Maintenace" /SERVER MYSERVER /CHECKPOINTING OFF /SET "\Package\Daily Backup.Disable";false /REPORTING E

Jeff
Go to Top of Page

Gyto
Posting Yak Master

144 Posts

Posted - 2011-03-08 : 06:21:13
Thanks Jeff - sounds perfect...nice alternative, cheers.
Go to Top of Page
   

- Advertisement -