Skip to main content

Purging Production Data

The Purge Management Data page allows you to delete outdated entries from the Event Log, message warehouse, business process log, business rule log, and I/O archive log. You can only purge entries associated with the active namespace. To navigate to this page, click Ensemble > Manage > Purge Management Data.

This chapter contains the following topics:

First-time Purges

The activity of purging generates extra journaling, especially if you purge a large volume of data, and this journaling can consume a large amount of disk space. For performance reasons, you might adopt the following approach when you first purge management data:

  1. Start by setting the purge parameters so that a relatively small amount of data is purged.

    As discussed in the next section you use the option Do not purge most recent to specify how many days’ worth of records to keep. Set this to a relatively large number.

  2. Perform the purge.

  3. Gradually decrease the number of days of data to keep until Do not purge most recent is set as desired.

Purging Data Manually

Typically you purge data manually during development and testing. (In contrast, for a live system, you typically purge data on a periodic basis, as described in the next section.)

To purge data manually, use the Purge Management Data page. This page displays the following information:

  • Type of Record — Identifies the purpose of each row in the table. Each row contains one type of artifact that running productions produce on an ongoing basis: Event Log, Messages, Business Processes, Business Rule Log, I/O Log, or Managed Alerts.

  • Count — Total number of entries of this type stored for this production. Use the Count to decide whether or not it is worthwhile to purge the records and if so, how many days’ worth of records you want to keep.

  • Delete — Total number of entries of this type that the purge process deleted after you click Start Purge and the purge completes.

Purge Criteria

Beneath the table is a box to enter your purge criteria and the command to perform the purge.

  • Include message bodies — If selected, this check box indicates that when Ensemble purges message headers, it should also purge the associated message bodies. Ensemble verifies that body classes exist and are persistent, before purging them.

    If this check box is clear (the default), message header data is purged, but message body data is retained. If you purge message headers but retain the message bodies, then the Management Portal provides no way to purge the orphaned message bodies. In this case, you must purge the message bodies programmatically. In the ENSDEMO database, the class Demo.Util.CleanupSetOpens in a new tab provides an example of how you might do this.


    When Ensemble purges a message body, it does not necessarily delete object-valued properties of the message body. Specifically, it deletes other objects only if these are serial objects or are child objects (as defined by a relationship). For other objects, you must appropriately handle the deletion by defining a delete trigger or implementing the %OnDelete() method in the message body class.

  • Keep data integrity — If selected (the default) this check box indicates that when Ensemble purges message headers, even if a message meets the age criterion for purging, it is not deleted unless its status is complete. Ensemble considers messages to be complete if they are marked Complete, Error, Aborted, or Discarded. This is to keep session-level integrity.

    The query that identifies the messages to delete checks all the messages (including business process instances) in a session to see whether any of them are not complete. The purge only performs the delete if all the messages are complete. The scope of this query, therefore, has an impact on the time taken to do the purge.

    This option is important to support long-running business processes. Usually this is the desired behavior. However, if you know there are old messages in the system whose incomplete status is not significant, you can purge them by clearing the Keep data integrity check box.


    The purge criteria for using Keep data integrity also includes Ensemble system processes such as the Scheduler. Before clearing this check box, carefully consider the value for the Do not purge most recent setting.

  • Do not purge most recent — This tells Ensemble how many days’ worth of records to keep. The number can be 0 (zero), which keeps nothing and deletes all entries that exist at the time of the purge operation. The default value for Do not purge most recent is 7, which keeps entries for the last seven days.

    The count of days includes today, so keeping messages for 1 day keeps the messages generated on the current day, according to local server time.

At the bottom of the Purge Criteria box is the Start Purge command. If you click it, Ensemble immediately purges the persistent store according to the parameters you have entered. The page uses a background job to do purges, and reports the results of the last-run purge, including a status code, or a notice if the background job is running or has failed to run. When the purge completes, the Deleted column contains the number of records purged for each type. If a purge is currently executing in the namespace, the Start Purge command is inactive.


You cannot undo the Start Purge operation.

Purging Data Periodically

For a live system, you typically purge data on a periodic basis. To do so

  1. Click System Operation, click Task Manager, and then click New Task.

  2. For Task name, enter a task name.

  3. For Namespace to run task in, select the applicable namespace.

  4. For Task type, select Ens.Util.Tasks.PurgeOpens in a new tab.

    When you select this class, the page updates to display configurable information for this task.

  5. Specify the following options:

    • BodiesToo — Corresponds to the Include message bodies option. It is very important to purge message bodies; consequently, this option should be set to true in most cases. If you are not regularly purging message bodies, you should provide another mechanism to ensure that this storage is freed.

    • KeepIntegrity — Corresponds to the Keep data integrity option.

    • NumberOfDaysToKeep — Corresponds to the Do not purge most recent option.

    • TypesToPurge — Select the type of data to purge.

  6. Specify other options as needed. For details, see “Using the Task Manager” in the chapter “Managing Caché” in the Caché System Administration Guide.

  7. Complete the wizard as described in the previously referenced section.

FeedbackOpens in a new tab