Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Deleting System Jobs returned by attached query

Posted on by 2
Hello,
 
I'm working for customer who has more than 6 million failed/completed/canceled system jobs per organization to delete from its CRM 2016 on prem. I have found up an old article which describes how to delete these jobs via SQL - https://support.microsoft.com/en-us/topic/performance-is-slow-if-the-asyncoperationbase-table-becomes-too-large-in-microsoft-dynamics-crm-334a0738-e132-1ea7-cab3-7fd68cb823a4 but I don't think this is proper way to do it. Probably it would be better to use bulk deletion job for that. I don't know why article suggests to delete only jobs with statuscodes 30 and 32 but it does not include jobs with statuscode 31. In case we would delete records recommended by pasted article only arround 1 million of record would be deleted, so I was thinking to expand query conditions. The conditions that I would use in query are shown in image bellow:
 
 
Sometime it happens on our Clients production that some query locks asyncoperationtbase table and production stops working.
 
Last time when production stopped worked we found out the query posted bellow could be the problem for locking db table
 
 
I would be very grateful for you opinions about cleaning out such a big number of system jobs on production. Is it safe to cleanout all records from pasted query or could it causes some problems on production?
 
Thank you in advance.
 
  • mchgn.nstars Profile Picture
    mchgn.nstars 2 on at
    Deleting System Jobs returned by attached query
    Thank you for your help. I didn't intend to delete records via sql. I wanted to delete them using bulk deletion job. The main question was if the records from the query above are safe to delete? We want to clean out logs as much as possible.
  • Deleting System Jobs returned by attached query
    I do NOT recommend deleting this through the database! You are far better off running a bulk deletion job during off hours to remove these records.  In addition, I recommend scheduling a bulk deletion job to run monthly to continue to delete these completed processes in the future. For example schedule a job to run on the first of every month to delete processes older than 60 days.
     
    I do want to point out the one draw back of the bulk deletion job. It creates a new completed process that would need to be deleted manually from the system. Either way, I’m sure your client would happily trade 12 records for 6M annually.
  • RudyZhang Profile Picture
    RudyZhang Microsoft Employee on at
    Deleting System Jobs returned by attached query
    Hi,
     
    We analyzed your needs and Bulk Delete Manager in the Xrm Toolkit was able to meet them.
     
    Please refer to the following link
    https://www.xrmtoolbox.com/plugins/CrmGustaf.XTB.BulkDeleteManager/
     
     
     
    Best Regards,
    Rudy Zhang

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans