Skip to main content

Notifications

Business Central forum
Suggested answer

Change Log Entries clean up

Posted on by 198

Hi,

We have a client that was badly guided when they moved from Nav to Business Central SaaS.

They configured their change log setup to track almost every changes in the system and made a modification to prevent deleting entries or running the retention policy

We are now at a point where they have over 385M records in the change log entry table and the size of their database is huge, creating capacity issues when creating a sandbox from production.

I am trying to help them clean them up but everything we try, it ends up in the server timing out.

We tried different retention policy to delete a month a time, starting from the oldest entries

We also tried using the Change Log - Delete option int the Data Administration page

A process only report, filtering on the entry no. field

Everything times out and ends up failing.

What else can we try?

-Julie

Categories:
  • Suggested answer
    Suraj Vekaria Profile Picture
    Suraj Vekaria 2 on at
    Change Log Entries clean up
    I have been tasked with the following to delete the Change Log. The No. of records in the Change Log is sitting at 97 million currently. Taking up around 39GB of space. 
     
     
    The maximum records BC will delete at once is 10,000 records. 
    By clicking the Apply Manually - you see a message 
     
    Thats the message you will see.
     
    I have setup a Job Queue with the following parameters and letting it run 24 hours. Once I have proved this is working in the sandbox, I will narrow starting time and ending time and leave it running overnight. The following parameters was through trial and error and seems to be sweet spot of allowing the job to run continuously. So far so good, the record number are coming down. I'm opting for this option due the fact it's a built-in functionality and if there was any related table this would capture and deleted them.  
     
     
    The No. of records is coming down. So, this will take few days. 
     
     
     
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 63,013 Super User on at
    RE: Change Log Entries clean up

    Or make a small tool to delete 10M records each time, so that all can be deleted after 30 manual operations.

    If there is no developer, Valentin's suggestion is better.

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 6,365 Super User on at
    RE: Change Log Entries clean up

    try making the date range shorter until it doesn't time out. You said you tried a month, try 1 day. If that doesn't time out increase it to 2 days, 3 days, and so on. If it times out, then make it even shorter. What you can then do is create a job queue with a CU that takes something along the lines of 30 seconds to run. Then setup this job queue to run every minute. The date range of entries being deleted in that 30 seconds is very small, but because the job queue is recurring eventually it will delete them all.

    I had the same issue and the only way I managed to get it to not time out was to make the date range short. 

    Maybe other users will have different ideas...

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,876 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,425 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans