Exchange 2010 SP1: DAG Node Maintenance
If you are performing maintenance on DAG nodes here is the process you want to go through (along with a slight caveat to fix a possible active copy move issue you may run into). In my environment I have three nodes in a cross-site dag.
All the commands below are run in an administrative exchange powershell prompt.
Process for running maintenance on exchange database servers
& "C:\Program Files\Microsoft\Exchange Server\V14\scripts\StartDagServerMaintenance.ps1" -ServerName <Dag Node 1>
- Run maintenance on <Dag Node 1>
& "C:\Program Files\Microsoft\Exchange Server\V14\scripts\StopDagServerMaintenance.ps1" -ServerName <Dag Node 1>
& "C:\Program Files\Microsoft\Exchange Server\V14\scripts\StartDagServerMaintenance.ps1" -ServerName <Dag Node 2>
- run maintenance on <Dag Node 2>
& "C:\Program Files\Microsoft\Exchange Server\V14\scripts\StopDagServerMaintenance.ps1" -ServerName <Dag Node 2>
& "C:\Program Files\Microsoft\Exchange Server\V14\scripts\StartDagServerMaintenance.ps1" -ServerName <Dag Node 3>
- run maintenance on <Dag Node 3>
& "C:\Program Files\Microsoft\Exchange Server\V14\scripts\StopDagServerMaintenance.ps1" -ServerName <Dag Node 3>
When done performing maintenance on one or multiple servers (hopefully one at a time to maintain full database availability for end users!) you can end up with a sub-optimal active database layout, especially if you have a cross-site DAG. To resolve this you have to rebalance the databases based on the priorities set for them upon creation.
Rebalance databases across dag
& “C:\Program Files\Microsoft\Exchange Server\V14\scripts\RedistributeActiveDatabases.ps1” -DagName <Your DAG Name> -BalanceDbsByActivationPreference -ShowFinalDatabaseDistribution -Confirm:$false
If you get any errors you may have to re-index the search catalog for the passive database. Rather than hunting down which ones need to be fixed you can just fix them all with the custom script I wrote below (or for only the mail servers with issues). When finished running these commands then try to run the maintenance or rebalance scripts again.
Fix/Rebuild Search Catalogs
Get-MailboxDatabaseCopyStatus -Server <Dag Node 1> | where {$_.Status -like "Healthy"} | Update-MailboxDatabaseCopy -catalogonly
Get-MailboxDatabaseCopyStatus -Server <Dag Node 2> | where {$_.Status -like "Healthy"} | Update-MailboxDatabaseCopy -catalogonly
Get-MailboxDatabaseCopyStatus -Server <Dag Node 3> | where {$_.Status -like "Healthy"} | Update-MailboxDatabaseCopy -catalogonly