Offline defrag a replica database…

Let’s leave the “ why would you? ” to one side for the moment but is it actually possible or supported to defrag a continuous replication target database?  Well not surprisingly er ‘No’.  An offline defrag creates a new database with a new signature (“When defragmentation is complete, the original database is deleted or saved to a user-specified location, and the new version is renamed as the original.”) and therefore whilst it will be possible to defrag the database you’ll break replication. So if you know that you have a large amount of whitespace that it is possible to claw back (maybe you have just reorganised your mailboxes across a larger set of mailbox databases?) and you want to run an offline defrag then you need to defrag the active database and reseed a replica… In my experience there aren’t many reasons to perform an offline defrag and so the relative pain of this process should not be one that many administrators have to follow.  And of course if your LUNs and disk set up allows it might be preferable to create a new database, seed it and then move all the mailboxes from the original database to this new one. Try this article on Technet for the steps to see a CCR database; How to Seed a Cluster Continuous Replication Copy...(read more)