SQL Server delete ond backups

  • I use SQL Server 2005. I make trn backups every 4 hours, diff every day and full backup every 3 days.

    To create this plan i used the maintenance plans. now i would like to delete the old backups before the full backup takes place on Sunday.

    Lets say I have one full backup scheduled on Sunday. So i would like to delete all the other backups including trans, diff and full backups before one week, so that i just have one week backups and the latest full backups that will occur after the cleanup. so any idea.

    I used the maintenance plan cleanup but i do not see the options to delete all the files. I just see the option to delete files that we mention in the extension field. so how to delete .bak. .trn and .diff files any idea will help me to achieve this.

  • In the same Maintenance Plan, create 3 three different clean up tasks (each for .trn, diff, .bak).

    Hope this helps!

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • i don't think that's possible. How can the cleanup task be created three times in a single maintenance plan?

  • Just drag the task into the maintenance plan 3 times. Set the precedence constraints appropriately - and there you go.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Yes, you can put three maintenance tasks in your one maintenance plan. If you double-click on your maintenance plan, you can edit it to add the extra steps to clean-up the other file types. Either copy/paste the existing one (it looks like a process box in the designer) or drag/drop a new "Maintenance Cleanup Task" from the toolbox.

    If this doesn't make sense, let me know and I'll try to explain it better.

    Cindy

  • Don't use the Wizard. Add in each task you need, multiple copies as needed, and set them with precedence constraints.

Viewing 6 posts - 1 through 5 (of 5 total)

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