How to delete some parts of a backup file | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

How to delete some parts of a backup file

Hi all, please tell me how I should to do now. My problem is: Every day, I do complete backup at 6am, differential back up at 11am, and transaction backup at 3pm to a backup file. It’s OK. But after one month, I found out that my space of disk is bigger and bigger (I think that the cause is the process of backup). Now I want to delete all backups that are previous the last complete backup. Can you tell me how to do ? Thanks in advance.
? Are you using the maintenance plans to do this? If so, you can just edit them to delete files older than a certain amount of days. To take care of the situation immediately, just sort by creation date and delete them. If you’re using a script to do this, let us know. We need to know how you are naming the backup files if you’re doing it with a script. Also, check out: http://weblogs.sqlteam.com/tarad MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.
quote:Originally posted by derrickleggett ? Are you using the maintenance plans to do this? If so, you can just edit them to delete files older than a certain amount of days. To take care of the situation immediately, just sort by creation date and delete them. If you’re using a script to do this, let us know. We need to know how you are naming the backup files if you’re doing it with a script. Also, check out: http://weblogs.sqlteam.com/tarad MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.

Thanks for your reply.
All types of backup is stored in a backup file, so the back up file is bigger and bigger. Therefore now I have only a backup file in C drive. I just only delete all backups that are previous the last complete backup. Can you tell me how to do?
Thanks
Well, first of all, you should create a new backup file each time instead of storing them all in one file. If you have one problem, you lose the whole set. There’s an option in the maintenance plans to use new files each time. Check that if you are using them. The issue will resolve itself the next time you backup. Just make sure you have a copy of the existing file on tape. If you want to do it manually, then: BACKUP DATABASE databasename
TO DISK = ‘\serversharefolderdatabasename.bak’
WITH INIT –This is the piece that causes the backup to use a brand new file. You can’t delete "all but the last complete backup" from a single backup file that I am aware of. MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.
quote:Originally posted by derrickleggett Well, first of all, you should create a new backup file each time instead of storing them all in one file. If you have one problem, you lose the whole set. There’s an option in the maintenance plans to use new files each time. Check that if you are using them. The issue will resolve itself the next time you backup. Just make sure you have a copy of the existing file on tape. If you want to do it manually, then: BACKUP DATABASE databasename
TO DISK = ‘\serversharefolderdatabasename.bak’
WITH INIT –This is the piece that causes the backup to use a brand new file. You can’t delete "all but the last complete backup" from a single backup file that I am aware of. MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.

Thanks you
But now I have another problem with my system.
I did 100 times compelete backup in a backup file, but now I want to delete first 50 backup times. Can you help me?
Thanks
]]>