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)

Bulk Delete Stuck

(0) ShareShare
ReportReport
Posted on by

Hi, so we started a bulk delete to remove a large part of the leads we had in the database.  We kept an eye on the progress and all was fine at first.  Except that for the past 12 hours it's been stuck at the same number of deleted leads (hasn't budged by even 1).  At first I thought that maybe it was done, except for 2 things:

1) it still says it's in progress

2) I can still see that a lot of the leads that are supposed to be deleted are still in the system.

(It's either the 2011 or 2013 version)

Please help!

*This post is locked for comments

I have the same question (0)
  • Patrick Dykema Profile Picture
    525 on at

    LuckyP,

    I think this might be a permissions issue. Can you post a pic of the bulk delete details? 

    This might help 

    //msdn.microsoft.com/en-us/library/fadb3c51-6fa8-4fd4-992c-d413e4cd9433(v=crm.6)#bkmk_access

  • NatrajY Profile Picture
    3,040 on at

    1.) Check if the asyncservice has crashed

    2.) Check the event log on the application server to see if there are any IIS issues


    I recently had to delete couple of million records in dev server the supported way. I tried used bulk delete but ran into performance problems. I ended up using SSIS with Bulk Data Distributer and Cozyroc to delete the records. You could probably do the same with Kingswaysoft as well.

  • Mithilesh Kumar Profile Picture
    10,047 on at

    Hi LuckyP,

    Couple of points to note

    1. Number of Records (Leads) to be deleted

    2. Is it a Recursive Job

    3. If On Premise check for the Asyn Service

    It may happen if the Async Service may have crashed if there are too many records or another Job would have started if it is a recursive process, before the first one ever completed.

    Hope that helps

    Thanks

  • Community Member Profile Picture
    on at

    Hi LuckyP,

    If the AsyncOperationBase is slow due to a "Bulk Delete"

    To resolve this problem, perform a cleanup of the AsyncOperationBase table by running the following script against the<OrgName>_MSCRM database, where the placeholder<OrgName> represents the actual name of your organization.

    Warning Before you clean up the data, be aware that completed system jobs have business value in some cases and have to be stored for a long period. Therefore, you should discuss this with your organization's administration staff first.

    System jobs that are affected:

    •SQM data collection. Software Quality Metrics collects data for the customer experience program.

    •Update Contract States SQL job. This job runs one time per day at midnight. This job sets the expired contracts to a state of Expired.

    •Organization Full Text Catalog Index. Populates full text index in db for searching Microsoft Knowledge Base articles in CRM.

    If recurring jobs were canceled, they will be removed.

    •Make sure that only the following Async operation types are deleted if the state code of the types is 3 and the status code of the types is 30 or 32: •Workflow Expansion Task (1)

    •Collect SQM data (9)

    •PersistMatchCode (12)

    •FullTextCatalogIndex (25)

    •UpdateContractStates (27)

    •Workflow (10

    IF EXISTS (SELECT name from sys.indexes

                     WHERE name = N'CRM_AsyncOperation_CleanupCompleted')

         DROP Index AsyncOperationBase.CRM_AsyncOperation_CleanupCompleted

    GO

    CREATE NONCLUSTERED INDEX CRM_AsyncOperation_CleanupCompleted

    ON [dbo].[AsyncOperationBase] ([StatusCode],[StateCode],[OperationType])

    GO

    while(1=1)

    begin

    declare @DeleteRowCount int = 10000

    declare @rowsAffected int

    declare @DeletedAsyncRowsTable table (AsyncOperationId uniqueidentifier not null primary key)

    insert into @DeletedAsyncRowsTable(AsyncOperationId)

    Select top (@DeleteRowCount) AsyncOperationId from AsyncOperationBase

    where

     OperationType in (1, 9, 12, 25, 27, 10)

     AND StateCode = 3

     AND StatusCode in (30, 32)

    select @rowsAffected = @@rowcount

    delete poa from PrincipalObjectAccess poa

      join WorkflowLogBase wlb on

       poa.ObjectId = wlb.WorkflowLogId

      join @DeletedAsyncRowsTable dart on

       wlb.AsyncOperationId = dart.AsyncOperationId

    delete WorkflowLogBase from WorkflowLogBase W, @DeletedAsyncRowsTable d

    where

     W.AsyncOperationId = d.AsyncOperationId            

    delete BulkDeleteFailureBase From BulkDeleteFailureBase B, @DeletedAsyncRowsTable d

    where

     B.AsyncOperationId = d.AsyncOperationId

    delete WorkflowWaitSubscriptionBase from WorkflowWaitSubscriptionBase WS, @DeletedAsyncRowsTable d

    where

     WS.AsyncOperationId = d.AsyncOperationID

    delete AsyncOperationBase From AsyncOperationBase A, @DeletedAsyncRowsTable d

    where

     A.AsyncOperationId = d.AsyncOperationId

    /*If not calling from a SQL job, use the WAITFOR DELAY*/

    if(@DeleteRowCount > @rowsAffected)

     return

    else

     WAITFOR DELAY '00:00:02.000'

    end

    Source: support.microsoft.com/.../en-us

    Best Regards,

  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Lucky,

    Is the failures number also not increasing at all while deleted number is still stuck?

    Thanks.

  • Community Member Profile Picture
    on at

    I'm using CRM 2015 On-Premise and I'm having the same problem. The Status Reason ist "In Progress" but the Successes nor the Failuers are increasing. They are still on "0"

  • Suggested answer
    Dhaval mistry Profile Picture
    810 on at

    I would suggest restart your Asynch service and recreate your bulk deletion job.

    It may take some time to start. for me It took 1 hour to start the job. First one hour job was stuck in "In Progress" status.

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