5 Replies Latest reply on Jan 22, 2018 12:50 PM by MrGadget

    Provisioning Jobs in history still show as running even after a year

    MrGadget Expert

      Running 2016.3

      In provisioning history I see jobs still showing as running and are not in scheduled tasks, some as far back as a year. I was told a long time ago to delete the computer from Landesk then run a full inventory history.

      Sometimes these running jobs even though they aren't in scheduled tasks and may be 6 months old get turned back on and a computer will try to provision itself.

       

      Is there any other way with a script to clear this?

        • 2. Re: Provisioning Jobs in history still show as running even after a year
          MrGadget Expert

          Yesterday I set the history to the lowest to keep only for 3 days but today I went back and checked some history's and they still are going back 1year and a half.

          • 3. Re: Provisioning Jobs in history still show as running even after a year
            phoffmann SupportEmployee

            Depending how many devices you have / how much stuff there is in there, the "automated" task may time out (and thus the WHOLE thing be cancelled / invalidated).

             

            Would you be comfortable running SQL statement to achieve the same effect? (That has the added benefit that you can do that "in batches" ... I tend to do around 1,000,000 lines at a time, for instance). How comfortable are you yourself with SQL statements (or would you have to resort to just handing things over to your DBA & trust me blindly, as it were) ?

             

            And - specifically - are there any "things to look out for"? I.e. - are you happy removing *ALL* Provisioning History entries older than (say) 30 days? Or are there specific devices that need to be excluded, etc?

            • 4. Re: Provisioning Jobs in history still show as running even after a year
              MrGadget Expert

              I went ahead and opened a case on this, awaiting Landesk support.

              If I don't hear from them I'll need your sql script to delete all history for provisioning.

              • 5. Re: Provisioning Jobs in history still show as running even after a year
                MrGadget Expert

                Since I had not heard from Landesk I went ahead and ran the following from a doc I found in the forum.

                "delete from dbo.PROV_HISTORY_VARIABLE where PROV_HISTORY_TASK_IDN IN (Select PROV_HISTORY_TASK_IDN from dbo.PROV_HISTORY_TASK where PROV_TEMPLATE_DEF_IDN IN (Select PROV_TEMPLATE_DEF_IDN from dbo.PROV_TEMPLATE_DEF where IN_OUBLIETTE = '1' AND LAST_MODIFIED_DATE < GetDate()-60))"

                "delete from dbo.PROV_HISTORY_ENTRY where PROV_HISTORY_TASK_IDN IN (Select PROV_HISTORY_TASK_IDN from dbo.PROV_HISTORY_TASK where PROV_TEMPLATE_DEF_IDN IN (Select PROV_TEMPLATE_DEF_IDN from dbo.PROV_TEMPLATE_DEF where IN_OUBLIETTE = '1' AND LAST_MODIFIED_DATE < GetDate()-60))"

                "delete from dbo.PROV_HISTORY_TASK where PROV_TEMPLATE_DEF_IDN IN (Select PROV_TEMPLATE_DEF_IDN from dbo.PROV_TEMPLATE_DEF where IN_OUBLIETTE = '1' AND LAST_MODIFIED_DATE < GetDate()-60)"

                "delete from dbo.PROV_ACTION_ORDER where PROV_TEMPLATE_DEF_IDN IN (Select PROV_TEMPLATE_DEF_IDN from dbo.PROV_TEMPLATE_DEF where IN_OUBLIETTE = '1' AND LAST_MODIFIED_DATE < GetDate()-60)"

                "delete from dbo.PROV_TEMPLATE_REL where PROV_TEMPLATE_DEF_IDN IN (Select PROV_TEMPLATE_DEF_IDN from dbo.PROV_TEMPLATE_DEF where IN_OUBLIETTE = '1' AND LAST_MODIFIED_DATE < GetDate()-60)"

                "delete from PROV_TEMPLATE_DEF where IN_OUBLIETTE = '1' AND LAST_MODIFIED_DATE < GetDate()-60"

                 

                Seems to have gotten rid of any old history. I'm still waiting to see if my setting for 3 days will get rid of the rest except something I've done in the last 3 days.