I found this up on BlankMan's Blog and it's damm cool.
... One of the frustrating realities about OST files is that they become progressively slower as they become older. One of the factors influencing this is fragmentation.
As the Exchange Team blog says: "We usually recommend no more than about 2500 - 5000 messages in any of the critical path folders. The critical path folders are the Calendar, Contacts, Inbox, and Sent Item folder. Ideally, keep the Inbox, Contacts and Calendar to 1000 or less. Other folders, particularly custom folders created by the user, can handle having larger numbers of items without having a broad impact on the user experience (20,000 items in my "Cookie Recipes" folder? No problem - except when I need to find that recipe from last Christmas!)."
So the more folders, the slow thing go ... so BlankMan used Contig.exe from Sysinternals to defrag is OST :-|. Contig is a single-file defragmenter that attempts to make files contiguous on disk and is perfect for quickly optimizing files that are continuously becoming fragmented, or that you want to ensure are in as few fragments as possible.
The syntax for Contig.exe:
Contig v1.54 - Makes files contiguousCopyright (C) 1998-2007 Mark RussinovichSysinternals - http://www.sysinternals.com/
Contig is a utility that relies on NT's built-in defragging supportto make a specified file contiguous on disk. Use it to optimize executionof your frequently used files.
Usage: d:\utils\Contig\Contig.exe [-v] [-a] [-s] [-q] [existing file]or d:\utils\Contig\Contig.exe [-v] -n [new file] [new file length]
-v: Verbose -a: Analyze fragmentation -q: Quiet mode -s: Recurse subdirectories
So lets check out my OST:
C:\>d:\utils\Contig\Contig.exe outlook0.ost -a
Processing outlook0.ostoutlook0.ost is in 42 fragments
Summary: Number of files processed : 1 Average fragmentation : 42 frags/file
d:\utils\Contig\Contig.exe outlook.ost -a
Processing C:\outlook.ost C:\outlook.ost is in 61 fragments
Summary: Number of files processed : 1 Average fragmentation : 61 frags/file
so time to defrag
C:\>d:\utils\Contig\Contig.exe outlook.ost
Processing C:\outlook.ost
Summary: Number of files processed : 1 Number of files defragmented: 1 Average fragmentation before: 61 frags/file Average fragmentation after : 1 frags/file
Kewl, now lets check it outC:\d:\utils\Contig\Contig.exe outlook.ost -a
Processing outlook.ostC:\outlook.ost is defragmented
Summary: Number of files processed : 1 Average fragmentation : 1 frags/file
Kewl ;-) Thanks BlankMan!
Or even simpler - just delete the OST occasionally and let it recreate it - that will have the added benefit of comressing it as well if the amount of offline data has shrunk
How to Avoid Exchange 2007 SP1 Rollup Installation Problems Exchange Server News: Rollup Roundup Gartner