Programming4us
         
 
 
Applications Server

Exchange Server 2010 : Manage Database Redundancy (part 2) - Manage Database Replication

7/29/2011 5:43:55 PM

2. Manage Database Replication

Databases can be replicated between Mailbox servers in the same DAG. Managing these database replicas is a straightforward process. The information covered in this section will help ensure that your database copies remain healthy.

2.1. Manually Seed a Database Copy

Seeding the database is the act of performing the initial database copy to the target replicas. Once the database copy exists on the replica, it is kept up-to-date with the transaction logs as they are replicated over. Database seeding can take a long time to complete, particularly if you take advantage of the larger database size recommendations with Exchange Server 2010. Therefore, you may decide to seed the replica in advance of creating the database copy or afterward during non-peak hours. There are multiple ways you can manually seed a database copy.

2.1.1. Manual Seeding Through Exchange

When you manually seed the database inside Exchange, the database copy is being done with Exchange resources. If the database is already replicating to the target location, replication needs to be suspended. For steps on suspending database replication, see the section, "Pause Database Replication." If there is an existing database file on the replica, you will need to delete it manually or configure the database to be overwritten during the reseed.

One of the advantages of manually seeding the database is that you can choose which copy of the database provides the source replica. By default, when automatic database seeding occurs the active copy of the database is the source replica. However, Exchange Server 2010 allows you to choose which replica you want to use, even if it's a passive copy of the database.

After you have started seeding a database copy, don't close the EMC or the EMS! If you do, the seeding stops along with it.


You can reseed the database copy with the Update-MailboxDatabaseCopy cmdlet. The parameters that can be used with this command are laid out in Table 2.

Table 2. Parameters for Reseeding a Database in the EMS
ParameterDescription
DeleteExistingFilesIf set to $True, any existing database files will be removed before reseeding.
ManualResumeIf set to $True, replication does not automatically resume after seeding is finished.
SourceServerThe name of the Mailbox server that you want to be used as the source replica for the reseed.

The following example deletes the existing files and uses a passive copy of the database for seeding. Before running this command, replication must be suspended:

Update-MailboxDatabaseCopy DB1\CONTOSO-MB03 -SourceServer 

CONTOSO-MB02 -DeleteExistingFiles:$True

2.1.2. Manual Seeding by Copying the File

In addition to seeding through Exchange, you have the ability to seed the database by hand by simply copying the database to the target replica. To perform this process, you have to dismount the database, which means that the database will be taken offline during the copy.

You can use any method you wish to get the database copy over to the target replica. If you are going to be copying the database to the target replica through a file share, I recommend that you use robocopy.exe instead of just performing a drag-and-drop in Windows Explorer.

You can use the following steps to seed the database by hand:

  1. Suspend the database copy if it is already replicating. See the next section, "Pause Database Replication," for steps on how to do this.

  2. Dismount the active copy of the database.

  3. On the server that you are reseeding the database to, log in and delete the database file and the log files on the server.

  4. Copy the database file from the source server to the target server that hosts the passive copy.

  5. Mount the Mailbox database on the source copy.

  6. Resume replication of the database.

2.2. Pause Database Replication

At any time, you may want to temporarily stop the replication of a database copy. Suspending replication is required if you want to perform a reseed, and it's a recommended practice before performing other database maintenance activities, such as moving the location of database files. The following order is usually followed:

  1. Stop database replication.

  2. Perform maintenance on database.

  3. Resume database replication.

2.2.1. Stop Database Replication

You can stop database replication in the EMC using the following steps:

  1. Open the EMC and browse to the Organization Configuration => Mailbox node in the Console tree.

  2. Click the Database Management tab in the Work area. Select the database that you want to stop replication for.

  3. In the list of database copies in the bottom pane of the Work area, select the database copy that you want to stop replication to.

  4. In the Action menu for the database copy that you selected, click the Suspend Database Copy option, as shown in Figure 9.

    Figure 9. Stopping a database copy in the EMC
  5. The Administrative Suspend dialog box will appear, asking you if you are sure that you want to continue. You can optionally type in a reason for why you are suspending the copy in the Comment box in the dialog box. You may want to enter a comment here in case another administrator notices that replication is suspended and tries to resume it. When the other administrator attempts to resume replication, they will be presented with the comment that you made in the confirmation dialog box and given the option of not continuing. When you are ready to stop the copy, click the Yes button.

You can also use the Suspend-MailboxDatabaseCopy cmdlet to stop database replication. The following example suspends the copying of the database DB1 to the server CONTOSO-MB03:

Suspend-MailboxDatabaseCopy DB1\CONTOSO-MB03

2.2.2. Resume Database Replication

After maintenance has been performed on the Mailbox database, you can resume replication to the target replica. To resume replication in the EMC, follow these steps:

  1. Open the EMC and browse to the Organization Configuration => Mailbox node in the Console tree.

  2. Click the Database Management tab in the Work area. From the list of databases, select the database that you want to resume replication for.

  3. The list of database copies is propagated in the bottom pane of the Work area. Find the database copy that you want to resume replication for. The Copy Status should read Suspended. Select this database copy.

  4. From the Action menu of the database copy, select the Resume Database Copy option, as shown in Figure 10.

    Figure 10. Resuming the replication of a database copy
  5. The Administrative Resume dialog box will appear, asking you if you are sure that you want to continue. This dialog box also displays the comment that the person who suspended the database copy typed in. If you want to continue, click the Yes button to resume replication.

The Resume-MailboxDatabaseCopy cmdlet in the EMS can also be used to resume database replication. The following example resumes replication of the database copy that we previously stopped:

Resume-MailboxDatabaseCopy DB1\CONTOSO-MB03

2.3. Modify the Replication Settings of a Database

There are some settings associated with a database copy that affect how the database handles logs and failover. For handling transaction logs, you should be aware of two primary settings:


Replay Lag Time

This setting determines how many minutes must pass before the replicated log is replayed into the passive copy of the database. This is disabled by default, but you can enable it if you are concerned about replaying a corrupted log into your database copy.


Truncation Lag Time

This setting specifies how many minutes to wait before deleting the transaction logs. The countdown of the truncation lag time starts after the transaction log has successfully replayed into the database.

You can also use the EMS to configure these setting by specifying the correct parameter on the Set-MailboxDatabaseCopy cmdlet. Table 3 displays these parameters and their options.

Table 3. EMS Parameters for Database Copy Settings
ParameterDescriptionPossible Values
ReplayLagTimeThe amount of time that passes before logs are replayed into the passive copy of the database.A time-based value of up to 14 days in the format of Days.Hours:Minutes:Seconds. For example, 1 day would be 1.0:0:0.
TruncationLagTimeThe amount of time that must pass before a log file can be deleted on a database copy.A time-based value of up to 14 days. This value should be in the format of Days.Hours:Minutes:Seconds. For example, 12 hours and 34 minutes would be 0.12:34:00.

The following example adjusts the replay lag time of a database copy to 1 day and sets the truncation lag time to 1 week:

Set-MailboxDatabaseCopy DB1\CONTOSO-MB03 

-ReplayLagTime 1.0:0:0

-TruncationLagTime 7.0:0:0

2.4. View the Current Status of Replication

If you want to retrieve statistics on your database copies, you can use the Get-MailboxDatabaseCopyStatus cmdlet. This cmdlet will present information about your database copies that you can use to determine what state they are in and what the overall health is.

When you run this command from the EMS, the following types of status information is gathered:

  • The health of the copy status

  • The name of the server that holds the active database copy

  • The number of logs in the replay queue

  • The last time backups were completed against the database

The following command will display the status of a database copy and all the information available in a list:

Get-MailboxDatabaseCopyStatus DB01\CONTOSO-MB02 | fl

You can also gather information about multiple database copies. The following command will display the database, the name of the active server, and the health of the database copies in a table:

Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | ft 

Name, Status, ActiveDatabaseCopy
Other -----------------
- Extending Microsoft Dynamics CRM 4.0 : Customization Options by CRM Version & Customizing Navigation
- Extending Microsoft Dynamics CRM 4.0 : Limitations and Licensing Considerations
- Microsoft Dynamics AX 2009 : Working with Forms - Creating dynamic menu buttons
- Microsoft Dynamics AX 2009 : Working with Forms - Handling dialog events
- Microsoft Dynamics AX 2009 : Working with Forms - Creating Dialogs
- Performing On-Demand Exchange Server 2003 Monitoring and Maintenance
- Performing Scheduled Exchange Server 2003 Monitoring and Maintenance (part 2) - Using Performance and Protocol Logs and Managing Mailbox Limits
- Performing Scheduled Exchange Server 2003 Monitoring and Maintenance (part 1)
- Microsoft Dynamics GP 2010 : Populating Initial Data - Inventory items
- Organizing Artifacts in BizTalk Server 2009
- Application Lifecycle Management with BizTalk Server 2009
- Exchange Server 2010 : Manage Outlook Client Access (part 2) - Configure Automatic Client Configuration & Configure Access for Third-Party Clients
- Exchange Server 2010 : Manage Outlook Client Access (part 1) - Configure Outlook Anywhere
- Understanding and Installing Active Directory Rights Management Services (part 3)
- Understanding and Installing Active Directory Rights Management Services (part 2) - Installation Procedure
- Understanding and Installing Active Directory Rights Management Services (part 1) - Understanding AD RMS
- Microsoft Dynamics GP 2010 : Populating Initial Data - Open receivables transactions
- Microsoft Dynamics GP 2010 : Populating Initial Data - Customers
- Exchange Server 2010 : Manage Access for Mobile Devices (part 4) - Monitor Mobile Device Usage
- Exchange Server 2010 : Manage Access for Mobile Devices (part 3) - Protect Mobile Devices
 
 
Most View
- Processing and Storing Data in SQL Server 2005 : Updating the FileWorker Class
- Windows Server 2008 : Configuring Terminal Services Clients
- SQL Server 2012 : T-SQL Enhancements - The INSERT OVER DML Syntax (part 2) - Consuming CHANGES
- BizTalk Server 2009 : Service-oriented schema patterns (part 2) - Canonical schemas
- Adding iPad to the Mix
- Microsoft Dynamic GP 2010 : Payables Management (part 3) - Purchasing E-mail setup, Vendors
- Create a SharePoint Group for a Site
- Processing and Storing Data in SQL Server 2005 : Data Tracking Validation
- SQL server 2012 : T-SQL Enhancements - The GROUPING SETS Operator (part 2) - Mixing and Matching, Handling NULL Values
- Microsoft XNA Game Studio 3.0 : Adding Bread to Your Game (part 1) - Using a Structure to Hold Sprite Information, Using the Gamepad Thumbsticks to Control Movement
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS