Cleanup Submitted Tasks Tab

Use this tab to specify the minimum age, archive, audit timeout, time limit, and task limit of the task. Click Finish once you have completed all required fields. The fields in this tab are as follows:
cim142
Use this tab to specify the minimum age, archive, audit timeout, time limit, and task limit of the task. Click Finish once you have completed all required fields. The fields in this tab are as follows:
  • Minimum Age
    Specifies the minimum age of tasks that are in a final state (Completed, Failed, Rejected, Cancelled, or Aborted) to clean up. For example, if one month is specified, any tasks that have reached a final state in the last month are retained. Any tasks that have reached a final state more than a month ago are subject to cleanup and archiving.
    This field is a required.
  • Archive
    Backs up tasks to the archive database before deleting them from the runtime database.
    After running a job, selecting Archive commits the data to the archive database, and then removes it from the run time task persistence database. Data is not removed until a successful commit to the archive database happens.
  • Cleanup via Stored Procedure
    If you use the same database for archive and task persistence, Cleanup via Stored Procedure uses stored procedures to clean up the task persistence database. If it is not selected, CA Identity Manager deletes tasks individually. Using this option with the Time Limit option causes the Time Limit option to fail. Using a Stored Procedure is faster and less resource intensive on the application server
  • Audit Timeout
    Specifies the length of time before tasks in the audit state are subject to cleanup. Tasks in the audit state are not considered to be in a final state until this length of time has elapsed. Tasks in the audit state have not been submitted
  • Time Limit
    Limits clean up to a specific amount of time. This field limits clean up to a specific amount of time. This option is only available if the "Cleanup via Stored Procedure" option is
    not
    selected.
  • Task Limit
    Limits clean up to a specific number of tasks.
  • Delete per transaction
    Select the number of tasks to delete. 500 is the default.
  • Cancel In Progress Tasks Only
    Attempts to cancel tasks in progress, and, if successful, places the task in the “Cancelled” state. Because the Cancelled state is a final state, the task becomes a candidate for cleanup via the usual CleanUpSubmittedTask feature. No cleanup happens in the CleanUpSubmittedTask when you select the Cancel option.
Cleanup Submitted Task in a Cross Database Scenario
[Applicable from CA Identity Manager 14.2 CP3]
If the Task Persistence and Archive do not share the same database or tablespace, you must run the following scripts manually prior to performing the cleanup submitted tasks. These scripts work only if the database or tablespace is on the same server.
Oracle:
 <CA_Identity Manager_Install_Path>/tools/db/taskpersistence/<DB_Type>/archive_crossdb_oracle.sql
SQL Server:
 <CA_Identity Manager_Install_Path>/tools/db/taskpersistence/<DB_Type>/archive_crossdb_sqlserver.sql
Steps to run the script manually on SQL Server:
  1. The Archive database owner who runs the stored procedure must have SELECT and DELETE table privileges on the Task Persistence database.
  2. In the script, replace "TP_DB_Name" with the name of the Task Persistence database.
  3. Run the script as Archive database owner. The script updates the archive stored procedures so that it is compatible with the multi-database scenario.
  4. Run the following command to perform cleanup submitted task:
    exec archiveTaskPersistence '<Environment ID>', "<Minimum Age in YYYY-MM-DD HH:MM:SS:MS format>", <Audit Timeout Days>, <Delete per Transaction>, <Task Limit>, <Total Task>
    Example:
    exec archiveTaskPersistence '6', "2019-01-21 10:03:38.15", 1, 500, 1000, 1
Steps to run the script manually on Oracle Server:
  1. Grant SELECT and DELETE privileges to the Archive database owner for the following tables in the Task Persistence tablespace:
    • CMPL_EVENT_OBJECT12_5
    • CMPL_EVENT12_5
    • CMPL_OBJECT12_5
    • CMPL_RSDATTRIBUTE12
    • CMPL_RSDETAIL12
    • CMPL_TASKSESSION12_5
    • EVENT_OBJECT12_5
    • EVENT12_5
    • LOCK12_5
    • OBJECT12_5
    • RUNTIMESTATUSDETAIL12
    • RUNTIMESTATUSDETAILATTRIBUTE12
    • TASKSESSION12_5
    • TMP_BULKLOADER12_5
    Example:
     The following commands grant the SELECT and DELETE privileges to the Archive database owner (ARUSER) for the following tables in the Task Persistence tablespace (TP_SCHEMA_NAME).
    grant SELECT on "TP_SCHEMA_NAME"."CMPL_RSDETAIL12" to "ARUSER"; grant DELETE on "TP_SCHEMA_NAME"."CMPL_RSDETAIL12" to "ARUSER";
  2. In the script, replace "TP_SCHEMA_NAME" with the schema name of your task persistence tablespace.
  3. Run the script as Archive database owner. The script updates the archive stored procedures so that it is compatible with the multi database scenario.
  4. Use the following command to perform cleanup submitted task:
    DECLARE
    total INTEGER;
    BEGIN
    archiveTaskPersistence ('<Environment ID>', TO_DATE('<Minimum Age>', 'YYYY-MM-DD HH24:MI:SS'), <Audit Timeout Days>, <Delete per Transaction>, <Task Limit>, <Total Task>);
    dbms_output.put_line(total);
    END;
    Example:
    DECLARE
    total INTEGER;
    BEGIN
    archiveTaskPersistence('6', TO_DATE('2019-01-25 13:30:00', 'YYYY-MM-DD HH24:MI:SS'), 1, 500, 1000, total); 
    dbms_output.put_line(total);
    END;