Sunday, September 2, 2007

Calculate amount of disk space to be reclaimed by Offline Defrag

By using the command eseutil /ms, we can calculate the exact amount of disk space that can reclaimed by doing the offline defrag. Here are the steps:

1) Run eseutil /ms command from the bin directory on the dismounted database. It will always be run on the edb file.

2) The first section of the space report is the SLV SPACE DUMP. This reports on free space in the streaming database file (.stm).
TOTALS:
Free: 1528814
Reserved: 2238
Deleted: 228
Committed: 11888
Unknown: 0
There are 1528814 free pages in the .stm file, and each page is 4096 bytes in length. Therefore, there are 6,262,022,144 bytes of empty space in the file (1528814 x 4096).

3) As for the EDB file dump you'll see the following information in the last line in the column 'Available'

-------------------------------------------------------------------------------
3244272

The number at the lower right of the output (3244272) is the total of all free pages in the database. If you multiply this number by 4096, you will see that defragmenting this database will recover 12.3 gb of space.

4) Hence, based on the above example you will recover 12.3 GB + 6GB after you do the offline defrag.(this is including the STM also)