June 7, 2005 at 2:09 pm
We have backed up the database using maintenance plan for years. The physical backup files are deleted after copied to the tape.
I was auditing the history tables, and found out there are some 2 years data in the msdb..backupfile, backupmediafamily, backupmediaset and backupset tables. Can I execute DELETE command to remove these records without harming the integrity of the msdb database?
Thanks.. Jenny
June 7, 2005 at 2:12 pm
Are you running that much out of space??
June 8, 2005 at 1:55 am
You could try "sp_delete_backuphistory". It's in BOL
June 8, 2005 at 8:43 am
I currently run a job monthly to cleanup the backup history with the following. I schedule the job and add a log just for verification.
Runs under MSDB
set nocount on
PRINT 'Record Count before Cleanup'
select count(*) from backupfile
DECLARE @Oldest_date DateTime
SELECT @oldest_date = (select getdate() -60 as 'datetime')
EXECUTE sp_delete_backuphistory @Oldest_date
PRINT 'Record Count After Cleanup'
select count(*) from backupfile
Deborah Talley
June 17, 2005 at 3:56 pm
Thank a buch!! I got too many old records, it took a long time to delete.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply