Maintenance :- Job History (sp_delete_backuphistory)

/*
Recently for one of my client I found that his backuphistory table has become very large. Since SQL Server do not clear backupjob history we need to clear it regular interval
*/



sp_delete_backuphistory
EXEC sp_delete_backuphistory @oldestdate
It will delete backup history for date before @oldestdate

sp_delete_database_backuphistory
EXEC sp_delete_database_backuphistory @dbname
Will delete history for specified database

sp_help_jobhistory

Provides information for jobhistory
EXEC sp_help_jobhistory @job_name = 'Expired subscription clean up'
It accepts many other parameters. More info you can find from Books Online for this.

No comments:

Post a Comment

Amazon Contextual Product Ads

Popular Posts