Monitor 10.11 | Archiving or Deleting Data in an Archive Database | Archiving or Deleting Audit Data Using Stored Procedures
 
Archiving or Deleting Audit Data Using Stored Procedures
When you installed the Archive database, you also installed stored procedures for archiving or deleting data between databases installed in Oracle, SQL Server, or DB2. You access the stored procedures for archiving through your database application.
The stored procedures for archiving data to the Archive database from the IS Core Audit Log database, the Process Audit Log database, or both are listed in the following table.
Procedure
Description
Oracle:
DOCUMENT_ARCHIVE. START_DOCUMENTARCHIVE
SQL Server and DB2:
DOCUMENT_ARCHIVE_ START_DOCUMENTARCHIVE
MySQL and PostgreSQL:
DOCUMENT_ARCHIVE_ START_DOCUMENTARCHIVE
In IS Core Audit Log, archives or deletes documents logged for webMethods Broker (deprecated) clients from the WMDOCUMENT table.
In Process Audit Log, archives and deletes document control data (such as resubmit actions) from the PRA_PROCESS_ACTION table.
Oracle:
PROCESS_ARCHIVE. START_PROCESSARCHIVE
SQL Server and DB2:
PROCESS_ARCHIVE_ START_PROCESSARCHIVE
MySQL and PostgreSQL:
PROCESS_ARCHIVE_ START_PROCESSARCHIVE
In IS Core Audit Log, archives or deletes process-related service data from the tables:
WMSERVICEACTIVITYLOG and WMERROR
In Process Audit Log, archives or deletes process and control data (such as resubmit actions) from the tables:
*PRA_PROCESS_CUSTOM
*PRA_STEP_LOGGED_FIELD
*PRA_STEP_LOOP_LOGGED_FIELD
*PRA_PROCESS
*PRA_PROCESS_ACTION
*PRA_PROCESS_RECENT
*PRA_PROCESS_STEP
*PRA_STEP_TRANSITION
*WMCUSTOMFIELDDEFINITION
*WMPROCESSDEFINITION
*WMPROCESSIMAGE
*WMSTEPDEFINITION
*WMSTEPTRANSITIONDEFINTION
Oracle:
SERVER_ARCHIVE. START_SERVERARCHIVE
SQL Server and DB2:
SERVER_ARCHIVE_ START_SERVERARCHIVE
MySQL and PostgreSQL:
SERVER_ARCHIVE_ START_SERVERARCHIVE
In IS Core Audit Log, archives or deletes Integration Server data from the tables:
WMERROR, WMSESSION, WMTXIN, and WMTXOUT
Integration Server data consists of session and guaranteed delivery log entries, and error log entries that are not associated with logged processes, services, or documents (for example, errors that occur during startup or during the run of unlogged processes, services, activations, and documents).
Note:
Archiving Integration Server data archives only top-level errors. To archive lower-level errors associated with services or processes, you must first archive those services or processes.
Oracle:
SERVICE_ARCHIVE. START_SERVICEARCHIVE
SQL Server and DB2:
SERVICE_ARCHIVE_ START_SERVICEARCHIVE
MySQL and PostgreSQL:
SERVICE_ARCHIVE_ START_SERVICEARCHIVE
In IS Core Audit Log, archives or deletes service log entries, input pipelines, error data, and user-defined messages from the following tables:
*WMSERVICE
*WMSERVICE_MIN_MAX
*WMERRORTBL
*WMSERVICEACTIVITYLOGTBL
*WMSERVICEASSOCTBL
*WMSERVICECUSTOMFLDSTBL
In Process Audit Log, archives or deletes service control data (such as resubmit actions) from the WMCONTROL table.
Note:
Indexes for the archive schema are removed when archiving with stored procedures.
Parameters
The following table lists and describes the parameters.
p_retaindays
String Number of days to keep the indicated type of data in the source database, ending with and including the current date.
Suppose the current date is September 30, to archive or delete data for services that finished running more than 15 days ago (that is, before September 15), you would specify this parameter as 15.
Supply either p_retaindays or p_retaindate. Do not supply both.
p_retaindate
Long Start date for the period to keep the indicated type of data in the source database. The period ends with and includes the current date. p_retaindate is in epoch time (milliseconds since midnight, 01/01/1970).
Supply either p_retaindate or p_retaindays. Do not supply both.
p_action
String Indicates whether to archive or delete the indicated type of data from the source database.
Set to...
To...
ARCHIVE
Default. Copy the data from the source to the Archive database and delete the data in the source database.
DELETE
Delete the data from the source database.
p_status
String Used by the PROCESSARCHIVE or SERVICEARCHIVE procedure, indicates which data to archive or delete based on the specified status. Process and service data with a status other than those specified is retained in the source database.
Code
Archive or Delete data for
2
Processes or services with a Completed status.
4
Processes or services with a Failed status.
1024
Processes with a Stopped status.
32768
Processes and services with a Resubmitted status.
32776
Services with an Activity status.
p_batchsize
String Number of primary items and accompanying items to archive or delete at a time. To archive or delete 100 processes and accompanying services, activity logs, and errors at a time, choose a number that takes the size of each record and other performance factors into consideration. If the record size is large, consider reducing the batch size; if the record size is small, increasing the batch size may increase the speed of the archive or delete.
p_modelid
String array Used by the PROCESSARCHIVE procedure only. Complete model ID of the model for the process instance(s) you want to archive. Use a comma to separate multiple modelid string values. You can retrieve model IDs by invoking the pub.monitor.process.instance:getProcessList service and using the value returned in the processNames/PROCESSKEY output parameter. If null, all process models are archived.