Automic Workload Automation

 View Only
Expand all | Collapse all

How do I cancel A LOT of tasks on the activity window?

  • 1.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 09, 2017 10:19 AM
    I have over a million tasks on the activity window that I need to cancel. Is there a script that I can run to cancel these tasks?


  • 2.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 09, 2017 10:21 AM
    JGi604607
    Please open a support case for that.
    We should be able to provide a solution.

    Best regards,
    Antoine


  • 3.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 09, 2017 06:00 PM
    Judith - please let me know what the solution is.


  • 4.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 10, 2017 03:07 AM
    2 Attemts for this

    Solution A (preferred) deactivating via script or manually sorted in groups of status codes

    Solution B a special SQL Statement from Support (only ermergencies usually)



  • 5.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 13, 2017 01:21 PM
    Antoine_Sauteron I opened a ticket.

    SamahSohrab607228 this is what support said:

    In case you are using the SQL database, please follow the article to know how to clean up the Activity Window Cleanup for Automic AE v10 with MS-SQL DB:
    https://automic.force.com/support/apex/CommunityArticleDetail?id=ka4b0000000k9hz

    and with AE V11 and above: 

    https://eu2.salesforce.com/console?tsid=02ub00000005Nxs#

    I am hoping for support to send me a script because I can't manually cancel the million tasks.

    FrankMuffke for solution A, do you have a script that I can "borrow?" :wink:


  • 6.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 14, 2017 02:18 AM
    Hi JGi604607

    Thanks for opening the ticket. What we generally do is to suggest to try and modify the task's status either manually when there are a few, or with script functions like:

    DEACTIVATE_UC_OBJECT
    CANCEL_UC_OBJECT
    MODIFY_TASK

    Unfortunately it does not work in all cases, because tasks may not be in a cancelable status for instance.

    We can provide a set of SQL statements to force the cancelation / deactivation of tasks, however this has to be a last resort because we strongly advise not to mess directly with the database. Therefore we cannot make these statements public (on the Community for instance), and they are provided only through incidents. 

    Best regards,
    Antoine


  • 7.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 14, 2017 07:05 AM
      |   view attached
    JGi604607
    here you go.....
    Export is for V11.2 and above - but it should also work in 11.1 and perhaps in 10.

    SCRI.DEACT.SOLUTION - the actual script

    VARA.SQLI.GET_EH_STATUS - containig the T-SQL to fetch all RUN IDs from the current client
                              select TOP(100) eh_ah_idnr, eh_name, eh_status from EH where eh_client = &$CLIENT#

    VARA.STATIC.DEACT.SOLUTION - a list of Status codes and actions (leave or decativate), will be extended with the
                                 statuscode automatically - you just need to enter your desired action and re-run

    VARA.STATIC.DEACTIVATION_ERRORS - if a deactivation was not successful, object and run id and RC will be entered here


    the script gathers all objects from the activity window from the current client and compares it with the
    settings in VARA.STATIC.DEACT.SOLUTION - if it should deactivate objects of the state or not (running and waiting objects
    should be skipped)

    then all objects will be deactivated that passed the check - if deactivation Error occur it will be written to
    VARA.STATIC.DEACTIVATION_ERRORS. Sometimes Error 20292 appears, No Idea what this means - trying a bit later
    everything runs fine, so I suppose, these objects are in a non-deactivateable state (even with FORCED)

    to reduce performance impact I limited the SQL Result to 100 lines with TOP(100) feel free to change
    You can execute the script in recurring mode, so it will handle bunches of 100 Objects -it can run 24/7
    if you use ORACLE pls change the select to your needs, I think it would look like
    select eh_ah_idnr, eh_name, eh_status from EH where eh_client = &$CLIENT# and ROWNUM <= 100

    If objects are in a running state and should be deactivated, this will result in an error, for this my script
    is not intended to run - if wanted it should be extended with a cancel_uc_object.


    Open for Inputs and enhancement suggestions.

    have fun :-)
    Wolfgang

    PS: Pls test prior to PROD in an TEST environment!

    Attachment(s)

    zip
    deact_solution.zip   2 KB 1 version


  • 8.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 14, 2017 10:46 AM
    Antoine_Sauteron I understand. I am still working with support.
    FrankMuffke thanks for the script. I just remembered that I can't run a job until I get rid of most of the jobs. I tried running a job and it is still on "waiting for Queue slot" status.


  • 9.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 14, 2017 10:53 AM
    JGi604607
    thats a queue setting - a limit.

    https://docs.automic.com/documentation/WEBHELP/English/AWA/11.2/AE/11.2/All%20Guides/help.htm#ucacst.htm%3FTocPath%3DUser%2520Guide%7CObjects%7CAlphabetical%2520Listing%7CQueue%7C_____7

    you can also use "ignore queue limit" within ACT window in the object context menu

    or you just use another queue :-)



  • 10.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 14, 2017 01:32 PM
    I had tried to ignore the queue limit before but that didn't work. I hadn't thought of using another queue, but that worked. Thanks.


  • 11.  How do I cancel A LOT of tasks on the activity window?

    Posted Feb 14, 2017 02:15 PM
    you 're welcome :)