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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Inventory settlements cleanup issues

(0) ShareShare
ReportReport
Posted on by 110

I tried cleaning up the InventSettlement table with the AX cleanup batch in a test environment.

After running for 4 days, the batch failed:

It cleanup up 2 out of 39 million records, but the table has grown 2 GB to almost 20 GB.

My SQL recovery model is set to "simple", but the SQL log has grown 75 GB.

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    305,455 Super User 2026 Season 1 on at

    Hi Robert,

    I have splitted your question as the initial question was answered and this is another issue.

    You said the batch failed. Can you indicate if there was an error message?

    The number of records is huge in this table. The cleanup will delete e.g. settlements from cancelled inventory closings.

    Can you try to run this batch per Item group? So the system does not need to have to clean up everything in one batch.

  • Robert Schardijn Profile Picture
    110 on at

    Thank you for your advice.

    When i use a smaller selection, and when i enter a date for the "gouped settlements" option and leave the date for the "cancelled settlements" blank, the InventSettlements cleanup batch succeeds.

    After cleaning up with a filter <1-1-2010 and only 1 product group, i get less records, but more GB data!

    The number of records dropped from 39,69 million to 39,58

    but the table size increased from 21,9 to 22,2 GB

    The batch did not fail, and i get less records, but more data. I hoped to get less data instead.

  • Guy Terry Profile Picture
    29,003 Moderator on at

    The table size increasing could just be related to some functionality in SQL, not AX. How are you measuring / displaying the size of the table?

  • Robert Schardijn Profile Picture
    110 on at

    I used the standard sql report "disk usage top tables" and looked at the records and reserved (kb) before and after the batch.

  • dolee Profile Picture
    11,279 on at

    Hi Robert,

    Deleting records will not automatically reduce the size of a table. The space freed will not be released to the OS without doing a DBCC SHRINKFILE or DBCC SHRINKDATABASE.

    You can try to do a reorg or rebuild of the cluster index of that table. That should reduce the "table size", but it still won't reduce the database size.

    In terms of table size concern, it is more of a SQL topic. You can probably find discussions on similar questions if you do a search on SQL forums.

  • Suggested answer
    Robert Schardijn Profile Picture
    110 on at

    You are right: After an index rebuild of the sql database, the size of the InventSettlement table has been reduced.

    When i use the above mentioned steps, i managed to run the InventSettlement cleanup succesfully:

    - run smaller selections per year and per ReqGroup

    - run "group settlements" and "delete cancelled settlements" seperately

    - run index rebuild afterwards

  • Verified answer
    dolee Profile Picture
    11,279 on at

    Hi Robert,

    If your latest post is an acceptable outcome, please consider marking it as an Answer. =)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans