Sunday, February 12, 2012

Backup History Purge

I work in a small shop and I noticed this weekend that when SQL performs a
backup it must keep this information somewhere as I found that I have over 3
years of backup history when I restore a database. Can someone explain to
me how to purge this history information?
Thanks,
MattCheck out sp_delete_backuphistory in BooksOnLine. Just be fore warned that
this sp can take a LONG time when there are lots of reow in the table.
Andrew J. Kelly SQL MVP
"Matt Frame" <mdframe@.DONT-SEND-ME-EMAIL.sorvive.com.NO-SPAM> wrote in
message news:u$1qvQBEEHA.3748@.TK2MSFTNGP11.phx.gbl...
> I work in a small shop and I noticed this weekend that when SQL performs a
> backup it must keep this information somewhere as I found that I have over
3
> years of backup history when I restore a database. Can someone explain to
> me how to purge this history information?
> Thanks,
> Matt
>|||-- deletes all backup history for all databases before the date specified
EXEC sp_delete_backuphistory '2002-09-01'
-- deletes all backup history for the db specified
EXEC sp_delete_database_backuphistory 'db_one'
very useful commands. if you do restores from enterprise manager, getting r
id
of the old backuphistory can speed up the time it takes for the initial rest
ore
screen to load.
Matt Frame wrote:

> I work in a small shop and I noticed this weekend that when SQL performs a
> backup it must keep this information somewhere as I found that I have over
3
> years of backup history when I restore a database. Can someone explain to
> me how to purge this history information?
> Thanks,
> Matt

No comments:

Post a Comment