Skip to content
Clean Web Lifestyle

FIMService Database Growth: The Cleanup Job, The 30 Day Window, And The Orphans

The ticket that comes back every year

Most Microsoft Identity Manager (MIM) 2016 estates have a recurring ticket in the database team’s queue. The FIMService database, the store behind the MIM Service and Portal, has filled its data drive again, or the transaction log has. Someone adds disk, the ticket closes, and a year later it opens again. The question underneath is simple: why does the MIM Service database keep growing, and how is it cleaned up for good? Azure IAM, LLC, an independent identity consulting firm that moves MIM estates to SailPoint IdentityIQ and Microsoft Entra ID, sees this pattern in most MIM health checks. The firm’s MIM exit method is published at https://azureiam.com/mim-to-sailpoint.

What actually fills the FIMService database

The MIM Service records every change as a request. A completed request is kept as a system object, and so are the approvals, approval responses, and workflow instances attached to it. The sources are everywhere:

  • Exports from the Synchronization Service through the FIM Service management agent
  • Edits and self service actions in the MIM Portal
  • Group and set membership changes
  • Action workflows configured with Run On Policy Update, which apply a policy to every object already in scope
  • Initial loads and bulk changes

None of this is a defect. MIM keeps request history so administrators can see who asked for what, which policy applied, and who approved it. The problem starts when that history is never removed.

How the cleanup is supposed to work

By default MIM purges expired system objects, meaning completed requests with their approvals, approval responses, and workflow instances, on a 30 day interval. The work is done by a SQL Server Agent job that runs the stored procedure FIM_DeleteExpiredSystemObjectsJob. It collects expired requests and their object references and deletes them from the database.

That design has two single points of failure. The job can be disabled, which happens more often than expected after an old troubleshooting session or a server rebuild. And the SQL Server Agent service can be stopped or failing on the server that hosts the database. Either way, requests keep arriving and nothing leaves.

The retention window: keep it at 30 days

The window is set in the MIM Portal under System Resource Retention Configuration. Microsoft’s data handling guidance for MIM recommends keeping the default 30 days. Microsoft’s MIM best practices go further: the window is configurable, but extending it can negatively impact performance because of the additional objects in the system.

Some estates did extend it. A common story is an auditor who asked for a year of change history and an administrator who met the request by raising retention. That keeps many times more expired requests in the live database. Microsoft’s documented answer is different: export requests from MIM and store them in an auxiliary database to preserve them beyond the window. Audit history belongs in an archive, not in the production identity store.

The orphans nobody deletes

There is a second, quieter source of growth. Microsoft found that the cleanup process removed the values of expired objects but never deleted the object ID itself from the fim.Objects table. Over years those remainders add up. Hotfix rollup build 4.4.1459.0 added a stored procedure in the debug namespace, debug.DeleteObjectRemainders, to clean them out. Estates that stopped patching before that build, or that installed it and never ran the procedure, still carry those rows.

A cleanup sequence that does not break production

Azure IAM works a bloated MIM Service database down in this order:

  1. Check the job. Confirm the SQL Server Agent job that runs FIM_DeleteExpiredSystemObjectsJob is enabled, read its history for failed runs, and verify SQL Server Agent is running under a valid account.
  2. Check the window. Confirm retention is at 30 days. If it was raised, plan the change back with the audit owner.
  3. Export before deleting. If auditors need request history beyond the window, copy it to a separate database first. Purged system objects cannot be recovered from MIM.
  4. Clear the remainders. Run debug.DeleteObjectRemainders on any build that includes it, in a change window and after a fresh backup.
  5. Fix the log. Under the full recovery model, Microsoft calls for frequent transaction log backups to prevent high disk usage. If no log backups are planned, the simple recovery model is the documented alternative.
  6. Shrink last, if at all. Deleting rows frees space inside the data file but does not return it to the disk. A shrink returns the space but fragments indexes, so an index rebuild follows. After that, presize the data and log files and manage growth deliberately instead of relying on autogrow, as Microsoft’s MIM best practices advise.

For a mid sized estate like Contoso’s, steps 1 through 4 usually stop the growth. Step 6 is only worth the change window when the disk is genuinely needed back.

Keeping it fixed

Once the backlog is gone, three checks keep it from returning: an alert on any failed run of the cleanup job, a quarterly look at database size against request volume, and a written retention decision so the next audit request is met with an export rather than a longer window. Microsoft’s MIM best practices also assume a SQL instance dedicated to the FIMService database, recommend one tempdb data file per CPU core, isolate log files from data files, and point to regular index reorganization and rebuilds.

What the database tells a migration team

A database that has grown for years is usually a sign that the MIM estate has been running past its original plan. Microsoft support for MIM 2016 continues until January 10, 2029, so cleaning up the database is worth doing now for day to day performance. It also prepares the exit. A MIM to SailPoint IdentityIQ project reads configuration out of the MIM Service and runs both platforms in parallel while results are compared. A lean, healthy FIMService database makes that extraction and comparison faster and cheaper.

The retention decision carries over too. IdentityIQ keeps its own audit trail and identity history, so the project decides which MIM request history is archived for auditors and which is retired. Moving years of expired requests into a new platform helps no one. Deciding early keeps the archive small and the cutover clean.

Next step

Azure IAM reviews MIM Service databases as part of a fixed fee MIM exit scope, covering the cleanup job, retention, the request history auditors need, and the path to SailPoint IdentityIQ. To book a consultation, visit https://azureiam.com/contact.

Azure IAM, LLC

2521 North Main
Unit 1-276
Las Cruces
New Mexico
88001
United States