Every so often people ask us - "How often do you recommend we run the offline defrag?" Meaning - how often do we run it to have the server run OK?
The short answer would be - we do NOT recommend this to be run as any type of "regular" maintenance at all.
Looking at this closer - what really happens when you do an offline defrag?
Seeing that we have a new database, we have new database signatures. That then means that transaction logs from that point on will have this new database attached to them. So - if you needed to do a restore a backup before the defrag and play in the transaction logs up to the current log - you would have problems, as transaction logs now talk about new databases (based on the signatures) and not the ones that you restored, right? Their signatures will not match and you will not be able to reply the data back in.
There is no real way around this. It is as if you had created a brand new database. It no longer has any relation to the old database, except for having the same stuff in it. You might as well have moved mailboxes to a new database.
Long story short - if you need to defrag - do it - but make SURE that you perform a good full (online) backup immediately after that!
Because of the above - offline defrag is definitely not something to do on regular basis. And it is typically not needed either.
So when DO we recommend defrag? There are a few situations:
Some related reading:
256352 Online Defragmentation Does Not Reduce Size of .edb Files
255035 XADM: How to Recover Hard Disk Space from Exchange Server Databases
Best Practices for Exchange Database Management whitepaper:
- Nino Bilic