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 :
Microsoft Dynamics CRM (Archived)

Delete dbo.workflowlogbase and dbo.processSessionBase Status reason Failed records

(0) ShareShare
ReportReport
Posted on by

Hello.

For some reason the CRM database has grown to 60GB due to dbo.workflowlogbase -  have notice Process sessions - with Status Reason = Failed to be over  5000+  all seem to be failed real-time workflows.  

When am running a total Record count for the WorkflowlogBase SQL Script, receiving 3072577 Failed Records and 50736 succeeded Records which I like to delete.

However when run Advanced find -  System Jobs with Status Reason =  Failed it's only showing up 420 records and not 3072577 records.

What is the best and way to delete the total count failed records of 3072577 from the crm 2016 sp1 on premise?

The disk usage by top tables are dbo.workflowlogbase  at 28GB and dbo.processSessionBase 16GB   -  dbo.attachment 14GB. 

Ideally I like to delete all failed and completed recodes for both dbo.workflowlogbase and dbo.processsessionbase  and all 2 years older dbo.attachment email attchments.

 

Am I able to do this within CRM?  if not please provide the SQL script.

Many thanks,

PJ

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    The script at here will clear data from workflowlogbase, though I'm not sure if it also clears processessionbase.

    You should be able to use a bulk delete job to delete the email attachments within CRM.

  • Suggested answer
    NKC Profile Picture
    on at

    Hi 

    You need to include failed, canceling, pausing, waiting, waiting for resources and canceled. But consider to include waiting because if any wait condition in workflows or SLA's. You can also include created on or before to filter jobs. I would suggest first creating  bulk record deletion jobs instead of executing query on database.  if you are using crm 2016 try to delete jobs from advanced find you will get error so use bulk record deletion job. 

  • Community Member Profile Picture
    on at

    I have tried that kb968520 Performance is slow if the AsyncOperationBase table too large knowledgebase, tried shrinking the database and ran the system log  bulk delete option.  

    however it did not delete any of the WorkflowlogBase 3,072,577 Failed Records and 50736 succeeded Records.   

    dbo.workflowLgobase  did not change much dbo.ProcessSessionBase.

    any other suggestions that can shrink the database?

    Thanks   

  • Community Member Profile Picture
    on at

    Is it safe to delete ProcessSessionBase table  recodes with  Status Reason = Completed; Canceled; Failed?

    if so please provide a SQL script as the bulk deletion takes too long.

    should I also run sql scrip     UPDATE STATISTICS [dbo].[ProcessSessionBase] WITH FULLSCAN  ?

    Thanks,

  • Community Member Profile Picture
    on at

    how am I able to delete all the old synchronous real-time workflow jobs which have encounter errors logs from crm 16?

    unable to delete the records using the three method below.  any other suggestions?

    tried to clear the keep logs for workflow job that encounter errors check box on the faulty real-time workflow.

    tried to delete the faulty real-time workflow it did not remove the faulty records.

    tried to use advances search and delete the process sessions  with status reason equals failed.

  • skhan Profile Picture
    120 on at

    Hi Mokarram,

    We are having the same issue, and bulk delete is too slow. Can you please provide the solution that worked for you. It would be very grateful.

    Thank you.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans