Restore-StorageGroupCopy (RTM)

 

适用于: Exchange Server 2007

上一次修改主题: 2007-10-23

本主题介绍如何在 Microsoft Exchange Server 2007 群集连续复制 (CCR) 或本地连续复制 (LCR) 解决方案中使用 Restore-StorageGroupCopy cmdlet,来激活被动存储组副本。在 CCR 配置中,如果自动装入支持不会装入数据库,且管理员必须显式介入以装入数据库,则需要使用 Restore-StorageGroupCopy。在该方案中,管理员将在执行 Mount-Database 操作之前使用 Restore-StorageGroupCopy。在 LCR 配置中,Restore-StorageGroupCopy 用来禁用 LCR 和创建适用于 Mount-Database 的被动副本。在这两种配置中,Restore-StorageGroupCopy 将终止向被动副本的复制,并使它适用于 Mount-Database cmdlet。

语法

Restore-StorageGroupCopy -Identity <StorageGroupIdParameter> [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-ReplaceLocations <SwitchParameter>]

详细说明

要使 Exchange 2007 管理员能够激活 CCR 或 LCR 副本,进而从活动数据库或存储组的故障中恢复,需要使用 Restore-StorageGroupCopy cmdlet。在 CCR 和 LCR 配置中都可以使用该命令。默认情况下,管理员终止复制时,会使用 Restore-StorageGroupCopy cmdlet。这也用于 CCR 和 LCR 配置中。

在 LCR 配置中,管理员将通过文件系统或卷操作重新定位数据。建议使用这种方法来维护用于副本和生产数据库的路径之间的约定。

在 LCR 配置中,当管理员要终止复制并将副本的路径置于生产存储组和数据库的位置属性中时,需要使用 ReplaceLocations 参数。使用副本的位置更新生产数据库和存储组对象的路径。这将是快速操作,并允许立即装入数据库。如果不使用此选项,在生产位置下必须可以使用该副本中的数据。如果无法通过文件系统重命名命令或卷操作来实现这一目的,中断时间将与复制日志和数据库所需的时间成比例。

在 CCR 配置中,激活的副本位于不同节点中,并且处在正确的位置上。因此,没有必要作为激活的一部分来更改日志或数据库的位置。

可以使用 Restore-StorageGroupCopy cmdlet 在活动的新节点上覆盖有关装入存储组的丢失限制。例如,AutoDatabaseMountDial 可能设置为 Lossless,这意味着即使只有一个来自上次装入的节点的日志文件不能在副本中复制或重播,该数据库也不能装入。处于这种状态时,可以还原存储组副本并装入数据库。

note注意:
某些情况下,在活动的新节点上覆盖装入存储组的丢失限制,可能需要重新设定以前活动节点存储组的种子。如果将丢失区域中的一个或多个日志写入到数据库,则需要重新设定种子。

Restore-StorageGroupCopy cmdlet 可以完成以下目标:

  • 将存储组的数据库标记为可装入。

  • 提供由于在存储组中装入数据库而导致数据丢失的报告。

  • 检查副本中是否有在存储组的源服务器上创建的所有日志,如果没有,将尝试再复制一次日志。

    note注意:
    如果所有的日志文件都不可用,并且 Restore-StorageGroupCopy cmdlet 无法从源位置成功地复制它们,结果数据库会遇到数据丢失。有关 CCR 如何管理数据丢失的信息,请参阅群集连续复制
  • 对于 LCR,会禁用存储组副本。

  • 对于 LCR,如果结果数据库遇到丢失,内容索引将重新索引。

  • 对于 LCR,此命令必须在驻留存储组的服务器上运行。

    note注意:
    对于 CCR,指定的副本要成为活动副本,必须首先将其装入。装入并激活后,该副本将成为后续复制活动的新的源副本。

若要运行以下代码,必须为您使用的帐户委派以下角色:

  • Exchange Server 管理员角色和目标服务器的本地 Administrators 组

有关管理 Exchange Server 2007 所需的权限、角色委派以及权利的详细信息,请参阅权限注意事项

参数

参数 必需 类型 说明

Identity

必需

Microsoft.Exchange.Configuration.Tasks.StorageGroupIdParameter

Identity 参数接受下列值之一:

  • GUID

  • 存储组的名称

Confirm

可选

布尔值

Confirm 参数将导致命令暂停处理,并且需要管理员在继续处理之前确认该命令将执行的操作。默认值为 $true。

DomainController

可选

Microsoft.Exchange.Data.Fqdn

若要指定域控制器的完全限定的域名 (FQDN) 以找到群集邮箱服务器,请在命令中包含 DomainController 参数。

Force

可选

System.Management.Automation.SwitchParameter

当任务以编程方式运行,且提示管理输入不正确时,可以使用 Force 参数。如果 在 cmdlet 中未提供 Force 参数,则会提示进行管理输入。如果在 cmdlet 中提供了 Force 参数,但该值被忽略,则其默认值为 $true。

ReplaceLocations

可选

System.Management.Automation.SwitchParameter

在 LCR 配置中,当管理员要终止复制并将副本的路径置于生产存储组和数据库的位置属性中时,需要使用 ReplaceLocations 参数。使用副本的位置更新生产数据库和存储组对象的路径。

ReplaceLocations 参数在 CCR 配置中无效。

WhatIf

可选

布尔值

WhatIf 参数指示 cmdlet 模拟要为对象执行的操作。通过使用 WhatIf 参数,管理员可以查看要发生的更改,而不必应用任何这些更改。默认值为 $true。

错误

错误 说明

Use 'Msg 1: Cluster not available' and change task name.

由于通信问题,或由于群集不可用,此任务不能连接到群集。

Use 'Msg 2: Wrong Version' and change task name.

此服务器不是 Exchange 2007 服务器。

Use 'Msg 3: No Permissions' and change the task name.

用户不具有 Exchange Server 管理员授权。

<ServerName> or <StorageGroupName> does not exist.

指定的存储组的服务器不存在。

Restore-StorageGroupCopy: Must be run on <ServerName>'s host machine.

此任务必须在复制目标的计算机上运行。

Restore-StorageGroupCopy: ReplaceLocations can only be used with Local Continuous Replication configurations.

指定的参数不存在,或者指定的组合无效。

CCR: No continuous replication copy of '<SGName>' to restore.

LCR:No continuous replication copy of '<SGName>' to restore.

这是不受支持的复制配置。尚未启用复制。

Use 'Msg 10: Comm' and change the task name.

ReplaceLocations 参数已指定并且不能使用所需的路径更新生产存储组的位置。

'<SGName>' is not in a healthy condition; storage group must be viable for a successful mount.

指定的副本未处于正常运行状态。

The database is not dismounted. Please dismount it before proceeding.

未卸除指定存储组的数据库。

Replication for '<SGName>' is not prepared to support a Restore-StorageGroupCopy. Retry your operation after a brief wait.

复制尚未准备好,存储组不可用。

Replication for '<SGName>' is not prepared to support a Restore-StorageGroupCopy due to error (<ErrorCode>). Retry your operation after a brief wait.

发生了内部错误。Restore-StorageGroupCopy 命令失败,不能获得用于 LCR 的所有数据库相关的信息。

Replication for '<SGName>' is not prepared to support a Restore-StorageGroupCopy due to a backup in progress. Terminate the backup and retry.

因为备份正在执行,发生了内部错误。

Replication for '<SGName>' is not prepared to support a Restore-StorageGroupCopy due to error (<ErrorCode>). Retry your operation after a brief wait.

发生内部错误:未联机。

Restore-StorageGroupCopy: <SGName> has no database.

存储组中没有数据库。

Restore of <StorageGroupName> was successful. All logs were successfully copied.

Or

Restore-StorageGroupCopy: Restore of <StorageGroupName> was successful and production paths were updated. All logs were successfully copied.

Or

Restore-StorageGroupCopy: Restore of <StorageGroupName> was successful. All logs were not successfully copied.

Time of the failure was: <FailureTime>.

Last log copied was <LogFileName> at <ItsChangeTime>.

Or

Restore-StorageGroupCopu: Restore of <StorageGroupName>was successful and production paths were updated. All logs were not successfully copied.

Time of the failure was: <FailureTime>.

Last log copied was <LogFileName> at <ItsChangeTime>.

详细描述采取了哪些操作以及操作结果的成功报告,包括作为还原结果的数据丢失量。此报告还表明路径是否更新,以及下一步操作。

<SGName> already marked as available for a mount; no action taken.

存储组已经可用于装入。

示例

以下代码示例显示如何终止名为 SG1 的存储组的复制。

Restore-StorageGroupCopy -Identity:SG1