Why can't I defragment my SQL 2008 .mdf file?
- by LesterDove
I am defragmenting a badly (95%) fragmented drive upon which large (35 gig) SQL Server 2008 .mdf files live. After defragmenting and viewing the exception report, I see that the production .mdf file that I'm most interested in could not be defragmented. I initially figured it was because MSSQL had an exclusive lock on the file, so I detached it and tried again. No luck - this particular .mdf file could not be defragmented. What am I missing? Most online references suggest that I should be able to file defrag an .mdf
A note: yes, I'm talking about file defragmentation, not index defrag, which is already being done routinely, and which I'll re-run after this.
Thanks! What am I missing?