I have an Exchange 2019 server which is running fine but ideally I would like to run offline defrag on an archive database that is now way bigger than it needs to be after removing a mailbox which, due to an errant import, copied many times more data to the archive than actually existed in the mailbox.
Name DatabaseSize AvailableNewMailboxSpace
---- ------------ ------------------------
Archives 50.13 GB (53,821,308,928 bytes) 49.8 GB (53,472,526,336 bytes)
Problem is, the databases are not accessible (Administrator gets a permissions error even trying to browse to them), and I'd rather not mess with permissions on Exchange folders unless I have no choice - or following Microsoft documented procedures.
What's the correct process these days to do any sort of recovery/maintenance directly on the database files when Exchange is by default set up to only allow access to itself? Is eseutil
even supported anymore or do they not recommend touching the edb files at all?
When and where did you encounter this permission issue? When you run cmdlets which is related with database(e.g. Get-MailboxDatabase, Dismount-Database) or in other scenarios?
Make sure your current account has the permission to manage database: Mailbox database permissions
As far as I know, you could use eseutil tool to check the header of your corrupted database and repair your database when the
State
in the header shows "Dirty Shutdown". More details about how to use ESEUTIL to repair your database: Repair your Database with ESEUTILBesides, if you want to shrink the size of your databases, the following actions are recommended rather than offline defragmentation of the database via ESEUTIL:
Create a new database and associated database copies.
Move all mailboxes to the new database.
Delete the original database and its associated database copies.
The following related blog is for your reference: How to reclaim the whitespace
Edit: Location to modify permissions of database folders:
As Ivan_Wang suggested all the points, but There are some prerequisites before using eseutil:
Make a copy of your database before using eseutil.
Verify that you have sufficient space like equivalent of 20% of the database size.
Run Eseutil/P mode.
Run Eseutil /D mode.
Run Isinteg in -fix -test alltests mode.
Refer this: https://techcommunity.microsoft.com/t5/exchange-team-blog/repairing-exchange-databases-with-eseutil-when-and-how/ba-p/610276
https://community.spiceworks.com/how_to/168508-how-to-repair-exchange-databases-with-eseutil-when-and-how