October 4, 2019 at 5:42 pm
Hey, I'm trying to figure out why I'm only seeing 4 days of history on my backup job with exec sp_help_jobhistory. I'd like to see 15 days. I use Ola Hollengren's backup and I have my cleanup time set to 168 hours, but I think that is for cleaning up the backup files themselves and is not relevant. I also have an sp_purge_jobhistory job with @CleanupDate = DATEADD(dd,-30,GETDATE()), which should give me 30 days, correct?
Any ideas how to troubleshoot this further?
October 4, 2019 at 5:55 pm
If you right click on the SQL Server Agent and go to History, you can update how long you want to keep job history for. The settings can be set by job history log size, job rows, or number of days/weeks/months.
October 4, 2019 at 6:27 pm
Thanks for the quick response! That looks like the root of the problem, so I've made a change there and I'll be tracking this over the next few days.
October 5, 2019 at 3:47 pm
Please note: there are 2 check boxes on that page:
Limit size of job history log - if this is checked, SQL Server will automatically manage the size of the job history log based on the limits set.
Remove Agent History - if this is checked, SQL Server will run a one-time process to remove job history based on the retention time set. If you look at the History page again this option will no longer be checked.
Personally - I make sure the first one is not checked and then setup a job to manage the agent history. This can be done by calling the specific stored procedure(s) or by using a maintenance plan. In a maintenance plan you would create a separate plan just for history cleanup - with one task which will be the maintenance cleanup task. That task will cleanup agent and maintenance plan history...
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
October 7, 2019 at 2:28 pm
Thanks for the additional information!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply