I am facing an issue where my
msdb.dbo.sysjobhistory data is getting deleted whenever my SQL Server services are restarted or the instance fails over.
I am using SQL Server 2014 SP2 in a cluster environment, with below SQL Agent History setting:
Can anyone please suggest what the issue is?
My response is based on possible reasons of problem.
Make sure you have configured History setting properly and the job to purge history scheduled properly. To validate these settings:
Right click on SQL Server Agent and got to Properties.
Go to History tab.
Make sure setting is configured properly.
The job named syspolicy_purge_history used to execute above settings.
So right click on the job in Jobs folder in SQL Server Agent and check Schedule of the Job.
It should be scheduled according to your requirement.