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
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.
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.
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,
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
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156