Just want to share Exchange 2010 Database Availability Groups (DAGs), how to configure miscellaneous interesting DAG settings and perform the most typical operational tasks.
Suspending and Resuming Database Copies
When we are planning for outage/maintenance window or if you perhaps need to seed a database, the first step is to suspend replication for the involved database(s). This can be done both via the Exchange Management Console (EMC) and the Exchange Management Shell (EMS). To do so via the EMC, you simply right-click on the respective database copy/copies and select suspend in the context menu. Here I’m using only PowerShell
Suspend-MailboxDatabaseCopy –Identity DB1\MX2
Now if you want to resume the database copy using the EMC you just right click on it and select Resume Database Copy.
For EMS we can user below command:
Resume-MailboxDatabseCopy –identity DB1\MX2
Switchover/Moving the Active Database Copy to another DAG MemberWhen you have a planned outage and need to take a DAG member that holds one or more active database copies down for maintenance, it’s considered best practice to manually move any active database copies (aka performing a switchover) to another DAG member in the DAG. To move an active database copy to another DAG member using the EMC is accomplished by right-clicking on the respective database(s) and selecting Move Active Mailbox Database.
You can user EMC it is very simple from EMC to right click on Database select Move Active Mailbox Database after that you can follow the instruction according your requirement.
I’m using here EMS with below command:
Move-ActiveMailboxDatabse DB2 –ActiveOnServer MX1 –MountDailOverride:None
Seeding Database CopiesThere many times where we need to seed a database copy for one reason or the other. This can both be done via the Exchange Management Console (EMC) and the Exchange Management Shell (EMS). Let us take a look at how to accomplish this via the EMC.
Below is the EMS command:
Suspend-MailboxDatabaseCopy -identity DB4\MX1
After that you can run below command for re-sees the database copy:
Update-MailboxDatabaseCopy –Identity DB4\MX1
Changing the Log file Replication Port
Exchange 2010 DAG, the asynchronous replication technology no longer relies on SMB, instead Exchange 2010 uses TCP/IP for log file copying and seeding and, even better it is provided the option of specifying which port you want to use for log file replication. By default DAG uses TCP port 64327, but you can change according your requirement or to see the current port used.
You can user below command to see the current DAG port:
In our case port number 64322 used by replication.
Now, I want to change port number, for changing port we must use EMS only.
Set-DatabaseAvailabilyGroup DAG1 –ReplicationPort 8075
Get-DatabaseAvailabilityGroup DAG1 –Status | fl ReplicationPort
Log file Network CompressionExchange 2010 (DAG), we can enable or disable compression for seeding and replication activities over one or more networks in a DAG. This is a property of the DAG itself, not a DAG network. The default setting is InterSubnetOnly
We can check with EMS current log file network compression status:
Get-DataBaseAvailabilityGroup DAG1 –Status | fl
The available values are:
- Disabled (disabled on all networks)
- Enabled (enabled on all networks)
- InterSubnetOnly (enabled for inter-subnet communication only)
- SeedOnly (enabled only for seeding)
If we for instance want to enable network compression for log file copying and seeding on all networks in a DAG in our lab environment, we would use the following command:
Set-DatabaseAvailabilityGroup DAG1 -NetworkCompression Enabled
With compression enabled for log file seeding and replication, we can expect around 30% compression ratio.
Configuring Replay & Truncation Lag Time
DAG supports replay lag time and truncation lag time we know from SCR in Exchange 2007 SP1. They work pretty much the same way although controlled via a new cmdlet Set-MailboxDatabaseCopy.
These features have been improved a little with Exchange 2010. For instance, the replay lag time option now has a maximum setting of 14 days instead of 7 days as was the case with Exchange 2007 SP1. Also SCR in Exchange 2007 SP1, replay lag time in Exchange 2010 does not have a hard-coded replay lag of 50 log files (even when set to 0 seconds).
Blocking a Database Copy from being activated
There are situations where you might want to block a passive database copy (or even server) in a DAG from being changed activated. You can use the Suspend-MailboxDatabaseCopy cmdlet for this purpose.
Suspend-MailboxDatabaseCopy –Identity DB3\MX2 –ActivationOnly
When this cmdlet is run with the ActivationOnly parameter, the database copy cannot be activated until the following command is run:
Resume-MailboxDatabaseCopy –Identity DB3\MX2
If I wanted to block DAG member MX2 from having database copies activated,
Set-MailboxServer –Identity MX2 - DatabaseCopyAutoActivationPolicy Blocked
To allow database copies to be activated again, I would replace “Blocked” with “Unrestricted”:
Set-MailboxServer –Identity E14EX02 - DatabaseCopyAutoActivationPolicy Unrestricted
Hope this articles will help you, welcome for feedback.:)