HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

SQL Server Job History Disappears After 5 Days

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
afterhistorysqldisappearsserverjobdays

Problem

I feel like this is a silly question but for the life of me, I can't track down what is going on. I have just taken over administration of several servers and on all of them, the job history is being retained for only 5 days. There is a cleanup maintenance plan but it's set for 5 week retention.

EXEC msdb.dbo.sp_syspolicy_purge_history is being run daily however, the History Retention Days is set to 0 so my understanding is that it's not doing anything anyway.

There has to be something really simple I'm missing here. Can anyone point me in the right direction?

Solution

That job has to do with policy-based management, not SQL Server Agent jobs in general. In Object Explorer right-click SQL Server Agent and select Properties, then move to the History tab. What does it say here:

You can adjust those settings so that it keeps more rows overall, more rows per job, and keeps history longer. I am guessing either you have a lot of jobs on this server or these settings have been changed.

Context

StackExchange Database Administrators Q#22478, answer score: 15

Revisions (0)

No revisions yet.