sp_purge_jobhistory { [ @job_name = ] 'job_name' [ @job_id = ] job_id } [ , [ @oldest_date = ] oldest_date ]
USE msdb ;
GO
EXEC dbo.sp_purge_jobhistory
@job_id = N'93B30316-FF0E-42C7-80C7-7CBAA98817DB'
GO
or
USE msdb ;
GO
EXEC dbo.sp_purge_jobhistory
@oldest_date = N '2010-07-01'
GO
SELECT COUNT(*) FROM dbo.sysjobhistory
USE msdb
EXEC sp_delete_backuphistory '01/20/98'
USE msdb
select count(*) from backupset with (nolock) where backup_start_date < '2011-01-01'
USE msdb
SELECT [Size in MB] = SUM(IDX.reserved)/128, [Object Name] = OBJ.name FROM msdb.dbo.sysindexes IDX JOIN msdb.dbo.sysobjects OBJ ON OBJ.id = IDX.id WHERE IDX.indid IN (0, 1, 255) GROUP BY IDX.id, OBJ.name ORDER BY 1 DESC
No comments:
Post a Comment