Currently there exist a large number of active objects in the Automic Automation Engine > Activity Window (4484). Please can you advise how to clear down the Activity Window using SQL to delete them from the Automic database?Would like to keep the auditing/statistics data, can this be filtered by date? I.e., delete all rows in activity window where date <= '2017-02-28'
We do not recommend to update or remove data from the database outside of the software.However here are a few hints to prevent the Activity window from overflowing:
https://us.v-cdn.net/5019921/uploads/editor/mr/ru5k4v7ji8gf.png" width="542">There are many ways of using this, the most common being to deactivate tasks when they end OK as can be seen above.
You can use a SQLI variable to retrieve tasks that fit certain criteria, and then use DEACTIVATE_UC_OBJECT to remove them from the activities.Quick example:
SELECT EH_AH_IdnrFROM EHWHERE EH_EndTime <= '2017-02-28'
SELECT EH_AH_IdnrFROM EHWHERE EH_EndTime
Note : this SQL statement was made on SQL Server, if you're using Oracle you'll need to convert the timestamp.
:SET &HND# = PREP_PROCESS_VAR(VARA.SQLI.GET_RUNIDS):PROCESS &HND#: SET &RUNID# = GET_PROCESS_LINE(&HND#,1): SET &DEACT# = DEACTIVATE_UC_OBJECT(&RUNID#): SET &TASKNAME# = GET_STATISTIC_DETAIL(&RUNID#, NAME): PRINT Task &TASKNAME# with RunID &RUNID# has been deactivated:ENDPROCESS
The goal is to only display some tasks and make it easier to deactivate them.For instance show only activities of tasks activated before 2017-02-28, that ran on a Windows agent and ended with ANY_ABEND status:
select eh_ah_idnr from ehwhere eh_client = 1and eh_OTYPE in ('JOBS','JOBF','JOBP')and eh_status in ('1800','1820','1850')and EH_Starttime <= '2017-08-31'
the table EH does not have a column EH_TIMESTAMP4...
Right... It should be EH_EndTime. Thanks for bringing this up.
It has been corrected. Thanks @Octavie for the help