备份 MABS 服务器Back up the MABS server

若要确保在 Azure 备份服务器 (MABS) 发生故障时可以恢复数据,你需要一个用于备份 MABS 服务器的策略。To ensure that data can be recovered if Azure Backup Server (MABS) fails, you'll need a strategy for backing up the MABS server. 如果未备份,则在发生故障后需要手动重新生成,并且基于磁盘的恢复点将无法恢复。If it isn't backed up you'll need to rebuild it manually after a failure, and disk-based recovery points won't be recoverable. 你可以通过备份 MABS 数据库来备份 MABS 服务器。You can back up MABS servers by backing up the MABS database.

备份 MABS 数据库Back up the MABS database

作为 MABS 备份策略的一部分,必须备份 MABS 数据库。As part of your MABS backup strategy, you'll have to back up the MABS database. MABS 数据库名为 DPMDB。The MABS database is named DPMDB. 此数据库包含 MABS 配置以及有关 MABS 备份的数据。This database contains the MABS configuration together with data about backups of MABS. 如果发生灾难,你可以使用数据库的最新备份来重新生成 MABS 服务器的大部分功能。If there's a disaster, you can rebuild most of the functionality of a MABS server by using a recent backup of the database. 假设你可以还原数据库,基于磁带的备份是可访问的,并且它们维护所有保护组设置和备份计划。Assuming you can restore the database, tape-based backups are accessible, and they maintain all protection group settings and backup schedules. 如果 MABS 存储池磁盘未受中断影响,则基于磁盘的备份在重新生成后也可以使用。If the MABS storage pool disks were not affected by the outage, disk-based backups are also usable after a rebuild. 可以使用多种不同的方法来备份数据库。You can back up the database by using several different methods.

数据库备份方法Database backup method 优点Advantages 缺点Disadvantages
备份到 AzureBack up to Azure
  • 在 MABS 中可轻松配置和监视。Easily configured and monitored in MABS.
  • 备份数据库文件有多个位置。Multiple locations of the backup database files.
  • 云存储为灾难恢复提供了强大的解决方案。Cloud storage provides a robust solution for disaster recovery.
  • 数据库存储非常安全。Very secure storage for the database.
  • 支持 120 个在线恢复点。Supports 120 online recovery points.
  • 需要 Azure 帐户和其他 MABS 配置。Requires Azure account and additional MABS configuration. Azure 存储会产生一些费用。Incurs some cost for Azure storage.
  • 需要基于 Windows Server 的系统的受支持版本以及 Azure 代理才能访问存储在 Azure 备份保管库中的 MABS 备份。Requires a supported version of Windows Server based system with the Azure agent to gain access to MABS backups stored in the Azure backup vault. 这不能是另一个 MABS 服务器。This can't be another MABS server.
  • 如果数据库在本地托管且你要启用辅助保护,则不可使用此方法。Not an option if the database is hosted locally and you want to enable secondary protection.
  • 这需要一些额外的准备和恢复时间。Some extra preparation and recovery time is incurred.
  • 通过备份 MABS 存储池来备份数据库Back up the database by backing up the MABS storage pool
  • 易于配置和监视。Simple to configure and monitor.
  • 备份保存在 MABS 存储池磁盘上,并可在本地轻松访问。The backup is kept on the MABS storage pool disks and is easy to access locally.
  • MABS 计划的备份支持 512 个快速完整备份。MABS scheduled backups support 512 express full backups. 如果每小时备份一次,则会有 21 天的完整保护。If you back up hourly, you'll have 21 days of full protection.
  • 对于灾难恢复而言不是一个好的选择。Not a good option for disaster recovery. 它是联机的,如果 MABS 服务器或存储池磁盘发生故障,恢复可能无法按预期工作。It's online and recovery might not work as expected if the MABS server or storage pool disk fails.
  • 如果数据库在本地托管且你要启用辅助保护,则不可使用此方法。Not an option if the database is hosted locally and you want to enable secondary protection.
  • 如果 MABS 服务或控制台不运行或不工作,则需要一些准备工作和特殊步骤才能访问恢复点。Some preparation and special steps are required to gain access to the recovery points if the MABS service or console isn't running or working.
  • 通过本机 SQL Server 备份,备份到本地磁盘Back up with native SQL Server backup to a local disk
  • 内置到 SQL Server。Built-in to SQL Server.
  • 备份保存在易于访问的本地磁盘上。The backup is kept on a local disk that is easily accessible.
  • 可以计划为按需要的频率运行。It can be scheduled to run as often as you like.
  • 完全独立于 MABS。Totally independent of MABS.
  • 你可以计划一个备份文件清理。You can schedule a backup file cleanup.
  • 除非备份已复制到远程位置,否则对于灾难恢复而言不是一个好的选择。Not a good option for disaster recovery unless the backups are copied to a remote location.
  • 备份需要使用本地存储空间,这可能会限制保留期和频率。Requires local storage for backups, which may limit retention and frequency.
  • 使用本机 SQL 备份和 MABS 保护备份到受 MABS 保护的共享Back up with native SQL backup and MABS protection to a share protected by MABS
  • 在 MABS 中可轻松监视。Easily monitored in MABS.
  • 备份数据库文件有多个位置。Multiple locations of the backup database files.
  • 易于通过网络从任意 Windows 计算机进行访问。Easily accessible from any Windows machine on the network.
  • 可能是最快的恢复方法。Potentially the fastest recovery method.
  • 仅支持 64 个恢复点。Only supports 64 recovery points.
  • 对于站点灾难恢复而言不是一个好的选择。Not a good option for site disaster recovery. MABS 服务器或 MABS 存储池磁盘故障可能会妨碍恢复工作。MABS server or MABS storage pool disk failure may hinder recovery efforts.
  • 如果 MABS DB 托管在本地,并且你想要启用辅助保护,则不能使用此选项。Not an option if the MABS DB is hosted locally and you want to enable secondary protection.
  • 需要一些额外的准备工作以对其进行配置和测试。Some extra preparation is needed to get it configured and tested.
  • 如果 MABS 服务器本身已关闭,但是 MABS 存储池磁盘没有问题,则需要一些额外的准备工作和恢复时间。Some extra preparation and recovery time is needed should the MABS server itself be down but MABS storage pool disks are fine.
    • 如果你使用 MABS 保护组进行备份,建议针对数据库使用唯一的保护组。If you back up by using a MABS protection group, we recommend that you use a unique protection group for the database.

      备注

      出于还原目的,要使用 MABS 数据库还原的 MABS 安装必须与 MABS 数据库本身的版本匹配。For restore purposes, the MABS installation you want to restore with the MABS database must match the version of the MABS database itself. 例如,如果你想要恢复的数据库来自安装了更新汇总 1 的 MABS V3,则 MABS 服务器必须运行与更新汇总 1 相同的版本。For example, if the database you want to recover is from a MABS V3 with Update Rollup 1 installation, the MABS server must be running the same version with Update Rollup 1. 这意味着在还原数据库之前,可能必须先卸载 MABS,然后重新安装兼容版本的 MABS。This means that you might have to uninstall and reinstall MABS with a compatible version before you restore the database. 若要查看数据库版本,你可能需要将其手动装入临时数据库名称,然后针对该数据库运行 SQL 查询,来根据主要版本和次要版本检查最新安装的汇总。To check the database version you might have to mount it manually to a temporary database name and then run a SQL query against the database to check the last installed rollup, based on the major and minor versions.

    • 若要检查 MABS 数据库版本,请执行以下步骤:To check the MABS database version, follow these steps:

      1. 若要运行查询,请打开 SQL Management Studio,然后连接到运行 MABS 数据库的 SQL 实例。To run the query, open SQL Management Studio, and then connect to the SQL instance that's running the MABS database.

      2. 选择 MABS 数据库,然后启动新查询。Select the MABS database, and then start a new query.

      3. 将以下 SQL 查询粘贴到查询窗格并运行:Paste the following SQL query into the query pane and run it:

        Select distinct MajorVersionNumber,MinorVersionNumber ,BuildNumber, FileName FROM dbo.tbl\_AM\_AgentPatch order byMajorVersionNumber,MinorVersionNumber,BuildNumber

      如果查询结果中没有返回任何内容,或者从以前的版本升级了 MABS 服务器,但此后没有安装新的更新汇总,则不会出现 MABS 基本安装的主要、次要条目。If nothing is returned in the query results, or if the MABS server was upgraded from previous versions but no new update rollup was installed since then, there won't be an entry for the major, minor for a base installation of MABS. 若要检查与更新汇总相关联的 MABS 版本,请参阅 MABS 的生成号列表To check the MABS versions associated with update rollups see List of Build Numbers for MABS.

    备份到 AzureBack up to Azure

    1. 在开始之前,你需要运行一个脚本来检索 MABS 副本卷装入点路径,以了解哪个恢复点包含 MABS 备份。Before you start, you'll need to run a script to retrieve the MABS replica volume mount point path so that you know which recovery point contains the MABS backup. 初始复制后使用 Azure 备份执行此操作。Do this after initial replication with Azure Backup. 在该脚本中,将 dplsqlservername% 替换为托管 MABS 数据库的 SQL Server 实例的名称。In the script, replace dplsqlservername% with the name of the SQL Server instance hosting the MABS database.

      Select ag.NetbiosName as ServerName,ds.DataSourceName,vol.MountPointPath
      from tbl_IM_DataSource as ds
      join tbl_PRM_LogicalReplica as lr on ds.DataSourceId=lr.DataSourceId
      join tbl_AM_Server as ag on ds.ServerId=ag.ServerId
      join tbl_SPM_Volume as vol on lr.PhysicalReplicaId=vol.VolumeSetID
      and vol.Usage =1
      and lr.Validity in (1,2)
      where ds.datasourcename like '%dpmdb%'
      and servername like '%dpmsqlservername%' --netbios name of server hosting DPMDB
      

      请确保你具有在安装 Azure 恢复服务代理和在 Azure 备份保管库中注册 MABS 服务器时指定的密码。Make sure you have the passcode that was specified when the Azure Recovery Services Agent was installed and the MABS server was registered in the Azure Backup vault. 还原备份时需要此密码。You'll need this passcode to restore the backup.

    2. 创建 Azure 备份保管库、下载 Azure 备份代理安装文件和保管库凭据。Create an Azure Backup vault, download the Azure Backup Agent installation file and vault credentials. 运行安装文件以在 MABS 服务器上安装代理,并使用保管库凭据在保管库中注册 MABS 服务器。Run the installation file to install the agent on the MABS server and use the vault credentials to register the MABS server in the vault. 了解详细信息Learn more.

    3. 配置保管库后,设置包含 MABS 数据库的 MABS 保护组。After the vault is configured, set up a MABS protection group that contains the MABS database. 选择将其备份到磁盘和 Azure。Select to back it up to disk and to Azure.

    从 Azure 恢复 MABS 数据库Recover the MABS database from Azure

    可以使用在 Azure 备份保管库中注册的任何 MABS 服务器从 Azure 恢复数据库,如下所示:You can recover the database from Azure using any MABS server that's registered in the Azure Backup vault, as follows:

    1. 在“MABS 控制台”中,选择“恢复” > “添加外部 MABS” 。In the MABS console, select Recovery > Add External MABS.

    2. 提供保管库凭据(从 Azure 备份保管库下载)。Provide the vault credentials (download from the Azure Backup vault). 请注意,凭据的有效期为两天。Note that the credentials are only valid for two days.

    3. 在“选择要恢复的外部 MABS”,选择要为其恢复数据库的 MABS 服务器,键入加密密码,然后选择“确定” 。In Select External MABS for Recovery, select the MABS server for which you want to recover the database, type in the encryption passphrase, and select OK.

    4. 从可用点列表中选择要使用的恢复点。Select the recovery point you want to use from the list of available points. 选择“清除外部 MABS”,返回本地 MABS 视图。Select Clear External MABS to return to the local MABS view.

    将 MABS 数据库备份到 MABS 存储池Back up the MABS database to MABS storage pool

    备注

    此选项适用于具有新式备份存储的 MABS。This option is applicable for MABS with Modern Backup Storage.

    1. 在“MABS 控制台”中,选择“保护” > “创建保护组” 。In the MABS console, select Protection > Create protection group.
    2. 在“选择保护组类型” 页上,选择“服务器” 。On the Select Protection Group Type page, select Servers.
    3. 在“选择组成员”页上,选择“DPM 数据库” 。On the Select group members page, select DPM database. 展开“MABS 服务器”并选择“DPMDB”。Expand the MABS server and select DPMDB.
    4. 在“选择数据保护方法” 页上,选择“我想使用磁盘进行短期保护” 。On the Select Data Protection Method page, select I want short-term protection using disk. 指定短期保护策略选项。Specify the short-term protection policy options.
    5. 初始复制 MABS 数据库后,运行以下 SQL 脚本:After initial replication of the MABS database, run the following SQL script:
    select AG.NetbiosName, DS.DatasourceName, V.AccessPath, LR.PhysicalReplicaId from tbl_IM_DataSource DS
    join tbl_PRM_LogicalReplica as LR
    on DS.DataSourceId = LR.DataSourceId
    join tbl_AM_Server as AG
    on DS.ServerId=AG.ServerId
    join tbl_PRM_ReplicaVolume RV
    on RV.ReplicaId = LR.PhysicalReplicaId
    join tbl_STM_Volume V
    on RV.StorageId = V.StorageId
    where datasourcename like N'%dpmdb%' and ds.ProtectedGroupId is not null
    and LR.Validity in (1,2)
    and AG.ServerName like N'%<dpmsqlservername>%' -- <dpmsqlservername> is a placeholder, put netbios name of server hosting DPMDB
    

    恢复 MABS 数据库Recover MABS database

    若要使用相同的数据库重构 MABS,需要首先恢复 MABS 数据库并将其与新安装的 MABS 同步。To reconstruct your MABS with the same DB, you need to first recover the MABS database and sync it with the freshly installed MABS.

    使用以下步骤Use the following steps

    1. 打开管理命令提示符并运行 psexec.exe -s powershell.exe,以在系统上下文中启动 PowerShell 窗口。Open an administrative command prompt and run psexec.exe -s powershell.exe to start a PowerShell window in system context.
    2. 确定要从何处恢复数据库:Decide the location from where you want to recover the database:

    从上次备份复制数据库To copy the database from the last backup

    1. 导航到副本 VHD 路径 \<MABSServer FQDN\>\<PhysicalReplicaId\>\<PhysicalReplicaId\>Navigate to replica VHD path \<MABSServer FQDN\>\<PhysicalReplicaId\>\<PhysicalReplicaId\>
    2. 使用 mount-vhd disk0.vhdx 命令装载其中存在的“disk0.vhdx”。Mount the disk0.vhdx present in it using mount-vhd disk0.vhdx command.
    3. 装载副本 VHD 后,通过 mountvol.exe 使用 SQL 脚本输出中的物理副本 ID 为副本卷分配驱动器号。Once the replica VHD is mounted, use mountvol.exe to assign a drive letter to the replica volume using the physical replica ID from the SQL script output. 例如:mountvol X: \?\Volume{}\For example: mountvol X: \?\Volume{}\

    从以前的恢复点复制数据库To copy the database from a previous recovery point

    1. 导航到 DPMDB 容器目录 \<MABSServer FQDN\>\<PhysicalReplicaId\>Navigate to the DPMDB container directory \<MABSServer FQDN\>\<PhysicalReplicaId\>. 你将看到多个目录下有一些唯一的 GUID 标识符,对应针对 MABS DB 获取的恢复点。You'll see multiple directories with some unique GUID identifiers under it corresponding recovery points taken for the MABS DB. 其他目录表示 PIT/恢复点。Other directories represent a PIT/recovery point.

    2. 导航到任何 PIT VHD 路径,例如 \<MABSServer FQDN\>\<PhysicalReplicaId\>\<PITId\>,并使用 mount-vhd disk0.vhdx 命令装载其中存在的“disk0.vhdx”。Navigate to any PIT vhd path, for example \<MABSServer FQDN\>\<PhysicalReplicaId\>\<PITId\> and mount the disk0.vhdx present in it using the mount-vhd disk0.vhdx command.

    3. 装载副本 VHD 后,通过 mountvol.exe 使用 SQL 脚本输出中的物理副本 ID 为副本卷分配驱动器号。Once the replica VHD is mounted, use mountvol.exe to assign a drive letter to the replica volume, using the physical replica ID from the SQL script output. 例如:mountvol X: \?\Volume{}\For example: mountvol X: \?\Volume{}\

      在上述步骤中,所有带尖括号的术语都是占位符。All of the terms that appear with angular braces in the above steps are place holders. 请将它们替换为适当的值,如下所示:Replace them with appropriate values as follows:

      • ReFSVolume - SQL 脚本输出中的访问路径ReFSVolume - Access path from the SQL script output
      • MABSServer FQDN - MABS 服务器的完全限定名称MABSServer FQDN - Fully qualified name of the MABS server
      • PhysicalReplicaId - SQL 脚本输出中的物理副本 IDPhysicalReplicaId - Physical replica ID from the SQL script out
      • PITId - 容器目录中除物理副本 ID 以外的 GUID 标识符。PITId - GUID identifier other than the physical replica ID in the container directory.
    4. 打开另一个管理命令提示符,并运行 psexec.exe -s cmd.exe 在系统上下文中启动命令提示符。Open another administrative command prompt and run psexec.exe -s cmd.exe to start a command prompt in system context.

    5. 将目录更改为 X: 驱动器,并导航到 MABS 数据库文件的位置。Change the directory to the X: drive and navigate to the location of the MABS database files.

    6. 将它们复制到易于从中还原的位置。Copy them to a location that's easy to restore from. 复制后,退出 psexec cmd 窗口。Exit the psexec cmd window after you copy.

    7. 转到步骤 1 中打开的 psexec PowerShell 窗口,导航到 VHDX 路径,然后使用命令 dismount-vhd disk0.vhdx 卸除 VHDX。Go to the psexec PowerShell window opened in step 1, navigate to the VHDX path, and dismount the VHDX by using the command dismount-vhd disk0.vhdx.

    8. 在重新安装 MABS 服务器之后,可以通过运行 DPMSYNC-RESTOREDB 命令使用还原的 DPMDB 附加到 MABS 服务器。After reinstalling the MABS server, you can use the restored DPMDB to attach to the MABS server by running DPMSYNC-RESTOREDB command.

    9. 完成 DPMSYNC-RESTOREDB 后,运行 DPMSYNC-SYNCRun DPMSYNC-SYNC once DPMSYNC-RESTOREDB is complete.

    通过备份 MABS 存储池来备份数据库Back up the database by backing up the MABS storage pool

    备注

    此选项适用于具有旧存储的 MABS。This option is applicable for MABS with legacy storage.

    在开始之前,你需要运行一个脚本来检索 MABS 副本卷装入点路径,以了解哪个恢复点包含 MABS 备份。Before you start, you'll need to run a script to retrieve the MABS replica volume mount point path so that you know which recovery point contains the MABS backup. 初始复制后使用 Azure 备份执行此操作。Do this after initial replication with Azure Backup. 在该脚本中,将 dplsqlservername% 替换为托管 MABS 数据库的 SQL Server 实例的名称。In the script, replace dplsqlservername% with the name of the SQL Server instance hosting the MABS database.

    Select ag.NetbiosName as ServerName,ds.DataSourceName,vol.MountPointPath
    from tbl_IM_DataSource as ds
    join tbl_PRM_LogicalReplica as lr on ds.DataSourceId=lr.DataSourceId
    join tbl_AM_Server as ag on ds.ServerId=ag.ServerId
    join tbl_SPM_Volume as vol on lr.PhysicalReplicaId=vol.VolumeSetID
    and vol.Usage =1
    and lr.Validity in (1,2)
    where ds.datasourcename like '%dpmdb%'
    and servername like '%dpmsqlservername%' --netbios name of server hosting DPMDB
    
    1. 在“MABS 控制台”中,选择“保护” > “创建保护组” 。In the MABS console, select Protection > Create protection group.

    2. 在“选择保护组类型” 页上,选择“服务器” 。On the Select Protection Group Type page, select Servers.

    3. 在“选择组成员”页上,选择 MABS 数据库。On the Select group members page, select the MABS database. 展开“MABS 服务器”项,并选择“DPMDB”。Expand the MABS server item and select DPMDB.

    4. 在“选择数据保护方法”页上,选择“我想使用磁盘进行短期保护” 。On the Select Data Protection Method page, select I want short-term protection using disk. 指定短期保护策略选项。Specify the short-term protection policy options. 建议 MABS 数据库的保留期为两周。We recommend a retention range of two weeks for MABS databases.

    恢复数据库Recover the database

    如果 MABS 服务器仍在运行且存储池完好无损(例如 MABS 服务或控制台出现问题),则按如下所示从副本卷或影子副本复制数据库:If the MABS server is still operational and the storage pool is intact (such as problems with the MABS service or console), then copy the database from the replica volume or a shadow copy as follows:

    1. 确定想要开始恢复数据库的时间。Decide from when you want to recover the database.

      • 如果要从 MABS 副本卷中直接获取的最新备份复制数据库,请通过“mountvol.exe”使用 SQL 脚本输出中的 GUID 为副本卷分配驱动器号。If you want to copy the database from the last backup taken directly from the MABS replica volume, use mountvol.exe to assign a drive letter to the replica volume using the GUID from the SQL script output. 例如:C:\Mountvol X: \\?\Volume{d7a4fd76\-a0a8\-11e2\-8fd3\-001c23cb7375}\For example: C:\Mountvol X: \\?\Volume{d7a4fd76\-a0a8\-11e2\-8fd3\-001c23cb7375}\

      • 如果要从以前的恢复点(影子副本)复制数据库,则需要使用 SQL 脚本输出中的卷 GUID 列出副本的所有影子副本。If you want to copy the database from a previous recovery point (shadow copy), then you need to list all the shadow copies for the replica using the volume GUID from the SQL script output. 此命令列出该卷的影子副本:C:\>Vssadmin list shadows /for\=\\?\Volume{d7a4fd76-a0a8-11e2-8fd3-001c23cb7375}\This command lists shadow copies for that volume: C:\>Vssadmin list shadows /for\=\\?\Volume{d7a4fd76-a0a8-11e2-8fd3-001c23cb7375}\. 请注意创建时间和要从中恢复的影子副本 ID。Note the creation time and the shadow copy ID you want to recover from.

    2. 然后通过“diskshadow.exe”使用影子副本 ID 将影子副本装载到未使用的驱动器号 X: 上,以便可以复制数据库文件。Then use diskshadow.exe to mount the shadow copy to an unused drive letter X: using the shadow copy ID, so you can copy the database files.

    3. 打开管理命令提示符,并运行 psexec.exe -s cmd.exe 在系统上下文中启动命令提示符,以便有权导航到副本卷 (X:) 并复制文件。Open an administrative command prompt and run psexec.exe -s cmd.exe to start a command prompt in system context, so you have permission to navigate to the replica volume (X:) and copy the files.

    4. CD 到 X: 驱动器,并导航到 MABS 数据库文件的位置。CD to the X: drive and navigate to the location of the MABS database files. 将它们复制到易于从中还原的位置。Copy them to a location that's easy to restore from. 复制完成后,显示 psexec cmd 窗口,然后运行“diskshadow.exe”并隐藏 X: 卷。After the copy is complete exist the psexec cmd window, and run diskshadow.exe and unexpose the X: volume.

    5. 现在,你可以使用 SQL Management Studio 或运行“DPMSYNC-RESTOREDB”来还原数据库文件。Now you can restore the database files by using SQL Management Studio or by running DPMSYNC-RESTOREDB.

    通过本机 SQL Server 备份,备份到本地磁盘Back up with native SQL Server backup to a local disk

    你可以使用本机 SQL Server 备份将 MABS 数据库备份到本地磁盘,而不依赖于 MABS。You can back up the MABS database to a local disk with native SQL Server backup, independent of MABS.

    备份到受 MABS 保护的共享Back up to a share protected by MABS

    此备份选项使用本机 SQL 将 MABS 数据库备份到共享,使用 MABS 保护共享,并使用 Windows VSS 以前的版本来帮助还原。This backup option uses native SQL to back up the MABS database to a share, protects the share with MABS, and uses Windows VSS previous versions to facilitate the restore.

    开始之前Before you start

    1. 在 SQL Server 上,在有足够可用空间的驱动器上创建一个文件夹,以保存备份的单个副本。On the SQL Server, make a folder on a drive with enough free space to hold a single copy of a backup. 例如:C:\MABSBACKUPFor example: C:\MABSBACKUP.

    2. 共享该文件夹。Share the folder. 例如,将 C:\MABSBACKUP 文件夹作为 DPMBACKUP 共享。For example, share C:\MABSBACKUP folder as DPMBACKUP.

    3. 将以下 OSQL 命令复制并粘贴到记事本中,并将其保存到名为 C:\MABSACKUP\bkupdb.cmd 的文件中。Copy and paste the OSQL command below into Notepad and save it to a file named C:\MABSACKUP\bkupdb.cmd. 请确保没有 .txt 扩展名。Make sure there's no .txt extension. 修改 SQL_Instance_name 和 DPMDB_NAME,使其与 MABS 服务器使用的实例和 DPMDB 名称匹配。Modify the SQL_Instance_name and DPMDB_NAME to match the instance and DPMDB name used by your MABS server.

      OSQL -E -S localhost\SQL_INSTANCE_NAME -Q "BACKUP DATABASE DPMDB_NAME TO DISK='C:\DPMBACKUP\dpmdb.bak' WITH FORMAT"
      
    4. 使用记事本打开 MABS 服务器上 C:\Program Files\Microsoft System Center\DPM\DPM\Scripting 文件夹下的“ScriptingConfig.xml”文件。Using Notepad, open the ScriptingConfig.xml file located under the C:\Program Files\Microsoft System Center\DPM\DPM\Scripting folder on the MABS server.

    5. 修改“ScriptingConfig.xml”,并将“DataSourceName=”更改为包含 DPMDBBACKUP 文件夹/共享的驱动器号 。Modify ScriptingConfig.xml and change DataSourceName= to be the drive letter that contains the DPMDBBACKUP folder/share. 将 PreBackupScript 条目更改为步骤 3 中保存的“bkupdb.cmd”的完整路径和名称。Change the PreBackupScript entry to the full path and name of bkupdb.cmd saved in step 3.

      <?xml version="1.0" encoding="utf-8"?>
      <ScriptConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns="https://schemas.microsoft.com/2003/dls/ScriptingConfig.xsd">
      <DatasourceScriptConfig DataSourceName="C:">
      <PreBackupScript>C:\MABSDBBACKUP\bkupdb.cmd</PreBackupScript>
      <TimeOut>120</TimeOut>
      </DatasourceScriptConfig>
      </ScriptConfiguration>
      
    6. 保存对“ScriptingConfig.xml”所做的更改。Save the changes to ScriptingConfig.xml.

    7. 使用 MABS 保护 C:\MABSBACKUP 文件夹或 \sqlservername\MABSBACKUP 共享,并等待创建初始副本。Protect the C:\MABSBACKUP folder or the \sqlservername\MABSBACKUP share using MABS and wait for the initial replica to be created. 运行预备份脚本后,在 C:\MABSBACKUP 文件夹中应存在一个“dpmdb.bak”,该文件又被复制到 MABS 副本中。There should be a dpmdb.bak in the C:\MABSBACKUP folder as a result of the pre-backup script running, which was in turn copied to the MABS replica.

    8. 如果未启用自助恢复,则需要执行一些其他步骤来共享副本上的 MABSBACKUP 文件夹:If you don't enable self-service recovery, you'll need some additional steps to share out the MABSBACKUP folder on the replica:

      1. 在“MABS 控制台”>“保护”中,找到 MABSBACKUP 数据源并选择它。In the MABS console > Protection, locate the MABSBACKUP data source and select it. 在详细信息部分,选择指向副本路径的链接上的“单击可查看详细信息”,并将该路径复制到记事本中。In the details section, select Click to view details on the link to the replica path and copy the path into Notepad. 删除源路径,并保留目标路径。Remove the source path and retain the destination path. 该路径应类似于以下内容:C:\Program Files\Microsoft System Center\DPM\DPM\Volumes\Replica\File System\vol_c9aea05f-31e6-45e5-880c-92ce5fba0a58\454d81a0-0d9d-4e07-9617-d49e3f2aa5de\Full\DPMBACKUPThe path should look similar to the following: C:\Program Files\Microsoft System Center\DPM\DPM\Volumes\Replica\File System\vol_c9aea05f-31e6-45e5-880c-92ce5fba0a58\454d81a0-0d9d-4e07-9617-d49e3f2aa5de\Full\DPMBACKUP.

      2. 使用共享名称“MABSSERVERNAME-DPMDB”共享该路径。Make a share to that path using the share name MABSSERVERNAME-DPMDB. 你可以在管理命令提示符中使用以下 Net Share 命令。You can use the Net Share command below from an administrative command prompt.

        Net Share MABSSERVERNAME-dpmdb="C:\Program Files\Microsoft System Center\DPM\DPM\Volumes\Replica\File System\vol_c9aea05f-31e6-45e5-880c-92ce5fba0a58\454d81a0-0d9d-4e07-9617-d49e3f2aa5de\Full\DPMBACKUP"
        

    配置备份Configure the backup

    你可以使用 SQL Server 本机备份像备份任何其他 SQL Server 数据库一样备份 MABS 数据库。You can back up the MABS database as you would any other SQL Server database using SQL Server native backup.

    恢复 MABS 数据库Recover the MABS database

    1. 使用 Explorer 从任何 Windows 计算机连接到 \\MABSServer\MABSSERVERNAME-dpmdb 共享。Connect to the \\MABSServer\MABSSERVERNAME-dpmdb share using Explorer from any Windows computer.

    2. 右键单击“dpmdb.bak”文件以查看属性。Right-click the dpmdb.bak file to view properties. “以前的版本” 选项卡上将显示可以选择和复制的所有备份。On the Previous Versions tab are all the backups that you can select and copy. 此外,还可以轻松地访问仍然位于 C:\MABSBACKUP 文件夹中的最新备份。There is also the very last backup still located in the C:\MABSBACKUP folder that is also easily accessible.

    3. 如果需要将附加 SAN 的 MABS 存储池磁盘移动到另一台服务器才能从副本卷中读取数据,或者需要重新安装 Windows 才能读取本地附加的磁盘,则需要事先知道 MABS 副本卷装入点路径或卷 GUID,以了解哪个卷保存数据库备份。If you need to move a SAN attached MABS storage pool disk to another server to be able to read from the replica volume, or to reinstall Windows to read locally attached disks, you'll need to know the MABS Replica volume Mount point path or Volume GUID beforehand so you know what volume holds the database backup. 你可以在启动保护之后但需要还原之前,随时使用以下 SQL 脚本来提取该信息。You can use the SQL script below to extract that information any time after initial protection but before the need to restore. %dpmsqlservername% 替换为托管数据库的 SQL Server 的名称。Replace the %dpmsqlservername% with the name of the SQL Server hosting the database.

      Select ag.NetbiosName as
      ServerName,ds.DataSourceName,vol.MountPointPath,vol.GuidName
      from tbl_IM_DataSource as ds
      join tbl_PRM_LogicalReplica as lr on ds.DataSourceId=lr.DataSourceId
      join tbl_AM_Server as ag on ds.ServerId=ag.ServerId
      join tbl_SPM_Volume as vol on lr.PhysicalReplicaId=vol.VolumeSetID
      and vol.Usage =1
      and lr.Validity in (1,2)
      where ds.datasourcename like '%C:\%' -- volume drive letter for DPMBACKUP
      and servername like '%dpmsqlservername%' --netbios name of server hosting DPMDB
      
      
    4. 如果在移动 MABS 存储池磁盘或重新生成 MABS 服务器后需要恢复,请执行以下操作:If you need to recover after moving the MABS storage pool disks or a MABS server rebuild:

      1. 你具有卷 GUID,因此该卷需要装入另一台 Windows 服务器或在重新生成 MABS 服务器之后,通过 mountvol.exe 使用 SQL 脚本输出 (C:\Mountvol X: \\?\Volume{d7a4fd76-a0a8-11e2-8fd3-001c23cb7375}\) 中的卷 GUID 为其分配驱动器号。You have the volume GUID, so should that volume need to be mounted on another Windows server or after a MABS server rebuild, use mountvol.exe to assign it a drive letter using the volume GUID from the SQL script output: C:\Mountvol X: \\?\Volume{d7a4fd76-a0a8-11e2-8fd3-001c23cb7375}\.

      2. 使用驱动器号和表示文件夹结构的部分副本路径,重新共享副本卷上的 MABSBACKUP 文件夹。Reshare the MABSBACKUP folder on the replica volume using the drive letter and portion of the replica path representing the folder structure.

        net share SERVERNAME-DPMDB="X:\454d81a0-0d9d-4e07-9617-d49e3f2aa5de\Full\DPMBACKUP"
        
      3. 使用 Explorer 从任何 Windows 计算机连接到 \\SERVERNAME\MABSSERVERNAME-dpmdb 共享。Connect to the \\SERVERNAME\MABSSERVERNAME-dpmdb share using Explorer from any Windows computer.

      4. 右键单击“dpmdb.bak”文件以查看属性。Right-click the dpmdb.bak file to view the properties. “以前的版本” 选项卡上将显示可以选择和复制的所有备份。On the Previous Versions tab are all the backups that you can select and copy.

    使用 DPMSyncUsing DPMSync

    “DpmSync”是一个命令行工具,它使你能够将 MABS 数据库与存储池中磁盘的状态以及安装的保护代理同步。DpmSync is a command-line tool that enables you to synchronize the MABS database with the state of the disks in the storage pool and with the installed protection agents. DpmSync 还原 MABS 数据库,将 MABS 数据库与存储池中的副本同步,还原报表数据库,并重新分配缺失的副本。DpmSync restores the MABS database, synchronizes the MABS database with the replicas in the storage pool, restores the Report database, and reallocates missing replicas.

    参数Parameters

    参数Parameter 说明Description
    -RestoreDb -RestoreDb 从指定位置还原 MABS 数据库。Restores a MABS database from a specified location.
    -Sync -Sync 同步还原的数据库。Synchronizes restored databases. 还原数据库后,必须运行“DpmSync-Sync”。You must run DpmSync -Sync after you restore the databases. 运行“DpmSync-Sync”之后,某些副本可能仍标记为缺失。After you run DpmSync -Sync, some replicas may still be marked as missing.
    -DbLoc location-DbLoc location 标识 MABS 数据库备份的位置。Identifies the location of the backup of the MABS database.
    -InstanceName -InstanceName
    server\instanceserver\instance
    DPMDB 必须还原到的实例。Instance to which DPMDB must be restored.
    -ReallocateReplica -ReallocateReplica 重新分配所有缺少的副本卷而不进行同步。Reallocates all missing replica volumes without synchronization.
    -DataCopied -DataCopied 指示已完成将数据加载到新分配的副本卷中。Indicates that you have completed loading data into the newly allocated replica volumes. 这仅适用于客户端计算机。This is applicable for client computers only.

    示例 1: 若要从 MABS 服务器上的本地备份媒体还原 MABS 数据库,请运行以下命令:Example 1: To restore the MABS database from local backup media on the MABS server, run the following command:

    DpmSync -RestoreDb -DbLoc G:\DPM\Backups\2005\November\DPMDB.bak
    

    还原 MABS 数据库后,要同步数据库,请运行以下命令:After you restore the MABS database, to synchronize the databases, run the following command:

    DpmSync -Sync
    

    在还原并同步 MABS 数据库之后和还原副本之前,请运行以下命令以重新分配副本的磁盘空间:After you restore and synchronize the MABS database and before you restore the replica, run the following command to reallocate disk space for the replica:

    DpmSync -ReallocateReplica
    

    示例 2: 若要从远程数据库还原 MABS 数据库,请在远程计算机上运行以下命令:Example 2: To restore the MABS database from a remote database, run the following command on the remote computer:

    DpmSync -RestoreDb -DbLoc G:\DPM\Backups\2005\November\DPMDB.bak -InstanceName contoso\ms$dpm
    

    还原 MABS 数据库后,要同步数据库,请在 MABS 服务器上运行以下命令:After you restore the MABS database, to synchronize the databases, run the following command on the MABS server:

    DpmSync -Sync
    

    在还原并同步 MABS 数据库之后和还原副本之前,请在 MABS 服务器上运行以下命令以重新分配副本的磁盘空间:After you restore and synchronize the MABS database and before you restore the replica, run the following command on the MABS Server to reallocate disk space for the replica:

    DpmSync -ReallocateReplica
    

    后续步骤Next steps