管理邮箱数据库副本Manage mailbox database copies

在 Exchange Server 中,可以使用 Exchange 管理控制台 (EAC) 或 Exchange 命令行管理程序 在创建、配置并使用邮箱服务器成员填充数据库可用性组 (DAG) 后添加邮箱数据库副本。In Exchange Server, you can use the Exchange Management Console (EAC) or the Exchange Management Shell to add mailbox database copies after a database availability group (DAG) has been created, configured, and populated with Mailbox server members.

管理数据库副本Managing database copies

创建数据库的多个副本后,可以使用 EAC 或 Exchange 命令行管理程序监视每个副本的运行状况和状态,并执行与数据库副本关联的其他管理任务。After multiple copies of a database are created, you can use the EAC or the Exchange Management Shell to monitor the health and status of each copy and to perform other management tasks associated with database copies. 您可能需要执行的某些管理任务包括挂起或恢复数据库副本、为数据库副本设定种子、监视数据库副本、配置数据库副本设置以及删除数据库副本。Some of the management tasks you may need to perform include suspending or resuming a database copy, seeding a database copy, monitoring database copies, configuring database copy settings, and removing a database copy.

挂起和恢复数据库副本Suspending and resuming database copies

出于各种原因(如执行计划维护)可能需要挂起和恢复数据库副本的连续复制活动。For a variety of reasons, such as performing planned maintenance, you may need to suspend and resume continuous replication activity for a database copy. 此外,某些管理任务(如种子设定)要求您首先挂起数据库副本。In addition, some administrative tasks, such as seeding, require that you first suspend a database copy. 建议您在更改数据库的路径或日志文件时挂起所有复制活动。We recommend that you suspend all replication activity when the path for the database or its log files is being changed. 通过使用 EAC 或在 Exchange 命令行管理程序 中运行 Suspend-MailboxDatabaseCopyResume-MailboxDatabaseCopy cmdlet,可以挂起和恢复数据库副本活动。You can suspend and resume database copy activity by using the EAC, or by running the Suspend-MailboxDatabaseCopy and Resume-MailboxDatabaseCopy cmdlets in the Exchange Management Shell. 有关如何挂起或恢复数据库副本的连续复制活动的详细步骤,请参阅 挂起或恢复邮箱数据库副本For detailed steps about how to suspend or resume continuous replication activity for a database copy, see Suspend or resume a mailbox database copy.

为数据库副本设定种子Seeding a database copy

种子 设定(也称为更新)是一个过程,在此过程中,空白数据库或生产数据库的副本将添加到与活动数据库相同的 DAG 中其他邮箱服务器的目标副本位置。Seeding, also known as updating, is the process in which either a blank database or a copy of the production database, is added to the target copy location on another Mailbox server in the same DAG as the active database. 这将成为该服务器维护的副本的基线数据库。This becomes the baseline database for the copy maintained by that server.

根据情况,可以使用自动过程或启动的手动过程为数据库设定种子。Depending on the situation, you can seed a database by using an automatic process or a manual process that you initiate. 添加数据库副本时,将自动设定副本种子,但前提是正确配置了目标服务器及其存储。When a database copy is added, the copy will be automatically seeded, provided that the target server and its storage are properly configured. 如果要手动为数据库副本设定种子,并且不希望在创建副本时自动设定种子,可以在运行 Add-MailboxDatabaseCopy cmdlet 时使用 SeedingPostponed 参数。If you want to manually seed a database copy and don't want automatic seeding to occur when creating the copy, you can use the SeedingPostponed parameter when running the Add-MailboxDatabaseCopy cmdlet.

数据库副本很少需要在初始种子设定后重新设定种子。Database copies rarely need to be reseeded after the initial seeding. 但是,如果需要重新设定种子,或者希望手动为数据库副本设定种子,而不是让系统自动为副本设定种子,则有两个选项。However, if reseeding is necessary, or if you want to manually seed a database copy instead of having the system automatically seed the copy, you have two options. 可以使用 EAC 中的"更新邮箱数据库副本"向导,或者使用 Exchange 命令行管理程序 中的 Update-MailboxDatabaseCopy cmdlet 对数据库重新进行Ese。You can reseed a database by using the Update Mailbox Database Copy wizard in the EAC or by using the Update-MailboxDatabaseCopy cmdlet in the Exchange Management Shell. 在为数据库副本设定种子之前,必须首先挂起邮箱数据库副本。Before seeding a database copy, you must first suspend the mailbox database copy. 有关如何为数据库副本设定种子的详细步骤,请参阅 更新邮箱数据库副本For detailed steps about how to seed a database copy, see Update a mailbox database copy.

在完成手动设定种子操作之后,将自动恢复对已设定种子的邮箱数据库副本的复制。After a manual seed operation has completed, replication for the seeded mailbox database copy is automatically resumed. 如果不希望自动恢复复制,则可以在运行 Update-MailboxDatabaseCopy cmdlet 的同时使用 ManualResume 参数。If you don't want replication to automatically resume, you can use the ManualResume parameter when running the Update-MailboxDatabaseCopy cmdlet.

选择要设定的种子Choosing what to seed

执行种子设定操作时,可以选择为邮箱数据库副本、邮箱数据库副本的内容索引目录或数据库副本和内容索引目录副本设定种子。When you perform a seed operation, you can choose to seed the mailbox database copy, the content index catalog for the mailbox database copy, or both the database copy and the content index catalog copy. 更新邮箱数据库副本向导和 Update-MailboxDatabaseCopy cmdlet 的默认行为是同时为邮箱数据库副本和内容索引目录副本设定种子。The default behavior of the Update Mailbox Database Copy wizard and the Update-MailboxDatabaseCopy cmdlet is to seed both the mailbox database copy and the content index catalog copy. 若要只为邮箱数据库副本设定种子而不为内容索引目录设定种子,请使用 DatabaseOnly 参数运行 Update-MailboxDatabaseCopy cmdlet。To seed just the mailbox database copy without seeding the content index catalog, use the DatabaseOnly parameter when running the Update-MailboxDatabaseCopy cmdlet. 若只要为内容索引目录副本设定种子,请在运行 Update-MailboxDatabaseCopy cmdlet 时使用 CatalogOnly 参数。To seed just the content index catalog copy, use the CatalogOnly parameter when running the Update-MailboxDatabaseCopy cmdlet.

选择种子设定源Selecting the seeding source

任何状况良好的数据库副本都可以用作该数据库其他副本的种子设定源。在具有已跨多个物理位置进行扩展的 DAG 时,这特别有用。例如,考虑一下四成员 DAG 部署的情况,其中两名成员(MBX1 和 MBX2)在俄勒冈州的波特兰、另两名成员(MBX3 和 MBX4)在纽约州的纽约市。名为 DB1 的邮箱数据库在 MBX1 上处于活动状态,并在 MBX2 和 MBX3 上有 DB1 的被动副本。将 DB1 的副本添加到 MBX4 后,您可以选择将 MBX3 上的副本用作种子设定源。这样做可以避免通过波特兰和纽约之间的广域网 (WAN) 链路来设定种子。Any healthy database copy can be used as the seeding source for an additional copy of that database. This is particularly useful when you have a DAG that has been extended across multiple physical locations. For example, consider a four-member DAG deployment, where two members (MBX1 and MBX2) are located in Portland, Oregon and two members (MBX3 and MBX4) are located in New York, New York. A mailbox database named DB1 is active on MBX1 and there are passive copies of DB1 on MBX2 and MBX3. When adding a copy of DB1 to MBX4, you have the option of using the copy on MBX3 as the source for seeding. In doing so, you avoid seeding over the wide area network (WAN) link between Portland and New York.

若要在添加新数据库副本时将特定副本用作种子设定源,可以执行以下操作:To use a specific copy as a source for seeding when adding a new database copy, you can do the following:

  • 运行 Add-MailboxDatabaseCopy cmdlet 以添加数据库副本时,请使用 SeedingPostponed 参数。Use the SeedingPostponed parameter when running the Add-MailboxDatabaseCopy cmdlet to add the database copy. 如果不使用 SeedingPostponed 参数,将使用数据库的活动副本作为源对数据库副本进行显式种子设定。If you don't use the SeedingPostponed parameter, the database copy will be explicitly seeded using the active copy of the database as the source.

  • 可以在 EAC 中指定要用作"更新邮箱数据库副本"向导一部分的源服务器,或在运行 Update-MailboxDatabaseCopy cmdlet 时使用 SourceServer 参数指定用于种子设定所需的源服务器。You can specify the source server you want to use as part of the Update Mailbox Database Copy wizard in the EAC, or you can use the SourceServer parameter when running the Update-MailboxDatabaseCopy cmdlet to specify the desired source server for seeding. 在前面的示例中,您会指定 MBX3 作为源服务器。In the preceding example, you would specify MBX3 as the source server. 如果不使用 SourceServer 参数,则从数据库的活动副本中为数据库副本显式设定种子。If the you don' t use SourceServer parameter, the database copy will be explicitly seeded from the active copy of the database.

种子设定和网络Seeding and networks

除了选择用于为邮箱数据库副本设定种子的特定源服务器之外,您还可以使用 Exchange 命令行管理程序 指定要使用哪些 DAG 网络。In addition to selecting a specific source server for seeding a mailbox database copy, you can also use the Exchange Management Shell to specify which DAG networks to use. 在种子设定操作期间,可以选择覆盖 DAG 网络的压缩和加密设置。You have the option to override the DAG network's compression and encryption settings during the seed operation.

在运行 Update-MailboxDatabaseCopy cmdlet 时,可以使用 Network 参数指定要用于种子设定的网络,并指定想要使用的 DAG 网络。You can specify the networks you want to use for seeding by using the Network parameter when running the Update-MailboxDatabaseCopy cmdlet and specify the DAG networks that you want to use. 如果不使用 Network 参数,系统将使用以下默认行为选择要用于种子设定操作的网络:If you don't use the Network parameter, the system uses the following default behavior for selecting a network to use for the seeding operation:

  • 如果源服务器和目标服务器在相同子网上并且已配置包括该子网的复制网络,则将使用该复制网络。If the source server and target server are on the same subnet and a replication network has been configured that includes the subnet, the replication network will be used.

  • 如果源服务器和目标服务器在不同子网上,即使已配置包含这些子网的复制网络,但还是将客户端 (MAPI) 网络用于种子设定。If the source server and target server are on different subnets, even if a replication network that contains those subnets has been configured, the client (MAPI) network will be used for seeding.

  • 如果源服务器和目标服务器在不同数据中心中,则客户端 (MAPI) 网络将用于种子设定。If the source server and target server are in different datacenters, the client (MAPI) network will be used for seeding.

在 DAG 级别 上,将 DAG 网络配置为加密和压缩。At the DAG level, DAG networks are configured for encryption and compression. 默认设置仅对不同子网上的通信使用加密和压缩。The default settings use encryption and compression only for communications on different subnets. 如果源和目标在不同子网上并且以 NetworkCompressionNetworkEncryption 的默认值配置 DAG,则可以在运行 Update-MailboxDatabaseCopy cmdlet 的同时使用 NetworkCompressionOverrideNetworkEncryptionOverride 参数分别覆盖这些值。If the source and target are on different subnets and the DAG is configured with the default values for NetworkCompression and NetworkEncryption, you can override these values by using the NetworkCompressionOverride and NetworkEncryptionOverride parameters, respectively, when running the Update-MailboxDatabaseCopy cmdlet.

种子设定过程Seeding process

使用 Add-MailboxDatabaseCopyUpdate-MailboxDatabaseCopy cmdlet 开始种子设定过程时,将执行以下任务:When you begin a seeding process by using the Add-MailboxDatabaseCopy or Update-MailboxDatabaseCopy cmdlets, the following tasks are performed:

  1. 读取 Active Directory 中的数据库属性以验证指定的数据库和服务器,并验证源和目标服务器是否正在运行 Exchange Server,它们都是同一 DAG 的成员,并且指定的数据库不是恢复数据库。Database properties from Active Directory are read to validate the specified database and servers, and to verify that the source and target servers are running Exchange Server, they are both members of the same DAG, and that the specified database isn't a recovery database. 还读取数据库文件路径。The database file paths are also read.

  2. 从目标服务器上的 Microsoft Exchange 复制服务准备重新设定种子检查。Preparations occur for reseed checks from the Microsoft Exchange Replication service on the target server.

  3. 目标服务器上的 Microsoft Exchange 复制服务会检查数据库和事务日志文件在步骤 1 中由 Active Directory 检查读取的文件目录中是否存在。The Microsoft Exchange Replication service on the target server checks for the presence of database and transaction log files in the file directories read by the Active Directory checks in step 1.

  4. Microsoft Exchange 复制服务将状态信息从目标服务器返回到从其运行 cmdlet 的管理界面。The Microsoft Exchange Replication service returns the status information from the target server to the administrative interface from where the cmdlet was run.

  5. 如果所有初级检查已经完成,则会继续之前提示您确认操作。如果您确认操作,则继续执行该过程。如果在初级检查期间遇到错误,则报告错误,并且操作失败。If all preliminary checks have passed, you're prompted to confirm the operation before continuing. If you confirm the operation, the process continues. If an error is encountered during the preliminary checks, the error is reported and the operation fails.

  6. 从目标服务器上的 Microsoft Exchange 复制服务启动种子设定操作。The seed operation is started from the Microsoft Exchange Replication service on the target server.

  7. Microsoft Exchange 复制服务挂起活动数据库副本的数据库复制。The Microsoft Exchange Replication service suspends database replication for the active database copy.

  8. 由 Microsoft Exchange 复制服务会更新数据库的状态信息,以反映种子设定的状态。The state information for the database is updated by the Microsoft Exchange Replication service to reflect a status of Seeding.

  9. 如果目标服务器已经没有目标数据库和日志文件的目录,则创建它们。If the target server doesn't already have the directories for the target database and log files, they are created.

  10. 将为数据库设定种子的请求从目标服务器上的 Microsoft Exchange 复制服务传递使用 TCP 的源服务器上的 Microsoft Exchange 复制服务。这个为数据库设定种子的请求和后续通信将在已配置为复制网络的 DAG 网络上进行。A request to seed the database is passed from the Microsoft Exchange Replication service on the target server to the Microsoft Exchange Replication service on the source server using TCP. This request and the subsequent communications for seeding the database occur on a DAG network that has been configured as a replication network.

  11. 源服务器上的 Microsoft Exchange 复制服务通过 Microsoft Exchange 信息存储服务界面启动可扩展存储引擎 (ESE) 流式备份。The Microsoft Exchange Replication service on the source server initiates an Extensible Storage Engine (ESE) streaming backup via the Microsoft Exchange Information Store service interface.

  12. Microsoft Exchange 信息存储服务将数据库数据流式传输到 Microsoft Exchange 复制服务。The Microsoft Exchange Information Store service streams the database data to the Microsoft Exchange Replication service.

  13. 数据库数据从源服务器的 Microsoft Exchange 复制服务移动到目标服务器的 Microsoft Exchange 复制服务。The database data is moved from the source server's Microsoft Exchange Replication service to the target server's Microsoft Exchange Replication service.

  14. 目标服务器上 Microsoft Exchange 复制服务将数据库副本写入位于名为 temp-seeding 的主数据库目录中的临时目录。The Microsoft Exchange Replication service on the target server writes the database copy to a temporary directory located in the main database directory called temp-seeding.

  15. 源服务器上的流式备份操作随着到达数据库最后一行而结束。The streaming backup operation on the source server ends when the end of the database is reached.

  16. 目标服务器上的写入操作完成,并且数据库从 temp-seeding 目录移动到最后位置。将删除 temp-seeding 目录。The write operation on the target server completes, and the database is moved from the temp-seeding directory to the final location. The temp-seeding directory is deleted.

  17. 在目标服务器上,Microsoft Exchange 复制服务代理向 Microsoft Exchange 搜索服务代理发出请求,要求装入数据库副本的内容索引编录(如果有)。如果数据库副本的以前实例中有已过时的编录文件,则装入操作失败,这将激发从源服务器复制编录的需求。同样,如果目标服务器上的数据库副本的新实例上不存在编录,则编录的副本是必需的。从源复制新编录时,Microsoft Exchange 复制服务会指示 Microsoft Exchange 搜索服务挂起对数据库副本的索引编制操作。On the target server, the Microsoft Exchange Replication service proxies a request to the Microsoft Exchange Search service to mount the content index catalog for the database copy, if it exists. If there are existing out-of-date catalog files from a previous instance of the database copy, the mount operation fails, which triggers the need to replicate the catalog from the source server. Likewise, if the catalog doesn't exist on a new instance of the database copy on the target server, a copy of the catalog is required. The Microsoft Exchange Replication service directs the Microsoft Exchange Search service to suspend indexing for the database copy while a new catalog is copied from the source.

  18. 目标服务器上的 Microsoft Exchange 复制服务向源服务器上的 Microsoft Exchange 复制服务发送为编录设定种子的请求。The Microsoft Exchange Replication service on the target server sends a seed catalog request to the Microsoft Exchange Replication service on the source server.

  19. 在源服务器上,Microsoft Exchange 复制服务请求来自 Microsoft Exchange 搜索服务的目录信息,并且请求挂起索引编制操作。On the source server, the Microsoft Exchange Replication service requests the directory information from the Microsoft Exchange Search service and requests that indexing be suspended.

  20. 源服务器上的 Microsoft Exchange 搜索服务将搜索编录目录信息返回到 Microsoft Exchange 复制服务。The Microsoft Exchange Search service on the source server returns the search catalog directory information to the Microsoft Exchange Replication service.

  21. 源服务器上的 Microsoft Exchange 复制服务从目录读取编录文件。The Microsoft Exchange Replication service on the source server reads the catalog files from the directory.

  22. 源服务器上的 Microsoft Exchange 复制服务使用跨复制网络的连接将编录数据移动到目录服务器上的 Microsoft Exchange 复制服务。在读取完成之后,Microsoft Exchange 复制服务将请求发送给 Microsoft Exchange 搜索服务以恢复源数据库的索引编制操作。The Microsoft Exchange Replication service on the source server moves the catalog data to the Microsoft Exchange Replication service on the target server using a connection across the replication network. After the read is complete, the Microsoft Exchange Replication service sends a request to the Microsoft Exchange Search service to resume indexing of the source database.

  23. 如果目录中出现任何目标服务器上的现有编录文件,则目标服务器上的 Microsoft Exchange 复制服务会删除它们。If there are any existing catalog files on the target server in the directory, the Microsoft Exchange Replication service on the target server deletes them.

  24. 目标服务器上 Microsoft Exchange 复制服务将目录数据写入名为 CiSeed.Temp 的临时目录,直到数据完全传输。The Microsoft Exchange Replication service on the target server writes the catalog data to a temporary directory called CiSeed.Temp until the data is completely transferred.

  25. Microsoft Exchange 复制服务将完成的编录数据移动到最终位置。The Microsoft Exchange Replication service moves the complete catalog data to the final location.

  26. 目标服务器上的 Microsoft Exchange 复制服务恢复对目标数据库上的索引搜索。The Microsoft Exchange Replication service on the target server resumes search indexing on the target database.

  27. 目标服务器上的 Microsoft Exchange 复制服务返回完成状态。The Microsoft Exchange Replication service on the target server returns a completion status.

  28. 操作的最后结果将传递到从其调用 cmdlet 的管理界面。The final result of the operation is passed to the administrative interface from which the cmdlet was called.

配置数据库副本Configuring database copies

After a database copy is created, you can view and modify its configuration settings when needed.After a database copy is created, you can view and modify its configuration settings when needed. You can view some configuration information by examining the Properties page for a database copy in the EAC.You can view some configuration information by examining the Properties page for a database copy in the EAC. 您还可以使用 Exchange 命令行管理程序 中的 Get-MailboxDatabaseSet-MailboxDatabaseCopy cmdlet 查看和配置数据库副本设置,例如重播延迟时间、截断延迟时间和激活首选项顺序。You can also use the Get-MailboxDatabase and Set-MailboxDatabaseCopy cmdlets in the Exchange Management Shell to view and configure database copy settings, such as replay lag time, truncation lag time, and activation preference order. For detailed steps about how to view and configure database copy settings, see Configure mailbox database copy properties.For detailed steps about how to view and configure database copy settings, see Configure mailbox database copy properties.

使用重播延迟和截断延迟选项Using replay lag and truncation lag options

邮箱数据库副本支持使用“重播延迟时间”和“截断延迟时间”,这两个选项都是按分钟配置的。通过设置重播延迟时间,可以取回特定时间点的数据库副本。通过设置截断延迟时间,可以使用被动数据库副本上的日志来恢复在活动数据库副本上丢失的日志文件。因为这两个功能都会导致临时积累日志文件,所以使用其中任一功能都会影响存储设计。Mailbox database copies support the use of a replay lag time and a truncation lag time, both of which are configured in minutes. Setting a replay lag time enables you to take a database copy back to a specific point in time. Setting a truncation lag time enables you to use the logs on a passive database copy to recover from the loss of log files on the active database copy. Because both of these features result in the temporary buildup of log files, using either of them will affect your storage design.

重播延迟时间Replay lag time

重播延迟时间是一个邮箱数据库副本属性,用于指定延迟数据库副本的日志重播的时间量(分钟)。Replay lag time is a mailbox database copy property that specifies the amount of time, in minutes, to delay log replay for the database copy. 在日志文件复制到被动副本并成功通过检查之后,启动重播延迟计时器。The replay lag timer starts when a log file has been replicated to the passive copy and has successfully passed inspection. 通过延迟数据库副本日志重播,可以将数据库恢复到过去的某特定时间点。By delaying the replay of logs to the database copy, you have the capability to recover the database to a specific point in time in the past. 重播延迟时间配置为大于 0 的邮箱数据库副本称为 滞后邮箱数据库副本,或简称为 滞后副本A mailbox database copy configured with a replay lag time greater than 0 is referred to as a lagged mailbox database copy, or simply, a lagged copy.

使用数据库中的数据库副本和诉讼保留功能Exchange Server可以针对通常会导致数据丢失的一系列故障提供保护。A strategy that uses database copies and the litigation hold features in Exchange Server can provide protection against a range of failures that would ordinarily cause data loss. 但是,这些功能无法在发生逻辑损坏的情况下为数据丢失提供保护,尽管逻辑损坏的情况很少见,但它会导致数据丢失。However, these features can't provide protection against data loss in the event of logical corruption, which although rare, can cause data loss. 滞后副本旨在发生逻辑损坏的情况下防止数据丢失。Lagged copies are designed to prevent loss of data in the case of logical corruption. 通常,有两种类型的逻辑损坏:Generally, there are two types of logical corruption:

  • 数据库逻辑损坏:数据库页校验和匹配,但页面上的数据逻辑错误。Database logical corruption: The database pages checksum matches, but the data on the pages is wrong logically. 当 ESE 尝试写入数据库页时,这种情况可能会发生,而且即使操作系统返回成功消息,也不能将数据写入磁盘或错误位置。This can occur when ESE attempts to write a database page and even though the operating system returns a success message, the data is either never written to the disk or it's written to the wrong place. 这称为丢失 刷新This is referred to as a lost flush. 若要防止丢失刷新丢失数据,ESE 在数据库中包括丢失刷新检测机制和页面修补功能(单页还原)。To prevent lost flushes from losing data, ESE includes a lost flush detection mechanism in the database along with a page patching feature (single page restore).

  • 存储逻辑 损坏:以用户不想的方式添加、删除或操作数据。Store logical corruption: Data is added, deleted, or manipulated in a way that the user doesn't expect. 这些情况通常都是由第三方应用程序引起的。These cases are generally caused by third-party applications. 通常在用户将其看作损坏时才认为是损坏的。It's generally only corruption in the sense that the user views it as corruption. Exchange 存储会考虑产生一系列有效 MAPI 操作的逻辑损坏的事务。The Exchange store considers the transaction that produced the logical corruption to be a series of valid MAPI operations. Exchange Server中的诉讼保留功能可防止存储逻辑损坏 (因为它可以防止用户或应用程序用户或应用程序) 。The litigation hold feature in Exchange Server provides protection from store logical corruption (because it prevents content from being permanently deleted by a user or application). 但是在某些情况下,用户邮箱的损坏程度非常严重,以至于将数据库还原到损坏之前的时间点,然后导出用户邮箱以检索未损坏的数据会更加容易。However, there may be scenarios where a user mailbox becomes so corrupted that it would be easier to restore the database to a point in time prior to the corruption, and then export the user mailbox to retrieve uncorrupted data.

数据库副本、保留策略及 ESE 单页还原的组合可以仅留下少见但灾难性的存储逻辑损坏情况。是否使用具备重播延迟的数据库副本(滞后副本)将取决于所使用的第三方应用程序及组织的存储逻辑损坏的历史记录。The combination of database copies, hold policy, and ESE single page restore leaves only the rare but catastrophic store logical corruption case. Your decision on whether to use a database copy with a replay lag (a lagged copy) will depend on which third-party applications you use and your organization's history with store logical corruption.

如果选择使用滞后副本,请注意使用滞后副本的以下含义:If you choose to use lagged copies, be aware of the following implications for their use:

  • 重播延迟时间是管理员配置的值,默认情况下它是被禁用的。The replay lag time is an administrator-configured value, and by default, it's disabled.

  • 重播延迟时间设置的默认设置为 0 天,最大设置为 14 天。The replay lag time setting has a default setting of 0 days, and a maximum setting of 14 days.

  • 不应将滞后副本视为高可用副本。它们旨在从灾难中恢复,以防止出现存储逻辑损坏情况。Lagged copies aren't considered highly available copies. Instead, they are designed for disaster recovery purposes, to protect against store logical corruption.

  • 设置的重播延迟时间越长,数据库恢复过程就越长。根据恢复期间需要重播的日志文件数以及硬件可以重播这些文件的速度,恢复数据库可能需要几小时或更长时间。The greater the replay lag time set, the longer the database recovery process. Depending on the number of log files that need to replayed during recovery, and the speed at which your hardware can replay them, it may take several hours or more to recover a database.

  • 我们建议您确定滞后副本是否对总体灾难恢复策略至关重要。如果它们的使用对您的策略至关重要,则我们建议使用多个滞后副本,或者使用独立磁盘 (RAID) 的冗余阵列保护单个滞后副本(如果没有多个滞后副本)。如果失去磁盘或出现损坏情况,则不会丢失滞后的时间点。We recommend that you determine whether lagged copies are critical for your overall disaster recovery strategy. If using them is critical to your strategy, we recommend using multiple lagged copies, or using a redundant array of independent disks (RAID) to protect a single lagged copy, if you don't have multiple lagged copies. If you lose a disk or if corruption occurs, you don't lose your lagged point in time.

  • 滞后副本无法通过 ESE 单页还原功能进行修补。Lagged copies cant be patched with the ESE single page restore feature. 如果滞后副本遇到数据库页面损坏 (例如,) -1018 错误,则副本必须重新设置子级。If a lagged copy encounters database page corruption (for example, a -1018 error), the copy will have to be reseeded. 重新对副本进行重新种种将丢失滞后的方面。Reseeding will lose the lagged aspect of the copy.

如果希望数据库重播所有日志文件,使数据库副本成为当前副本,则激活和恢复滞后邮箱数据库副本的过程非常简单。If you want the database to replay all log files and make the database copy current, then activating and recovering a lagged mailbox database copy is an easy process . 如果要重播日志文件到特定时间点,则代理会更加困难,因为您必须手动操作日志文件并运行Exchange Server数据库实用程序 (Eseutil.exe) 。If you want to replay log files up to a specific point in time, the prosess is more difficult because you have to manually manipulate log files and run Exchange Server Database Utilities (Eseutil.exe).

若要详细了解如何激活滞后邮箱数据库副本,请参阅激活 滞后邮箱数据库副本For detailed steps about how to activate a lagged mailbox database copy, see Activate a lagged mailbox database copy.

截断延迟时间Truncation lag time

截断延迟时间是邮箱数据库副本的 属性,用于指定在将 日志文件 重播到数据库副本后延迟数据库副本的日志删除的时间(分钟)。Truncation lag time is the property of a mailbox database copy that specifies the amount of time, in minutes, to delay log deletion for the database copy after the log file has been replayed into the database copy. 在日志文件复制到被动副本、成功通过检查并成功重播到数据库副本之后,启动截断延迟计时器。The truncation lag timer starts when a log file has been replicated to the passive copy, successfully passed inspection, and has been successfully replayed into the copy of the database. 通过从数据库副本延迟日志文件的截断,可以从影响数据库活动副本的日志文件的故障中恢复。By delaying the truncation of log files from the database copy, you have the capability to recover from failures that affect the log files for the active copy of the database.

数据库副本和日志截断Database copies and log truncation

日志截断在 Exchange 2016 和 Exchange 2019 中的工作方式与在 Exchange 2010 中相同。Log truncation works the same in Exchange 2016 and Exchange 2019 as it did in Exchange 2010. 截断行为由副本的重播延迟时间和截断延迟时间决定。Truncation behavior is determined by the replay lag time and truncation lag time settings for the copy.

当延迟设置保留其默认值 0(已禁用)时,必须满足以下条件才能截断数据库副本的日志文件:The following criteria must be met for a database copy's log file to be truncated when lag settings are left at their default values of 0 (disabled):

  • 必须已成功备份日志文件,或者必须启用循环日志记录。The log file must have been successfully backed up, or circular logging must be enabled.

  • 日志文件必须在数据库检查点(恢复需要的最小日志文件)的下面。The log file must be below the checkpoint (the minimum log file required for recovery) for the database.

  • 所有其他滞后副本必须检查该日志文件。All other lagged copies must have inspected the log file.

  • 除滞后副本 (,其他所有副本) 必须已重播日志文件。All other copies (except lagged copies) must have replayed the log file.

必须满足以下条件,才能对滞后数据库副本执行截断:The following criteria must be met for truncation to occur for a lagged database copy:

  • 在日志文件必须在数据库检查点的下面。The log file must be below the checkpoint for the database.

  • 日志文件必须早于 ReplayLagTime + TruncationLagTime。The log file must be older than ReplayLagTime + TruncationLagTime.

  • 必须截断活动副本上的日志文件。The log file must have been truncated on the active copy.

在Exchange Server,当一个或多个被动副本挂起时,不会在活动邮箱数据库副本上发生日志截断。In Exchange Server, log truncation doesn't occur on an active mailbox database copy when one or more passive copies are suspended. 如果计划维护活动将花很长时间(例如,几天时间),可能会累积大量的日志文件。If planned maintenance activities are going to take an extended period of time (for example, several days), you may have considerable log file buildup. 为了防止事务日志填满日志驱动器,可以删除受影响的被动数据库副本,而不是将其挂起。To prevent the log drive from filling up with transaction logs, you can remove the affected passive database copy instead of suspending it. 当计划维护完成时,可以重新添加被动数据库副本。When the planned maintenance is completed, you can re-add the passive database copy.

Exchange Server现在具有一个称为 " 松散截断"的功能,该功能默认情况下处于禁用状态。Exchange Server now has a feature called loose truncation that is disabled by default. 在正常操作过程中,每个数据库副本都会保留需要传送到其他数据库副本的日志,直到数据库的所有副本均确认已重播(被动副本)或收到(延迟副本)日志文件。During normal operations, each database copy keeps logs that need to be shipped to other database copies until all copies of a database confirm they have replayed (passive copies) or received (lagged copies) the log files. 这是默认日志截断操作。This is default log truncation behavior. 如果数据库副本由于某些原因处于脱机状态,日志文件就会开始在数据库的其他副本使用的磁盘上堆积。If a database copy goes offline for some reason, the log files begin accumulating on the disks used by the other copies of the database. 如果受影响的数据库副本在较长时间内保持脱机状态,则可能会导致其他数据库副本用完磁盘空间。If the affected database copy remains offline for an extended period, this can cause the other database copies to run out of disk space.

当启用松散截断和循环日志记录时,截断行为会有所不同。Truncation behavior is different when loose truncation and circular logging are enabled. 每个数据库副本跟踪自己的可用磁盘空间,并在可用空间不足时应用宽松截断行为。Each database copy tracks its own free disk space and applies loose truncation behavior if free space gets low.

  • 对于主动副本,最旧的延迟副本(日志重播中远远落后的被动数据库副本)会遭到忽略,而截断会考虑剩余的最旧被动副本。For the active copy, the oldest straggler (the passive database copy that is farthest behind in log replay) is ignored and truncation respects the oldest remaining passive copies. 活动数据库副本是计算全局截断的位置。The active database copy is where global truncation is calculated.

  • 对于被动副本,如果空间不足,它将使用稍后在注册表值表中介绍的配置参数独立截断其日志文件。被动副本将尝试遵守对主动副本的截断决定。For a passive copy, if space gets low, it will independently truncate its log files using the configured parameters described later in the Registry Value table.The passive copies will attempt to respect the truncation decision made on the active copy. 无论 MinCopiesToProtect 名称的含义是什么,Exchange 都只会忽略截断运行时已知的最旧延迟副本。Despite the implication of the name MinCopiesToProtect, Exchange will only ignore the oldest known straggler at the time truncation is run.

如果脱机数据库重新处于联机状态,将丢失从其他正常副本检测到的日志文件,其数据库副本状态将为 FailedAndSuspended。在这种情况下,如果配置了 Autoreseed,则会自动重新设定受影响的副本种子。如果未配置 Autoreseed,则将需要管理员手动设定数据库副本种子。When the offline database is brought back online, it will be missing log files that have been deleted from the other healthy copies, and its database copy status will be FailedAndSuspended. In this event, if Autoreseed is configured, the affected copy will be automatically reseeded. If Autoreseed is not configured, the database copy will need to be manually seeded by an administrator.

如果禁用循环日志记录,则松散截断将执行备份(如果已执行备份)。因此,如果日志尚未备份,则宽松截断不会删除这些日志。If circular logging is disabled, loose truncation respects backups if they have been taken, so if logs have not been backed up they will not be removed by loose Truncation.

截断是首选体系结构的推荐功能,其中不会使用备份并启用循环日志记录。truncation is a recommended feature for preferred architecture where backups are not used and circular logging is enabled.

所需正常副本数量、可用磁盘空间阈值,以及要保留的日志数量均为可配置参数。默认情况下,可用磁盘空间阈值是 204800MB (200GB),被动副本保留的日志数量为 100,000MB (100GB),主动副本保留的日志数量为 10,000MB (10GB)。The required number of healthy copies, the free disk space threshold, and the number of logs to keep are all configurable parameters. By default, the free disk space threshold is 204800 MB (200 GB), and the number of logs to keep is 100,000 (100 GB) for passive copies, and 10,000 (10 GB) for active copies.

通过编辑每个 DAG 成员的 Windows 注册表启用松散截断和配置松散截断参数。可以配置三个注册表值,均存储在 HKLM\Software\Microsoft\ExchangeServer\v15\BackupInformation 下。默认情况下,BackupInformation 键及其下的 DWORD 值不存在,必须手动创建。BackupInformation 下的 DWORD 注册表值在下表中进行了说明:Enabling loose truncation and configuring loose truncation parameters is performed by editing the Windows registry on each DAG member. There are three registry values that can be configured, that are all stored under HKLM\Software\Microsoft\ExchangeServer\v15\BackupInformation. The BackupInformation key the following DWORD values do not exist by default and must be manually created. The DWORD registry values under BackupInformation are described in the following table:

注册表值Registry Value 描述Description 默认值Default Value
LooseTruncation_MinCopiesToProtectLooseTruncation_MinCopiesToProtect 此键用于启用宽松截断。它代表在数据库的主动副本上的宽松截断中要保护的被动副本的数量。将此键的值设置为 0,禁用松散截断。This key is used to enable loose truncation. It represents the number of passive copies to protect from loose truncation on the active copy of a database. Setting the value of this key to 0 disables loose truncation. 00
LooseTruncation_MinDiskFreeSpaceThresholdInMBLooseTruncation_MinDiskFreeSpaceThresholdInMB 触发宽松截断的可用磁盘空间(以 MB 为单位)阈值。如果可用磁盘空间低于此值,就会触发松散截断。Available disk space (in MB) threshold for triggering loose truncation. If free disk space falls below this value, loose truncation is triggered. 如果没有配置此注册表值,则宽松截断使用的默认值是 200GB。If this registry value is not configured, the default value used by loose truncation is 200 GB.
LooseTruncation_MinLogsToProtectLooseTruncation_MinLogsToProtect 要在进行日志截断的正常副本上保留的日志文件的数量下限。如果配置了此注册表值,那么所配置的值适用于主动副本和被动副本。The minimum number of log files to retain on healthy copies whose logs are being truncated. If this registry value is configured, then the configured value applies to both active and passive copies. 如果没有配置此注册表值,则被动数据库副本使用的默认值是 100,000,主动数据库副本使用的默认值是 10,000。If this registry value is not configured, then default values of 100,000 for passive database copies and 10,000 for active database copies is used.

使用 LooseTruncation_MinLogsToProtect 注册表值时,请注意,主动和被动数据库副本的行为是不一样的。在主动数据库副本上,这是在受保护的被动副本和主动副本所需的范围之前就保留的额外日志数量。在被动数据库副本上,这是从最新可用日志保留的日志数量。此数量的 1/10 还用于在此被动副本的所需范围之前保留日志。这两个限制旨在确保延迟数据库副本不会占用太多空间,因为它们所需的范围通常非常大。When using the LooseTruncation_MinLogsToProtect registry value, note that the behavior is different for active and passive database copies. On the active database copy, this is the number of extra logs that are retained preceding those that are required by the protected passive copies and the required range of the active copy.On a passive database copy, this is the number of logs maintained from the latest available log. One tenth of this number is also used to maintain logs prior to the required range of this passive copy. The two limits are in place to ensure that lagged database copies don't take up too much space, since their required range is typically very large.

数据库激活策略Database activation policy

在某些情况下,您可能希望创建邮箱数据库副本,并阻止系统在出现故障的情况下自动激活该副本。例如:There are scenarios in which you may want to create a mailbox database copy and prevent the system from automatically activating that copy in the event of a failure, for example:

  • 将一个或多个邮箱数据库副本部署到替换或备用数据中心时。If you deploy one or more mailbox database copies to an alternate or standby datacenter.

  • 配置滞后数据库副本以进行恢复时。If you configure a lagged database copy for recovery purposes.

  • 如果正在执行服务器的维护或升级。If you're performing maintenance or an upgrade of a server.

在上述每种情况下,您都具有不希望系统自动激活的数据库副本。In each of the preceding scenarios, you have database copies that you don't want the system to activate automatically. 若要阻止系统自动激活邮箱数据库副本,您可以将该副本配置为阻止激活(挂起)。To prevent the system from automatically activating a mailbox database copy, you can configure the copy to be blocked (suspended) for activation. 这允许系统通过日志传送和重播维护数据库的货币,但会阻止系统自动激活并使用该副本。This allows the system to maintain the currency of the database through log shipping and replay, but prevents the system from automatically activating and using the copy. 阻止激活的副本必须由管理员手动激活。Copies blocked for activation must be manually activated by an administrator. 通过使用 Set-MailboxServer cmdlet 或单个数据库副本,可以使用 Set-MailboxDatabaseCopy cmdlet 将 DatabaseCopyAutoActivationPolicy 参数设置为 Blocked,为整个服务器配置数据库激活策略。You can configure the database activation policy for an entire server by using the Set-MailboxServer cmdlet or an individual database copy by using the Set-MailboxDatabaseCopy cmdlet to set the DatabaseCopyAutoActivationPolicy parameter to Blocked.

有关配置数据库激活策略的详细信息,请参阅配置邮箱数据库副本的激活策略For more information about configuring database activation policy, see Configure activation policy for a mailbox database copy.

邮箱移动对连续复制的影响Effect of mailbox moves on continuous replication

在日志生成速率较高的繁忙邮箱数据库上,如果对被动数据库副本的复制无法与日志生成保持同步,则丢失数据的可能性更大。On a very busy mailbox database with a high log generation rate, there is a greater chance for data loss if replication to the passive database copies can't keep up with log generation. 一种可引入高日志生成速率的方案是邮箱移动。One scenario that can introduce a high log generation rate is mailbox moves. Exchange Server 包括由 Exchange 邮箱复制服务 (MRS) 等服务使用的数据保证 API,以根据系统或管理员设置的 DataMoveReplicationConstraint 参数的值检查数据库副本体系结构的运行状况。Exchange Server includes a Data Guarantee API that's used by services such as the Exchange Mailbox Replication service (MRS) to check the health of the database copy architecture based on the value of the DataMoveReplicationConstraint parameter that was set by the system or an administrator. 具体而言,数据保证 API 可用于:Specifically, the Data Guarantee API can be used to:

  • 检查复制运行状况:确认必备数量的数据库副本可用。Check replication health: Confirms that the prerequisite number of database copies is available.

  • 检查复制刷新:确认已根据必备数量的数据库副本重播了所需的日志文件。Check replication flush: Confirms that the required log files have been replayed against the prerequisite number of database copies.

执行时,API 向调用应用程序返回以下状态信息:When executed, the API returns the following status information to the calling application:

  • 重试:表示存在阻止针对数据库检查条件的暂时性错误。Retry: Signifies that there are transient errors that prevent a condition from being checked against the database.

  • Satisfied:表示数据库满足所需条件,或者数据库未复制。Satisfied: Signifies that the database meets the required conditions or the database isn't replicated.

  • NotSatisfied:表示数据库不满足所需条件。NotSatisfied: Signifies that the database doesn't meet the required conditions. In addition, information is provided to the calling application as to why the NotSatisfied response was returned.In addition, information is provided to the calling application as to why the NotSatisfied response was returned.

邮箱数据库的 DataMoveReplicationConstraint 参数的值确定应在请求中评估的数据库副本数。The value of the DataMoveReplicationConstraint parameter for the mailbox database determines how many database copies should be evaluated as part of the request. DataMoveReplicationConstraint 参数具有以下可能的值:The DataMoveReplicationConstraint parameter has the following possible values:

  • None:创建邮箱数据库时,默认情况下会设置此值。None: When you create a mailbox database, this value is set by default. 设置此值时,会忽略数据保证 API 条件。When this value is set, the Data Guarantee API conditions are ignored. 只应将此设置用于不复制的邮箱数据库。This setting should be used only for mailbox databases that aren't replicated.

  • SecondCopy:这是添加邮箱数据库的第二个副本时的默认值。SecondCopy: This is the default value when you add the second copy of a mailbox database. 设置此值时,必须至少有一个被动数据库副本满足数据保证 API 条件。When this value is set, at least one passive database copy must meet the Data Guarantee API conditions.

  • SecondDatacenter:设置此值后,另一个 Active Directory 站点中至少必须有一个被动数据库副本满足数据保证 API 条件。SecondDatacenter: When this value is set, at least one passive database copy in another Active Directory site must meet the Data Guarantee API conditions.

  • AllDatacenters:设置此值时,每个 Active Directory 站点中必须至少有一个被动数据库副本满足数据保证 API 条件。AllDatacenters: When this value is set, at least one passive database copy in each Active Directory site must meet the Data Guarantee API conditions.

  • AllCopies:设置此值时,邮箱数据库的所有副本都必须满足数据保证 API 条件。AllCopies: When this value is set, all copies of the mailbox database must meet the Data Guarantee API conditions.

检查复制运行状况Check Replication Health

当执行数据保证 API 以评估数据库副本基础结构的运行状况时,会评估几个项目。When the Data Guarantee API is executed to evaluate the health of the database copy infrastructure, several items are evaluated.

在所有方案中,被动数据库副本必须满足以下条件:In all scenarios, the passive database copy must meet the following conditions:

  • 状况良好。Be healthy.

  • 具有重播延迟时间在 10 分钟内的重播队列。Have a replay queue within 10 minutes of the replay lag time.

  • 具有少于 10 个日志的复制队列长度。Have a copy queue length less than 10 logs.

  • 具有少于 10 个日志的平均复制队列长度。平均复制队列长度基于应用程序查询数据库状态的次数进行计算。Have an average copy queue length less than 10 logs. The average copy queue length is computed based on the number of times the application has queried the database status.


如果 DataMoveReplicationConstraint 参数设置为...If the DataMoveReplicationConstraint parameter is set to... 然后,对于给定的数据库...Then, for a given database...
SecondCopy 复制的数据库至少必须有一个被动数据库副本满足上述条件。At least one passive database copy for a replicated database must meet the previously described conditions.
SecondDatacenter 另一个 Active Directory 站点中必须至少有一个被动数据库副本满足上述条件。At least one passive database copy in another Active Directory site must meet the previously described conditions.
AllDatacenters 必须装入主动副本,并且每个 Active Directory 站点中的被动副本必须满足上述条件。The active copy must be mounted, and a passive copy in each Active Directory site must meet the previously described conditions.
AllCopies 必须装入主动副本,并且所有被动数据库副本都必须满足上述条件。The active copy must be mounted, and all passive database copies must meet the previously described conditions.

检查复制刷新Check Replication Flush

数据保证 API 还可以用于验证是否有必备数量的数据库副本重播了所需事务日志。The Data Guarantee API can also be used to validate that a prerequisite number of database copies have replayed the required transaction logs. 验证这一点的方法是将上个日志重播时间戳与调用服务的提交时间戳(在大多数情况下,这是包含所需数据的上一个日志文件的时间戳)加上额外五秒(用于处理系统时间时钟偏差或偏移)的时间进行比较。This is verified by comparing the last log replayed timestamp with that of the calling service's commit timestamp (in most cases, this is the timestamp of the last log file that contains required data) plus an additional five seconds (to deal with system time clock skews or drift). 如果重播时间戳大于提交时间戳,则 满足 DataMoveReplicationConstraint 参数。If the replay timestamp is greater than the commit timestamp, the DataMoveReplicationConstraint parameter is satisfied. 如果重播时间戳小于提交时间戳,则不满足 DataMoveReplicationConstraint。If the replay timestamp is less than the commit timestamp, the DataMoveReplicationConstraint isn't satisfied.

在将大量邮箱移动到 DAG 内的复制数据库或从其中移动大量邮箱之前,建议您根据以下条件在每个邮箱数据库上配置 DataMoveReplicationConstraint 参数:Before moving large numbers of mailboxes to or from replication databases within a DAG, we recommend that you configure the DataMoveReplicationConstraint parameter on each mailbox database according to the following:

如果你要部署...If you're deploying... 将 DataMoveReplicationConstraint 设置为...Set DataMoveReplicationConstraint to...
没有任何数据库副本的邮箱数据库Mailbox databases that don't have any database copies None
单个 Active Directory 站点中的 DAGA DAG within a single Active Directory site SecondCopy
使用扩展 Active Directory 站点的多个数据中心中的 DAGA DAG in multiple datacenters using a stretched Active Directory site SecondCopy
跨两个Active Directory 站点的 DAG,并且您将在每个站点中具有高可用性数据库副本A DAG that spans twoActive Directory sites, and you will have highly available database copies in each site SecondDatacenter
跨两个 Active Directory 站点的 DAG,并且在第二个站点中只有滞后数据库副本A DAG that spans two Active Directory sites, and you will have only lagged database copies in the second site SecondCopy
这是因为数据保证 API 不保证提交数据,直至将日志文件重播到数据库副本中,并且由于滞后数据库副本的性质,此约束会使移动请求失败,除非之后数据库副本 ReplayLagTime 值小于 30 分钟。This is because the Data Guarantee API won't guarantee data being committed until the log file is replayed into the database copy, and due to the nature of the database copy being lagged, this constraint will fail the move request, unless the lagged database copy ReplayLagTime value is less than 30 minutes.
跨三个或更多 Active Directory 站点的 DAG,并且每个站点都会包含高可用数据库副本A DAG that spans three or more Active Directory sites, and each site will contain highly available database copies AllDatacenters

平衡数据库副本Balancing database copies

由于 DAG 的固有性质,数据库切换和故障转移会导致活动邮箱数据库副本在 DAG 的生存期内多次更改主机。因此,DAG 在活动邮箱数据库副本分布方面可能变得不平衡。下表显示了一个主动数据库副本分布不平衡的 DAG 示例,该 DAG 具有四个数据库,每个数据库有四个副本(每个服务器上总共有 16 个数据库)。Due to the inherent nature of DAGs, as the result of database switchovers and failovers, active mailbox database copies will change hosts several times throughout a DAG's lifetime. As a result, DAGs can become unbalanced in terms of active mailbox database copy distribution. The following table shows an example of a DAG that has four databases with four copies of each database (for a total of 16 databases on each server) with an uneven distribution of active database copies.

主动副本分布不平衡的 DAGDAG with unbalanced active copy distribution

服务器Server 活动数据库的数量Number of active databases 被动数据库的数量Number of passive databases 已装入数据库的数量Number of mounted databases 已卸除数据库的数量Number of dismounted databases 首选项计数列表Preference count list
EX1EX1 5 5 1111 5 5 00 4, 4, 3, 54, 4, 3, 5
EX2EX2 11 15 15 11 00 1, 8, 6, 11, 8, 6, 1
EX3EX3 12 12 4 4 12 12 00 13, 2, 1, 013, 2, 1, 0
EX4EX4 11 15 15 11 00 1, 1, 5, 91, 1, 5, 9

In the preceding example, there are four copies of each database, and therefore, only four possible values for activation preference (1, 2, 3, or 4). The Preference count list column shows the count of the number of databases with each of these values. For example, on EX3, there are 13 database copies with an activation preference of 1, two copies with an activation preference of 2, one copy with an activation preference of 3, and no copies with an activation preference of 4.In the preceding example, there are four copies of each database, and therefore, only four possible values for activation preference (1, 2, 3, or 4). The Preference count list column shows the count of the number of databases with each of these values. For example, on EX3, there are 13 database copies with an activation preference of 1, two copies with an activation preference of 2, one copy with an activation preference of 3, and no copies with an activation preference of 4.

如您所见,此 DAG 在每个 DAG 成员托管的活动数据库数、每个 DAG 成员托管的被动数据库数或托管数据库的激活首选项计数方面并不平衡。As you can see, this DAG isn't balanced in terms of the number of active databases hosted by each DAG member, the number of passive databases hosted by each DAG member, or the activation preference count of the hosted databases.

可以使用 RedistributeActiveDatabases.ps1 脚本在 DAG 间平衡主动邮箱数据库副本。此脚本会使数据库在其副本之间进行移动,以尝试使 DAG 中每个服务器上装入的数据库数量相等。如有必要,该脚本还尝试在站点间平衡活动数据库。You can use the RedistributeActiveDatabases.ps1 script to balance the active mailbox databases copies across a DAG. This script moves databases between their copies in an attempt to have an equal number of mounted databases on each server in DAG. If required, the script also attempts to balance active databases across sites.

该脚本为在 DAG 中平衡主动数据库副本提供了两种选项:The script provides two options for balancing active database copies within a DAG:

  • BalanceDbsByActivationPreference: 如果指定此选项,脚本将尝试根据激活首选项 (将数据库移动到其首选副本) 而不考虑 Active Directory 站点。BalanceDbsByActivationPreference: When this option is specified, the script attempts to move databases to their most preferred copy (based on activation preference) without regard to the Active Directory site.

  • BalanceDbsBySiteAndActivationPreference: 指定此选项时,脚本会尝试将活动数据库移动到其首选副本,同时还尝试在每个 Active Directory 站点中平衡活动数据库。BalanceDbsBySiteAndActivationPreference: When this option is specified, the script attempts to move active databases to their most preferred copy, while also trying to balance active databases within each Active Directory site.

使用第一个选项运行该脚本之后,先前不平衡的 DAG 会达到平衡,如下表所示。After running the script with the first option, the preceding unbalanced DAG becomes balanced, as shown in the following table.

主动副本分布平衡的 DAGDAG with balanced active copy distribution

服务器Server 活动数据库的数量Number of active databases 被动数据库的数量Number of passive databases 已装入数据库的数量Number of mounted databases 已卸除数据库的数量Number of dismounted databases 首选项计数列表Preference count list
EX1EX1 4 4 12 12 4 4 00 4, 4, 4, 44, 4, 4, 4
EX2EX2 4 4 12 12 4 4 00 4, 4, 4, 44, 4, 4, 4
EX3EX3 4 4 12 12 4 4 00 4, 4, 4, 44, 4, 4, 4
EX4EX4 4 4 12 12 4 4 00 4, 4, 4, 44, 4, 4, 4

如上表所示,现在此 DAG 在每个服务器上的活动数据库数和被动数据库数以及服务器间的激活首选项方面达到平衡。As shown in the preceding table, this DAG is now balanced in terms of number of active and passive databases on each server and activation preference across the servers.

下表列出了 RedistributeActiveDatabases.ps1 脚本的可用参数。The following table lists the available parameters for the RedistributeActiveDatabases.ps1 script.

RedistributeActiveDatabases.ps1 脚本参数RedistributeActiveDatabases.ps1 script parameters

参数Parameter 说明Description
DagNameDagName 指定要重新平衡的 DAG 的名称。如果省略此参数,则会使用本地服务器所属的 DAG。Specifies the name of the DAG you want to rebalance. If this parameter is omitted, the DAG of which the local server is a member is used.
BalanceDbsByActivationPreferenceBalanceDbsByActivationPreference 指定该脚本应将数据库移动到其第一首选副本,而不考虑 Active Directory 站点。Specifies that the script should move databases to their most preferred copy without regard to the Active Directory site.
BalanceDbsBySiteAndActivationPreferenceBalanceDbsBySiteAndActivationPreference 指定该脚本应尝试将活动数据库移动到其第一首选副本,同时还尝试在每个 Active Directory 站点中平衡活动数据库。Specifies that the script should attempt to move active databases to their most preferred copy, while also trying to balance active databases within each Active Directory site.
ShowFinalDatabaseDistributionShowFinalDatabaseDistribution 指定在重新分布完成后显示当前数据库分布的报告。Specifies that a report of current database distribution be displayed after redistribution is complete.
AllowedDeviationFromMeanPercentageAllowedDeviationFromMeanPercentage 指定站点间活动数据库的允许变化率,以百分比形式表示。默认为 20%。例如,如果三个站点之间分布了 99 个数据库,则理想分布应是每个站点中包含 33 个数据库。如果允许变化率为 20%,则该脚本会尝试平衡数据库,以便每个站点包含的数据库数与此数字相比,上下不超过 10%。33 的 10% 是 3.3,向上舍入为 4。因此,该脚本会尝试使每个站点包含 29 至 37 个数据库。Specifies the allowed variation of active databases across sites, expressed as a percentage. The default is 20%. For example, if there were 99 databases distributed between three sites, the ideal distribution would be 33 databases in each site. If the allowed deviation is 20%, the script attempts to balance the databases so that each site has no more than 10% more or less than this number. 10% of 33 is 3.3, which is rounded up to 4. Therefore, the script attempts to have between 29 and 37 databases in each site.
ShowDatabaseCurrentActivesShowDatabaseCurrentActives 指定该脚本为每个数据库生成一个报告,该报告详细说明数据库的移动方式以及它在其第一首选副本上现在是否处于活动状态。Specifies that the script produce a report for each database detailing how the database was moved and whether it's now active on its most-preferred copy.
ShowDatabaseDistributionByServerShowDatabaseDistributionByServer 指定该脚本为每个服务器生成一个报告,该报告显示服务器的数据库分布。Specifies that the script produce a report for each server showing its database distribution.
RunOnlyOnPAMRunOnlyOnPAM 指定该脚本仅在当前具有 PAM 角色的 DAG 成员上运行。该脚本验证其是否从 PAM 运行。如果它不是从 PAM 运行,则该脚本会退出。Specifies that the script run only on the DAG member that currently has the PAM role. The script verifies it's being run from the PAM. If it isn't being run from the PAM, the script exits.
LogEventsLogEvents 指定该脚本记录事件(MsExchangeRepl 事件 4115),其中包含操作摘要。Specifies that the script logs an event (MsExchangeRepl event 4115) containing a summary of the actions.
IncludeNonReplicatedDatabasesIncludeNonReplicatedDatabases 指定该脚本在确定如何重新分布活动数据库时应包括非复制数据库(没有副本的数据库)。虽然无法移动非复制数据库,但是这些数据库可能会影响复制数据库的分布。Specifies that the script should include non-replicated databases (databases without copies) when determining how to redistribute the active databases. Although non-replicated databases can't be moved, they may affect the distribution of the replicated databases.
ConfirmConfirm Confirm 开关可用于禁止显示确认提示,当运行此脚本时,会在默认情况下显示此确认提示。若要禁止显示确认提示,请使用语法 -Confirm:$False。您必须在语法中包含冒号 (:)。The Confirm switch can be used to suppress the confirmation prompt that appears by default when this script is run. To suppress the confirmation prompt, use the syntax -Confirm:$False. You must include a colon ( : ) in the syntax.

RedistributeActiveDatabases.ps1 示例RedistributeActiveDatabases.ps1 examples

此示例演示某个 DAG 的当前数据库分布,包括首选项计数列表。This example shows the current database distribution for a DAG, including preference count list.

RedistributeActiveDatabases.ps1 -DagName DAG1 -ShowDatabaseDistributionByServer | Format-Table

此示例使用不提示进行输入的激活首选项在 DAG 中重新分布和平衡主动邮箱数据库副本。This example redistributes and balances the active mailbox database copies in a DAG using activation preference without prompting for input.

RedistributeActiveDatabases.ps1 -DagName DAG1 -BalanceDbsByActivationPreference -Confirm:$False

此示例使用激活首选项在 DAG 中重新分布和平衡活动邮箱数据库副本,并生成分布摘要。This example redistributes and balances the active mailbox database copies in a DAG using activation preference, and produces a summary of the distribution.

RedistributeActiveDatabases.ps1 -DagName DAG1 -BalanceDbsByActivationPreference -ShowFinalDatabaseDistribution

监视数据库副本Monitoring database copies

可以通过在 EAC 中检查数据库副本的详细信息来查看各种信息,包括复制队列长度、重播队列长度、状态和内容索引状态信息。You can view a variety of information, including copy queue length, replay queue length, status, and content index state information, by examining the details of a database copy in the EAC. 您还可以使用 Exchange 命令行管理程序 中的 Get-MailboxDatabaseCopyStatus cmdlet 查看数据库副本的各种状态信息。You can also use the Get-MailboxDatabaseCopyStatus cmdlet in the Exchange Management Shell to view a variety of status information for a database copy.

备注

如果发生影响数据库活动副本的故障,数据库副本是第一个防御措施。A database copy is your first defense if a failure occurs that affects the active copy of a database. 因此,监视数据库副本的运行状况和状态以确保它们可根据需要使用至关重要。It's therefore critical to monitor the health and status of database copies to ensure that they are available when needed.

有关监视数据库副本的信息,请参阅 监视数据库可用性组For more information about monitoring database copies, see Monitor database availability groups.

删除数据库副本Removing a database copy

可以使用 EAC 或 Exchange 命令行管理程序 中的 Remove-MailboxDatabaseCopy cmdlet 随时删除数据库副本。A database copy can be removed at any time by using the EAC or by using the Remove-MailboxDatabaseCopy cmdlet in the Exchange Management Shell. 删除数据库副本之后,必须手动从删除数据库副本的服务器上删除任何数据库和事务日志文件。After removing a database copy, you must manually delete any database and transaction log files from the server from which the database copy is being removed. 有关如何删除数据库副本的详细步骤,请参阅 删除邮箱数据库副本For detailed steps about how to remove a database copy, see Remove a mailbox database copy.

数据库切换Database switchovers

承载数据库活动副本的邮箱服务器称为"邮箱数据库主机"。激活被动数据库副本的过程会更改数据库的邮箱数据库主机,并将被动副本转换为新的主动副本。此过程称为数据库切换。在数据库切换,在一个邮箱服务器上卸除数据库的活动副本,并该数据库的被动副本装入另一个邮箱服务器上的新活动邮箱数据库。执行切换时,可以选择覆盖新邮箱数据库主机上的数据库装入拨号设置。The Mailbox server that hosts the active copy of a database is referred to as the mailbox database master. The process of activating a passive database copy changes the mailbox database master for the database and turns the passive copy into the new active copy. This process is called a database switchover. In a database switchover, the active copy of a database is dismounted on one Mailbox server and a passive copy of that database is mounted as the new active mailbox database on another Mailbox server. When performing a switchover, you can optionally override the database mount dial setting on the new mailbox database master.

You can quickly identify which Mailbox server is the current mailbox database master by reviewing the right-hand column under the Database Copies tab in the EAC.You can quickly identify which Mailbox server is the current mailbox database master by reviewing the right-hand column under the Database Copies tab in the EAC. 可以使用 EAC 中的 " 激活"链接,或者使用 Exchange 命令行管理程序 中的 Move-ActiveMailboxDatabase cmdlet 执行切换。You can perform a switchover by using the Activate link in the EAC, or by using the Move-ActiveMailboxDatabase cmdlet in the Exchange Management Shell.

在激活被动副本之前,将执行几个内部检查。There are several internal checks that will be performed before a passive copy is activated. 在某些情况下,数据库切换被阻止或取消。In some cases, the database switchover is blocked or canceled. 在其他情形下,可以使用 cmdlet 移动或跳过某些检查。In other cases, you can use cmdlets to move or skip over some checks.

  • 检查数据库副本的状态。The status of the database copy is checked. 如果数据库副本处于失败状态,则阻止切换。If the database copy is in a failed state, the switchover is blocked. 您可以使用 Move-ActiveMailboxDatabase cmdlet 的 SkipHealthChecks 参数覆盖此行为并绕过运行状况检查。You can override this behavior and bypass the health check by using the SkipHealthChecks parameter of the Move-ActiveMailboxDatabase cmdlet. 此参数允许您将活动副本移动到出现故障状态的数据库副本。This parameter lets you move the active copy to a database copy in a failed state.

  • 将检查主动数据库副本以了解它当前是否为数据库的任何被动副本的种子设定源。The active database copy is checked to see if it's currently a seeding source for any passive copies of the database. 如果主动副本当前用作种子设定源,则会阻止切换。If the active copy is currently being used as a source for seeding, the switchover is blocked. 您可以使用 Move-ActiveMailboxDatabase cmdlet 的 SkipActiveCopyChecks 参数替代此行为并绕过种子设定源检查。You can override this behavior and bypass the seeding source check by using the SkipActiveCopyChecks parameter of the Move-ActiveMailboxDatabase cmdlet. 此参数允许移动正用作种子设定源的主动副本。This parameter allows you to move an active copy that's being used as a seeding source. 使用此参数会导致取消种子设定操作并将该操作视为失败。Using this parameter will cause the seeding operation to be cancelled and considered failed.

  • 检查数据库副本的复制队列和重播队列长度,以确保它们的值符合已配置的条件。The copy queue and replay queue lengths for the database copy are checked to ensure their values are within the configured criteria. 此外,还验证数据库副本,以确保当前未将其用作种子设定源。Also, the database copy is verified to ensure that it isn't currently in use as a source for seeding. 如果队列长度的值超出已配置的条件,或者数据库当前用作种子设定源,则阻止切换。If the values for the queue lengths are outside the configured criteria, or if the database is currently used as a source for seeding, the switchover is blocked. 您可以使用 Move-ActiveMailboxDatabase cmdlet 的 SkipLagChecks 参数覆盖此行为并绕过这些检查。You can override this behavior and bypass these checks by using the SkipLagChecks parameter of the Move-ActiveMailboxDatabase cmdlet. 此参数允许要激活的副本具有超出已配置条件的重播队列和复制队列。This parameter allows a copy to be activated that has replay and copy queues outside of the configured criteria.

  • 检查数据库副本的搜索目录(内容索引)的状态。The state of the search catalog (content index) for the database copy is checked. 如果搜索目录不是最新的且运行状况不正常或已损坏,则阻止切换。If the search catalog isn't up to date, is in an unhealthy state, or is corrupt, the switchover is blocked. 您可以使用 Move-ActiveMailboxDatabase cmdlet 的 SkipClientExperienceChecks 参数覆盖此行为并绕过搜索目录检查。You can override this behavior and bypass the search catalog check by using the SkipClientExperienceChecks parameter of the Move-ActiveMailboxDatabase cmdlet. 此参数将导致搜索跳过目录运行状况检查。This parameter causes this search to skip the catalog health check. 如果正在激活的数据库副本的搜索目录处于不正常运行状况或不可用状态,并且使用此参数跳过目录运行状况检查和激活数据库副本,则需要重新对搜索目录进行爬网或设定种子。If the search catalog for the database copy you're activating is in an unhealthy or unusable state and you use this parameter to skip the catalog health check and activate the database copy, you will need to either crawl or seed the search catalog again.

执行数据库切换时,还可以选择覆盖为承载要激活的被动数据库副本的服务器配置的装入拨号设置。When you perform a database switchover, you also have the option of overriding the mount dial settings configured for the server that hosts the passive database copy being activated. 使用 Move-ActiveMailboxDatabase cmdlet 的 MountDialOverride 参数指示目标服务器覆盖自己的装入拨号设置并使用 MountDialOverride 参数指定的设置。Using the MountDialOverride parameter of the Move-ActiveMailboxDatabase cmdlet instructs the target server to override its own mount dial settings and use those specified by the MountDialOverride parameter.

有关如何执行数据库副本切换的详细步骤,请参阅激活邮箱数据库副本For detailed steps about how to perform a switchover of a database copy, see Activate a mailbox database copy.