Working Around 2005 Maintenance Plans

  • Comments posted to this topic are about the content posted at

  • Hi,

    I might have missd something, but couldn't you just use a Maintenance Cleanup Task to delete old backups? That's how we have it set up here, and it seems to do the trick. As I recall, you aren't offered one of these in the wizard, but you can drag them into your maintenance plan from the toolbox.

  • That is a very good point which I had neglected to mention! You read an article a thousand times thinking you've addressed everything...

    In our situation we wanted to stick with an existing departmental guideline which puts each backup into its own subdirectory. While it seems inconsequential there are certain rules and precedents on the server which rely upon this setup. In my experimentation I couldn't get the maintenance cleanup task to traverse subdirectories properly by pointing to the parent directory (unless I was willing to create a new task for each subdirectory).

  • Ain't it always the way 🙂

    Yes, the lack of support for cleaning a directory tree is a strange omission. I believe we ended up writing a tool to generate the package automatically. There are a few questionable aspects of the interface, as I recall.

    Very slightly off topic, but what is the point of naming schedules for the maintenance tasks? Now if I could selected an already created schedule for a different task,... Doubtless I've missed something obvious though!

  • Yes, I originally was playing around with using vb or perl to clean up the backup files, however I ended up wanting to try to keep everything inside SQL. The other thing was that if the traditional maintenance plans failed the logs were woefully inadequate. With this type of framework you can use more standard error trapping and log those using RAISERROR or offload them to a table if you so desire.

    I don't know if I understand your last question. If you're asking about re-using schedules for different jobs you can do so via the GUI by clicking the "Pick..." button on the Schedules page in your job or by using msdb.dbo.sp_attach_schedule if you're scripting things out. Schedules can be found listed in msdb.dbo.sysschedules.

  • Ah, I'd not noticed it there - I'd been looking at it from the maintenance plan editor, where you don't appear to be able to select, only create

  • We came across several postings in Forums about Maintenaceplan cleanup task not deleting the backup files if backups of databases were created under separate folders. This helped us take immediate action to address it in our service pack(SP).

    This issue is now addressed in Service Pack 1. The private beta of SP1 is released and public beta release of SP1 is expected to be sometime this month.

    Thanks for all your feedback and we hear and value every feedback we get!

    Gops Dwarak, Program Manager, SQL Server Tools Team, Microsoft

  • That's great news to hear! Thank you very much for being so responsive to the community. I knew that there would be an official solution from MS dwn the line, but I didn't know it would come so quickly.

  • My particular backup problem is that when I do a full backup on some transaction-heavy databases that have their recovery models set to Full, the first hourly transaction log - .trn file - after the full backup is almost the same size as the .bak file. 

    Subsequent hourly .trn files are nice and small.

    I wanted all the .trn files to be small, to conserve drive space, so I tried setting the recovery models to bulk_logged, then do the .trn backup, then setting the recovery models back to Full, but this three-step approach seems to either take forever, or fail.

    Any ideas would be appreciated.

     Thanks, Mike



  • I cannot download the code:


    Search for any content tagged Administration & workingaround2005maintenanceplans & 2282 & bch_article_work_v2.txt

    Sorry, nothing found for this search


  • Hi, I also cannot download the code:


    Search for any content tagged Administration & workingaround2005maintenanceplans & 2282 & bch_article_work_v2.txt

    Sorry, nothing found for this search


    Is there another place we can find it?


  • This was removed by the editor as SPAM

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply