Hi all-

Many of you would be interested in finding out what’s driving storage consumption of you Dynamics 365 Customer Engagement instance. Some would think it’s largely data for entities, i.e. Account, Contact, Lead, Opportunity, Custom etc. Which is true to a large extent but with few exceptions. Organization database also holds system data linked with user records. House keeping such system data is handled by Deletion Service. This post on our CRM PFE Team site explains clean up by Deletion Service. If you are not familiar with Deletion Service, I suggest you read above post to put this altogether.

Now you know the role of Deletion Service, hopefully. Hey, I take that an assumption to continue writing  . I was working with a customer to prepare for an upgrade and noticed some of the system data related tables were significant in size. While it came as surprise for customer their knowledge was claiming system data should be getting cleaned by the system(aka Deletion Service). So, started digging around the Deletion Service behavior for the organization in question. Deletion service executions were successful, no errors! Further going into the details of few large tables, it came to light that system data was retaining longer than usual. Found several OrgDBOrgSettings were set differently for this Org.

We could have restored to default values but chose to discuss retention requirements, general guidance and adjusted the settings accordingly. Once we adjusted these settings, next run of Deletion Service took care of reducing size of respective tables.

From above learning, here are the OrgDBOrgSettings those control Deletion Service retention along with description:

Setting Name
Maximum number of days to keep change tracking deleted record ID's. You want this value larger than the max# of days any change tracking dependent services sync with your system. Default is 30 days.
Max number of days before deleting inactive Outlook client subscriptions. We recommend you keep this to the default unless you absolutely need to change it, be mindful of keeping the tracking info too long, or deleting it too soon.
The number of days to temporarily store Excel exported Office Document Records. 30 days max was selected arbitrarily as this is only a cache. Must be at least 2.
If value is 0, don't store ANY Mailbox Statistics data, if the value is greater than zero then store that number of days statistics data. Max value arbitrarily chosen is 1 year, this generates at lot of data so 1 year should be plenty of time.
The number of days to temporarily store Office Document Records. 30 days max was selected arbitrarily as this is only a cache.


These settings can be retrieved updated using OrgDBOrgSettings command line tool described in this KB article or OrgDBOrgSettings Solution.

Hope this helps!

Bhavesh Shastri