Monday, November 17, 2014

Rebuild Database Availability Group-Exchange 2010

Microsoft introduced Database Availability Group in Exchange server 2010, it is all about the high availability feature.
Database Availability Group, together with mailbox database copies, storage, network and other hardware failure. DAG can provide the site resilience solution so that we can do the datacenter switchover in site level disaster.

Assume, you have only one datacenter with two member DAG.  If the datacenter experience some natural disaster such as flood, fire etc. and destroy the entire Datacenter, now you have to plan to rebuild the Exchange environment from scratch and rebuild the DAG.

I will describe how we can rebuild DAG from scratch.

My LAB Details:

I have two member DAG name called DAG1
Domain Name-
First Mailbox Server Name – MX1
Second Mailbox Server Name- MX2
Database Availability Group Name- DAG1
Databases Name –DB1, DB2, Db3, DB4 & DB5

Following are the steps we need to perform to recover the DAG:

Prepare Active Directory
First of all we have to prepare Active Directory environment to introduce of Server with the same name. We have to open Active Directory Users and Computers and Re-Set & Disable the computer account because Exchange 2010 drive security permissions based on the computer account for each server.
  1. Open Active Directory Users and Computer and select the computer account for each DAG member.
  2. Right click the computer account for MX1 and select All tasks and then select Reset Account.
  3. Again Right Click the computer account for MX1 select All Tasks and then Disable Account and click on Yes and then click Ok.
  4. Repeat same steps (2 &3) for MX2)

Now you can wait for Active Directory replication, once replication complete, we can build Windows Server with name MX1 and MX2.

Prepare the DAG’s Cluster Name Object (CNO)

DAG has an underlying the Windows failover cluster, when we are giving the name of the cluster and corresponding cluster name object is create on Active Directory. It is equivalent of a computer account for a cluster.
The CNO is used by internal DAG communication for secure DAG, Now we have also need to re-set & disable the CNO from Active Directory users and computers.
  1. Open Active Directory Users and Computers and select the CNO (DAG1)
  2. Right click the computer account for DAG1, and All Task and then select the Reset Account.
  3. Right Click the computer account for DAG1 select All Task and then Disable Account, and select yes and click on Ok.

Wait for Active Directory replication complete.

Remove Database Copies from the DAG
Now we have to remove the database copies from the DAG, we must have the remove all mailbox database copies from the server once you remove the database you must remove the mailbox server from DAG:
  1. Remove –mailboxDatabaseCopy –Identity DB2\MX1 –Confirm:$false
  2. Remove –mailboxDatabaseCopy –Identity DB1\MX2 –Confirm:$false
Once you complete the above cmdlet, we can verify the each mailbox database has single copy. We can use following cmdlet to verify:
  1. Get-MailboxDatabase –Server MX1 | Format –List Name,DatabaseCopies
  2. Get-MailboxDatabase –Server MX2 | Format –List Name,DatabaseCopies
Remove the Mailbox Servers from the DAG
Next step to remove the Mailbox servers from the DAG, we can use following cmdlet for removing the Mailbox servers from DAG:
  1. Remove –DatabaseAvailabilityGroupServer _identity DAG1 –Mailboxserver MX1 –ConfigurationOnly:$true –Confirm:$false for Mailbox server one.
  2. Remove –DatabaseAvailabilityGroupServer _identity DAG1 –Mailboxserver MX2 –ConfigurationOnly:$true –Confirm:$false for mailbox server two.
Once command complete, we can verify with following cmdlet:
  • Get-DatabaseAvailabilityGroup –Identity DAG1 | Format-List Servers

Rebuild the Mailbox Servers
Now we have to rebuild the servers using with same computer name and the same operating system version. As you know the server recovery process is based on the name of the computer on which setup is run.
  1. Install and configure the Windows Server.
  2. Rename the computer with the appropriate name.
  3. Join the computer to the Active Directory domain
  4. Install all Exchange prerequisites on servers.
Recover Server
Once we have servers are built and ready for Exchange server recovery, next step to run the Exchange 2010 unattended setup process in recovery mode:
  1. Open command prompt and navigate to the Exchange 2010 installation files.
  2. Run “Setup /m:RecoverServer” command.
  3. Once setup is complete successfully, restart the recovered server to complete the recovery process.
Restore or Mount the Mailbox Database
If you have files on disk are preserved and in original location or copied to the original location, we should only user mount database with cmdlet. If we do not have database alternatively, we can restore database from the backup to the original location and then mount the databases.
  1. Mount-Database –Identity MX1\DB1
Add Mailbox Servers to the DAG
Now we have to add mailbox servers to a DAG with following cmdlet:
  1. Add-DatabaseAvailabilityGroupServer –Identity DAG1 –MailboxServer MX1
  2. Add-DatabaseAvailabilityGroupServer –Identity DAG1 –MailboxServer MX2
Once complete, we can verify the DAG with following cmdlet
  • Get-DatabaseAvailabilityGroup –Identity DAG1 | Format-List Servers
Add Mailbox Database Copies to the DAG
Final steps, we need to add mailbox database copies back to the appropriate DAG member.
  1. Add-MailboxDatabaseCopy  -Identity DB1 –MailboxServer MX2
  2. Add-mailboxDatabaseCopy –Identity DB2 –MailboxServer MX1
Once cmdlet complete, we can verify with following command:
  • Get-MailboxDatabase | Format –List Name,DatabaseCopies

 Hope, this will knowledgeable articles.

 Welcome for feedback!

1 comment: