Purge execution log
The purge execution logs process deletes execution logs from the SCV execution log table.
This process is implemented using the PURGE_EXECUTION_LOG program.
The PURGE_EXECUTION_LOG program considers these input parameters:
- C2*
- The SCV database connection details.
- EXECUTIONS_TO_KEEP
- The number of execution log records to maintain after deleting. Note: By default, the value is set to 3.
- KEEP_RUNNING_EXECUTIONS_FLAG
- Indicates whether to maintain or delete currently running executions. Note: By default, the value is set to True.
- SOURCE
- The source system parameter that is used when logging the execution log.
The PURGE_EXECUTION_LOG program deletes execution logs as follows:
- Logs new log record.
- Identifies the latest <EXECUTIONS_TO_KEEP> records for each
implementation_name value in the SZ_EXECUTION_LOG table. For
example:
- If the KEEP_RUNNING_EXECUTIONS_FLAG parameter is set to Null or True, identifies the latest <EXECUTIONS_TO_KEEP> records with the Completed status.
- If the KEEP_RUNNING_EXECUTIONS_FLAG parameter is set to False, identifies all the latest <EXECUTIONS_TO_KEEP> log records regardless of the status.
- If the SOURCE parameter is specified, identifies the log records that contain the specified source in the parameters column.
- If the SOURCE parameter is not specified, identifies the log records that do not contain the source in the parameters column. For example, identifies the records where the SOURCE parameter is logged without a value or not logged at all.
- Includes the execution_id of each SZ_EXECUTION_LOG record available in the PURGE_EXECUTION_LOG program to the <execution IDs to keep> list.
- Performs the following for each <current execution id> in the list <execution IDs
to keep>:
- Verifies if a validation log record available in the SZ_VALIDATION_LOG table where execution_id is set as <current execution id>. If yes, remove the <current execution id> from the <execution IDs to keep> list.
- Verifies if a snapshot log record available in the SZ_SNAPSHOT_LOG table where execution_id is set as <current execution id>. If yes, removes the <current execution id> from the <execution IDs to keep> list.
- Deletes all records from the SZ_EXECUTION_MAP table where the execution_id value is not in the <execution IDs to keep> list.
- Deletes all records from the SZ_EXECUTION_MSG table where the execution_id value is not in the <execution IDs to keep> list.
- Deletes all records from the SZ_EXECUTION_STAT table where the execution_id value is not in the <execution IDs to keep> list.
- Deletes all records from the SZ_EXECUTION_TASK_LOG table where the execution_id value is not in the <execution IDs to keep> list.
- Deletes all records from the SZ_EXECUTION_LOG table where the execution_id value is not in the <execution IDs to keep> list.
This table lists default values for the input parameters of the PURGE_EXECUTION_LOG program:
Parameter | Default value | Description | Possible values |
---|---|---|---|
C2_PROVIDER | sqlserver | SCV database connection parameters: SCV database type. | sqlserver |
C2_HOSTNAME | <scv-server> | SCV database connection parameter: SCV database server name or IP number. | |
C2_PORT | <scv-port> | SCV database connection parameter: SCV database port number. | |
C2_DATABASE | <scv-database> | SCV database connection parameter: SCV database name. | |
C2_INSTANCE | <scv-instance> | SCV database connection parameter: SCV database instance name. | |
C2_USER | <scv-user> | SCV database connection parameter: SCV database username. | |
C2_PASSWORD | <scv-password> | SCV database connection parameter: SCV database password. | |
JOBID | <external-jobid> |
Program logic parameter: External Job ID. This parameter is used when the PURGE_EXECUTION_LOG program is executed as part of another job. |
|
EXECUTIONS_TO_KEEP | 3 | Program logic parameter: Number of executions to maintain. | Integer value. |
KEEP_RUNNING_EXECUTIONS_FLAG | Y | Program logic parameter: Maintain or delete execution logs for currently running executions. | Integer value. |