October 21, 2010 at 11:42 am
On Sql server 2005 & 2008, we are getting only like 4-5 days worth for Job History Retention.
But we need like 4 weeks of SQL Agent Job History Retention.
I am doing like going SSMS --> SQL Server Agent Properties --> history--> enabling automatically remove agent history older then 4 weeks-> click OK.
again if I open the properties. I don't see the enabled automatically remove agent history older then 4 weeks.
what was the issue? what should I must do set my history for 4 weeks.
October 21, 2010 at 11:45 am
If you only have 4-5 days of history, then you need to increase the # of rows to retain on that same screen.
October 21, 2010 at 11:56 am
Some job have like 4-5 history and some jobs don't have any history. So I want to set up at 4 weeks.
October 21, 2010 at 1:23 pm
@ravz.sqldba, "Automatically remove agent history" option not remaining selected is a BUG which even I can reproduce. However when you select it and click ok, all data older than the selected duration (in your case 4 weeks) is deleted for one time.
Setting up a job which executed SP_PURGE_JOBHISTORY with the relevant parameters is a workaround.
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
November 8, 2010 at 2:05 pm
@ Pradeep: I am not aware of SP_PURGE_JOBHISTORY.
what it will do. Is there any alternate solution of fixing the bug.
November 8, 2010 at 9:40 pm
This article has the syntax for sp_purge_jobhistory. You may create a job which executes a query similar to the one below. This query deletes records older than 10 days.
DECLARE @oldestdate DATETIME
SET @oldest = GETDATE() - 10
EXEC SP_PURGE_JOBHISTORY @oldest_date = @oldestdate
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
December 2, 2014 at 2:13 pm
Does this same stored procedure (msdb.dbo.sp_purge_jobhistory procedure) also clean up SQL Server Reporting Services subscriptions managed by the SQL Server Agent Jobs?
Thank you.
Best Regards,
Mary Anne
June 28, 2016 at 12:35 pm
Thanks Pradeep you are genious.
Thanks
June 28, 2016 at 1:01 pm
Check your maintenance plan. Often times it will contain truncate job and backup history.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply