web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Deleting System Jobs returned by attached query

(0) ShareShare
ReportReport
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.
 
I have the same question (0)
  • RudyZhang Profile Picture
    Microsoft Employee on at
    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
  • Community member Profile Picture
    4 on at
    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.
  • mchgn.nstars Profile Picture
    2 on at
    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans