Clearing Old Executions

Created by: Kristinn Magnusson

Clearing old executions, in exMon, can help improve performance and increase processing speed. There are many different ways to use exMon, some customers value historic information while others are primarily focused on recent or current information. For those that do not value historic information, deleting older information can improve exMon performance. This will also reduce the storage required for the exMon installation.

Clearing exMon execution data

For most customers, execution data is only relevant for a couple of months. Deleting older executions can greatly reduce the size of your exMon database. However, we recommend only deleting data older than 6 months.

To delete older execution data exMon ships with a stored procedure called usp_maint_cleanup_exec_history with the parameters @number_days_to_keep and @keep_rows_in_history.

  • @number_days_to_keep is an integer value and as the name suggests decides the number of days of data that is kept and is by default set to 180 days
  • @keep_rows_in_history is a bit value that decides if data is stored in a historic table or if data is completely removed. By sending in the value 0 the data is completely removed but by sending in the value 1 the data is kept while still improving exMon performance.

Clearing exMon execution data

You can clear exMon execution data by executing a stored procedure, like this:

exec [dbo].[usp_maint_cleanup_exec_history] @number_days_to_keep ,@keep_rows_in_history

This stored procedure can be executed through the exMon package and scheduled to regularly run. Furthermore, you can clear old exceptions to reduce database size.

Kristinn is the author of this solution article.