Process Monitoring cleanup for Automic Automation
search cancel

Process Monitoring cleanup for Automic Automation

book

Article ID: 106299

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine Automic Automation CA Automic Operations Manager Automic Continuous Delivery Automation

Issue/Introduction

In different situations, it might be necessary to clean up Process Monitoring (Activity Window) of CA Automic Workload Automation (AE / Automation Engine).

  • Emergency: Remove specific Tasks after any kind of loop which activated Objects multiple times.
  • General clean up: Remove all or specific Tasks, for example after any kind of duplicating the Automation Engine database.
  • Specific Tasks: Remove single Tasks, which don't react to any standard action.


The cleanup is possible in many different ways:

  • Via the User Interface using the option “Modify Status Manually”, please have a look at the documentation for more details. This can be done for single Tasks only, there is no bulk select possible. So, it’s practical for a small number of Tasks, only.
  • Using the REST API with POST /{client_id}/executions/{run_id}/deact_task in versions 24 and 26.  
  • Directly in the database via SQL statements.  These statements require a deep technical understanding to run safely. Open a support case if "Modify Status Manually" isn't feasible for the situation.

How the SQL statements work

The SQL statements delete all Tasks (Activities) specified in the sub-select. Therefore, it’s very important to use the same sub-select for all statements!

  • The SQL Statements provided by Support will bypass the EH child tables' information from being move the AH (statistic, archive, or executions) child tables.  For example, variables in the ECV table that show up under Details of an execution will not be available when using the method.  Additionally and also mentioned below, workflow monitors will not be available because the SQL statements bypass the usual deactivation method.
  • The SQL statements start with deleting information from the E* tables that are child tables of EH.  The order is important because there are relationships between the tables.
  • There are two update statements that will set the end date for the Execution (Statistic Record) and for the Reports of the Task. As end date, end time the current database timestamp is used (SYSDATE).
The status of the Execution is set to 1850 which is “ENDED_CANCEL - manually canceled”.
Note: This is important for the reorganization – without a valid end timestamp and end status the entries will never be reorganized.
  • Finally, the header record from the EH table for the Task is deleted.

Be aware that manual deletion of Tasks causes the regular deactivation of these Tasks to be skipped. This has side effects, for example, there will be no Monitor for Workflows (JOBP) available, because the data is transferred to the statistic tables during deactivation.

The sub-select

With the sub-select, it’s possible to choose which Tasks you like to remove. Most common is to specify the client and the name of the Object. This is also used in the examples below.
Here some other fields sometimes used – in general, all fields of the EH table can be used if necessary:
 

NameDB Field NameExample
Client
EH_CLIENT
EH_CLIENT = 22
Task or Object Name
EH_NAME
EH_NAME = 'SCRI.RUNFOREVER'
RunID
EH_AH_IDNR
EH_AH_IDNR = 1234567890
Task or Object Type
EH_OTYPE
EH_OTYPE = 'JOBS'
Status / Status Number (Status numbers listed in System Return Code documentation)
EH_STATUS
EH_STATUS = 1572
Start Timestamp (see database specific context below for notes)
EH_STARTTIME
EH_STARTTIME < to_date ('2018-06-15 00:00:00', 'YYYY-MM-DD HH24:MI:SS')
Agent
EH_HOSTDST
EH_HOSTDST like 'WIN%'

Database specific context:

 OracleSQL ServerPostgreSQL
Current TimestampSYSDATEGETDATE()NOW()
Fixed Timestampto_date('2018-06-15 00:00:00', 'YYYY-MM-DD HH24:MI:SS')CONVERT(datetime, '2018-06-15 00:00:00', 120)TIMESTAMP '2018-06-15 00:00:00'
Finish COMMIT; / ROLLBACK;none requiredCOMMIT; / ROLLBACK;
LIKE case sensitivitycase-sensitivedepends on collationcase-sensitive (use ILIKE for case-insensitive)


The different DB table fields are combined with “or” and “and”. Here an example:

(select EH_AH_IDNR from EH where EH_CLIENT = 22 and EH_OTYPE = 'JOBS' and EH_STATUS = 1572 and EH_STARTTIME < to_date ('2018-06-15 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and EH_HOSTDST like 'WIN%')

So, this one will select all Tasks which are in client 22, and have the Object type “JOBS”, and the status 1572 (“Generating”). The start of the Jobs must be before the 15th of June 2018, and the Jobs run on Agents with the name “WIN…” in the beginning.
Note: Timestamps in the database are in UTC.

When in doubt, verify first

Most important is to select the correct Tasks via the sub-select. If you are in doubt about that, just verify which Tasks will be affected. Use the sub-select created and add for example client, object type and name, and the RunID for the output. Here an example:

select EH_CLIENT, EH_OTYPE, EH_NAME, EH_AH_IDNR from EH where EH_CLIENT = 22 and EH_OTYPE = 'JOBS' and EH_STATUS = 1572 and EH_STARTTIME < to_date ('2018-06-15 00:00:00', 'YYYY-MM-DD HH24:MI:SS') and EH_HOSTDST like 'WIN%';

Use a specific end date

By default, the end date of the statistic record and the Reports is the current DB time. To use a fixed timestamp instead, replace the current-timestamp expression with a fixed one:

- Oracle: to_date('2018-06-15 00:00:00', 'YYYY-MM-DD HH24:MI:SS')
- SQL Server: CONVERT(datetime, '2018-06-15 00:00:00', 120)
- PostgreSQL: TIMESTAMP '2018-06-15 00:00:00'

Always doublecheck with a DBA before running any SQL statements against a live database.
 

Environment

Applies to: Automation Engine with an DB2, Oracle, Microsoft SQL Server, or PostgreSQL database.

Resolution

As the cleanup of Tasks is a serious action, it should be done guided by Broadcom Support engineers only! Therefore, the statements themselves are not posted in this article.
For further information on this knowledgebase article, please contact Broadcom Support.  Information needed: Database Type (SQL Server, Oracle, PostgreSQL, DB2), exact version, and what should be deleted and why (how many tasks, what's not working as expected, etc...)