When batch jobs execute, their execution history is stored in the batch job history. This helps in monitoring and validating proper running of (recurring) batch jobs, their execution time and possible logs. However, with a lot of recurring batch jobs, especially those with a high recurrence, will generate a lot of batch job history entries. In addition to keeping the history notes clean and relevant, this feature also provides performance enhancements by eliminating the negative performance impact of having a large volume of entries in history tables, if left unmonitored for long periods of time.
Functionality to clean up the history of batch jobs was available in Dynamics AX 2012 and has now been re-introduced in Dynamics 365 for Finance and Operations. It is available in, and from, platform update 9. Before Platform update 9, you needed to delete the history on a job-by-job basis, which required extra time to cover all the wanted jobs.
Two new forms have been added to the System Administration workspace:
- Batch job history clean-up
- Batch job history clean-up (custom)
Regular versus custom batch job history clean-up options
The regular version of batch job history clean-up allows you to quickly clean all history entries older than a specified timeframe (in days). Any entry that was created prior to – will be deleted from the BatchJobHistorytable, as well as from linked tables with related records (BatchHistory and BatchConstraintsHistory). This form has improved performance optimization because it doesn’t have to execute any filtering.
The custom batch job clean-up form should be used only when specific entries need to be deleted. This form allows you to clean up selected types of batch job history records, based on criteria such as status, job description, company, or user. Other criteria can be added using the Filter button.