What exactly does an Exchange 2007 online defragmentation of the database do? Is there a way to reduce the size of the database without doing an offline defragmentation?
Hello,I'm having a little trouble wrapping my head around how the Exchange database is defragmented and how space is freed up. Lately I've been noticing that our database just keeps growing a couple gigs every week or two. We are a smaller organization with only a couple hundred mailboxes, so I don't think our mailbox database should be growing that quickly. I've even setup a Managed Folder Mailbox policy that deletes items in the Deleted Items folder that are older than 30 days. Under the mailbox database "Limits" tab I have set "Keep deleted items for" to 0 days.We are running Exchange 2007 and have an online maintenance plan that runs on the mailbox database from 10:00pm to 8:00am every night. The plan never completes a full pass in that time period because it takes 10.5 hours to complete. The exchange database is backed up every night as well during this same time period. Every day I get an event ID 1221 that tells me how much free space there is after online defragmentation has completed. According to Microsoft KB256352 "online defragmentation recovers disk space but does not reduce the size of an .edb database file". So my first question is if an online defrag doesn't reduce the size of the .edb file isn't it still taking up that extra diskspace, therefore reducing the amount of free space on the drive? Second, say if yesterday's event ID 1221 says 200MB of space was freed and today's event ID 1221 says 500MB of space was freed. Does that mean there is now 700MB of free space available, and only an offline defrag will free that up? Or does it mean the 200MB of yesterday was truly freed, increasing the amount of available space on the disk and that now another 500MB has been freed and the space made available on the disk?Finally, in this day and age, is there any other way to reduce the size of the database and free up space on a disk besides performing an offline defrag? I'm sure there are organizations out there that have database sizes in the terabytes, and performing an offline defrag for them would involve significant downtime.Thanks!Bryan
October 8th, 2009 10:12pm

Do not run backups the same time as online maintenance. Online Maint is a low-priority task and will not run if backups are running at the same time. It's very important that online maintenance be allowed to run and complete. There is no need to run online maint that long. The default of 1-5AM is sufficient. Event 1221 reports the total amount of white space available in the store: http://support.microsoft.com/kb/555323 Note that online maint does not free up space on disk, only space within the database. The database file size on disk does not change. You should run ExBpa against this server. THe best way to gain back the free space is typically not to worry about as it will eventually be recovered. If you really want to shrink the file size on disk, the best way is to create a new store and move all the mailboxes to it and then delete the original source store.More info:http://technet.microsoft.com/en-us/library/aa996398(EXCHG.65).aspxhttp://technet.microsoft.com/en-us/library/aa996226(EXCHG.65).aspx
Free Windows Admin Tool Kit Click here and download it now
October 8th, 2009 11:20pm

Thanks for the reply Andy. KB555323 was especially helpful.Bryan
October 9th, 2009 6:02pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics