Clearing exMon executions

Created by: Kristinn Magnusson

In this article, you will read about clearing exMon executions. There are many different ways to use exMon to view both historic and current information. If you do not wish to view historic data in exMon, you can improve both performance and storage by deleting old information.

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 and increase the speed 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. By default, this is 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.

Clear exMon execution data by executing the 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. You can click here to read more about clearing old exceptions to reduce database size.

Kristinn is the author of this solution article.