Running the Stored Procedure for Microsoft SQL Server
To run the stored procedure, enter the following commands:
EXEC ec_delete_non_instance_audit end_time, force_delete, batch_size, dbg
where:
- end_time is the date before which the audit data will be purged.
This is an optional parameter, if not specified all audit data will be deleted.
The date should be in the format YYYY-MM-DDTHH:mm:ss.SSSTZ
where:
- force_delete indicates if the audit data should be force deleted.
In normal operation audit events for process instances should have been purged if the ec_delete_audit_stats_data stored procedure has been executed.
The ec_delete_non_instance_audit stored procedure will error if it identifies any process instance audit events within the threshold to be purged. If this happens it will not continue with the purge.
It is recommended you check the audit trail to see if the audit events are required. If you wish to continue with the purge you could pass in 'TRUE' for this option.
Valid values are:
- batch_size
is the number of audit events that should be deleted before the transaction is committed.
This is a mandatory parameter and if not specified (or if 'NULL' or '0' is specified) it will default to 5000.
- dbg is the debug flag which gives useful debug information. This is switched off by default. Valid values are:
The following are examples of usage.
- To delete audit data before the specified date:
exec ec_delete_non_instance_audit '2010-10-08T13:35:37.977Z’
- To delete all audit entries:
exec ec_delete_non_instance_audit
- To delete all audit entries with a different commit batch size (150):
exec ec_delete_non_instance_audit NULL, NULL, 150
- To delete all audit entries forcefully:
exec ec_delete_non_instance_audit NULL, 'TRUE'