Deleting .bak files

  • Greetings. I am using SQL Server 2008 R2 Express. I want to delete some old backup files, but I am not exactly sure how to do it. I should preface this by letting you know I am an analyst, not an administrator, so I usually keep scads of data for a current project only so I don't lose it if my laptop crashes for whatever reason, not because I am supporting production databases. However, once I have made delivery of the data to the customer, I do not need to keep the tables, or any of the backups of it. Can I simply navigate the the backups folder and delete the .bak files? I am hesitant because there might be problems when SQL Server starts, and does not find the file it knows was there yesterday. Thank you.

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • Sure can! As you said, just delete the .bak files you don't need, SQL Server won't care. Just be sure you don't need them for recovery purposes before deleting.

    ______________________________________________________________________________________________
    Forum posting etiquette.[/url] Get your answers faster.

  • You are free to delete .bak files as you please. They are not involved the actual running of SQL Server itself and wont prevent it starting up.

    I would suggest you create and schedule a maintenace plan in SQL Server Management Studio. You will be able to add a single step (or multiple if you want to automate nightly backups) to clean up back up files after x hours/days/weeks/months. There is also a setting for it to traverse subfolders if you have an organisation system going.

  • calvo (10/27/2011)


    Sure can!

    MysteryJimbo (10/27/2011)


    You are free to delete .bak files as you please.

    Thanks to both of you for such a quick response. In searching BOL for an answer, I quickly realized there is much opportunity for me to learn about maintanence plans.

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

  • Greg Snidow (10/27/2011)


    Thanks to both of you for such a quick response. In searching BOL for an answer, I quickly realized there is much opportunity for me to learn about maintanence plans.

    No problem. Glad to help!

  • Greg Snidow - Thursday, October 27, 2011 6:11 AM

    Greetings. I am using SQL Server 2008 R2 Express. I want to delete some old backup files, but I am not exactly sure how to do it. I should preface this by letting you know I am an analyst, not an administrator, so I usually keep scads of data for a current project only so I don't lose it if my laptop crashes for whatever reason, not because I am supporting production databases. However, once I have made delivery of the data to the customer, I do not need to keep the tables, or any of the backups of it. Can I simply navigate the the backups folder and delete the .bak files? I am hesitant because there might be problems when SQL Server starts, and does not find the file it knows was there yesterday. Thank you.

  • There are no maintenance plans in EXPRESS just as there is no SQL Agent to run/schedule them.  You can use Windows Task Scheduler to run a custom script, .cmd or .bat file to do whatever you need though.

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

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