Running on-prem MSSQL 2017 ENT and the SQL Agent job history stopped logging and no ideas why. Applied all below recovery steps and still no success.
Maximum job history log size (in rows) = 999999
Maximum job history rows per job = 49999
MSDB ample free space
Any ideas what it could be?
Can you just confirm if this setting has been modified?
Remove agent history
Yes. All bulleted items implemented
In SQL Server Agent Properties - under the History tab:
o Limit size of job history log
This setting will limit the size of the history log - and once those limits are reached will delete previous data. If you are using this and you have jobs that run every minute - this limit will be reached by that job causing any other jobs that are run once a day/week/month to be purged.
o Remove agent history
This option is not actually a setting - it is a one time run set to the values the purges the history log to that point. It does not manage the history log at all...
On my systems - I uncheck (disable) the first setting and create a job that manually purges the history based on the second option. That is - I have a job that runs every day that purges the history log. This process determines the frequency of the job and purges data based on that schedule.
For example - jobs that run every minute will be purged after 7 days, every 5 minutes will be purged after 14 days, every 10 minutes will be purged after 21 days and every 15 minutes will be purged after 30 days. All other jobs will be purged after 6 months...
I also have a job that purges sub plan history...with the same limits.