如何重新安装 Virtual Machine Manager 时保留数据库

重要说明:本文是由 Microsoft 机器翻译软件进行的翻译并可能由 Microsoft 社区通过社区翻译机构(CTF)技术进行后期编辑,或可能是由人工进行的翻译。Microsoft 同时向您提供机器翻译、人工翻译及社区后期编辑的文章,以便对我们知识库中的所有文章以多种语言提供访问。翻译的文章可能存在词汇、句法和/或语法方面的错误。Microsoft 对由于内容的误译或客户对内容的使用所导致的任何不准确、错误或损失不承担责任。

点击这里察看该文章的英文版: 3132774
概要
如果您具有 Microsoft System Center 2012 R2 Virtual Machine Manager (VMM 2012 R2) 安装,您可能需要删除然后重新安装 VMM,但仍保留在当前安装的所有数据库信息。
更多信息
若要执行此操作,请按照下列步骤操作:
  1. 当启动 Virtual Machine Manager 中删除的过程时,选择保留数据选项。
  2. 打开 SQL 管理 Studio 中,并将连接到现有的 VMM 数据库。
  3. 运行下列存储的过程:
    /****** Object: StoredProcedure [dbo].[prc_WLC_GetVNetworkAdapterByNicId] Script Date: 12/16/2015 2:13:12 AM ******/ -- ========================================================= -- Create date: 08/31/2007 -- Description: Get VNetworkAdapter for a given NicId -- ========================================================= ALTER PROCEDURE [dbo].[prc_WLC_GetVNetworkAdapterByNicId]     @VNicId uniqueidentifier AS BEGIN     DECLARE @error int     SET @error = 0     SET NOCOUNT ON;     SELECT       [Name],       [Description],       [OwnerIdentifier],       [CreationTime],       vna.[ModifiedTime],       [Accessibility],       [ObjectState],       [VNicId],       [HWProfileId],       [ParentType],       [VirtualNetwork],       [MACAddressType],       [MACAddress],       [IPv4AddressType],       [IPv6AddressType],       [PortId],       [DeviceId],       [NetworkAdapterType],       [VMSubnetId],       [VMNetworkId],       [PortClassificationId],       [PortProfileSetId],       [VLanEnabled],       [VLanId],       [VmwAdapterIndex],       [VmwPortGroup],       [SlotId],       [MACSpoofingEnabled],       [EnableGuestIPNetworkVirtualizationUpdates],       [VMNetworkOptimizationEnabled],       [HostId],       [LogicalSwitchId],       [NetworkKBytesReadTieredPerfCounterID],       [NetworkKBytesWriteTieredPerfCounterID],       [VMNetworkServiceSetting],       [UsesSriov],       [IsUsedForHostManagement],       [IPv4Addresses],       [IPv6Addresses],       [DefaultGateways],       [DNSServers],       [TemplateNicName], compliance.PortClassificationComplianceErrors AS [PortClassificationComplianceErrors],       compliance.VMNetworkComplianceErrors AS [VMNetworkComplianceErrors]     FROM dbo.tbl_WLC_VNetworkAdapter vna     LEFT JOIN dbo.tbl_NetMan_VirtualNetworkAdapterCompliance compliance         ON vna.VNicId = compliance.VirtualNetworkAdapterId     WHERE VNicId = @VNicId     SET @error = @@ERROR     SET NOCOUNT OFF     RETURN @error END IF EXISTS (SELECT * FROM dbo.sysobjects            WHERE id = OBJECT_ID(N'[dbo].[prc_RBS_UserRole_Add]')            AND OBJECTPROPERTY(id, N'IsProcedure') = 1) SET NOEXEC OFF ELSE SET NOEXEC ON GO /****** Object:  StoredProcedure [dbo].[prc_RBS_UserRole_Add]    Script Date: 10/03/2007 12:13:45 ******/ ALTER PROCEDURE [dbo].[prc_RBS_UserRole_Add]     ( @RoleID uniqueidentifier,         @ProfileType tinyint,         @Description nvarchar(2048),         @Name nvarchar(256),         @OwnerIdentifier nvarchar(256),         @ParentUserRole uniqueidentifier,         @LastUpdatedTimestamp datetime,         @ShowPROTips bit,         @VMNetworkMaximum smallint,         @VMNetworkMaximumPerUser smallint,         @VPNConnectionMaximum smallint,         @VPNConnectionMaximumPerUser smallint,         @VMNetworkVPNMaximumBandwidthInKbps bigint,         @VMNetworkVPNMaximumBandwidthOutKbps bigint,         @NATConnectionMaximum smallint = NULL,         @NATConnectionMaximumPerUser smallint = NULL     ) AS BEGIN TRAN SET NOCOUNT ON DECLARE @error int DECLARE @IsDuplicateName bit DECLARE @IsRoleAlreadyPresent bit SELECT @IsDuplicateName = [dbo].[fn_RBS_UserRole_NameExists](@RoleID, @ParentUserRole, @Name) -- This is especially used in Upgrade scenarios where we are inserting Administrator role SELECT @IsRoleAlreadyPresent = Count(RoleID) FROM [dbo].[tbl_RBS_UserRole] WHERE RoleID = @RoleID IF (@IsDuplicateName = 0    AND @IsRoleAlreadyPresent = 0) BEGIN   INSERT INTO [dbo].[tbl_RBS_UserRole]            ([RoleID]            ,[ProfileType]            ,[Description]            ,[Name]            ,[OwnerIdentifier]            ,[ParentUserRole]            ,[LastUpdatedTimestamp]            ,[ShowPROTips]            ,[VMNetworkMaximum]            ,[VMNetworkMaximumPerUser]            ,[VPNConnectionMaximum]            ,[VPNConnectionMaximumPerUser] ,[VMNetworkVPNMaximumBandwidthInKbps]            ,[VMNetworkVPNMaximumBandwidthOutKbps]            ,[NATConnectionMaximum]            ,[NATConnectionMaximumPerUser] ) VALUES (         @RoleID,         @ProfileType,         @Description,         @Name,         @OwnerIdentifier,         @ParentUserRole,         @LastUpdatedTimestamp,         @ShowPROTips,         @VMNetworkMaximum,         @VMNetworkMaximumPerUser,         @VPNConnectionMaximum,         @VPNConnectionMaximumPerUser,         @VMNetworkVPNMaximumBandwidthInKbps,         @VMNetworkVPNMaximumBandwidthOutKbps,         @NATConnectionMaximum,         @NATConnectionMaximumPerUser )   -- Insert flattened tree of the hierarchy for this user role   INSERT INTO [dbo].[tbl_RBS_UserRoleHierarchy]   SELECT RoleId, ParentRoleId, hl   FROM view_RBS_UserRoleParentChildRelation ur where ur.RoleID = @RoleID   SELECT @error = @@ERROR END ELSE BEGIN   SET @error = 50008 END SET NOCOUNT OFF COMMIT TRAN RETURN @error Go SET NOEXEC OFF --------------------------------------------------------------------------------------------IF EXISTS (SELECT * FROM dbo.sysobjects            WHERE id = OBJECT_ID(N'[dbo].[prc_RBS_UserRole_CommonUpdate]')            AND OBJECTPROPERTY(id, N'IsProcedure') = 1) SET NOEXEC OFF ELSE SET NOEXEC ON GO /****** Object:  StoredProcedure [dbo].[prc_RBS_UserRole_CommonUpdate]    Script Date: 10/03/2007 12:13:45 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[prc_RBS_UserRole_CommonUpdate] (         @RoleID uniqueidentifier,         @Description nvarchar(2048),         @OwnerIdentifier nvarchar(256),         @Name nvarchar(256),         @LastUpdatedTimestamp datetime,         @ShowPROTips bit,         @VMNetworkMaximum smallint,         @VMNetworkMaximumPerUser smallint,         @VPNConnectionMaximum smallint,         @VPNConnectionMaximumPerUser smallint,         @VMNetworkVPNMaximumBandwidthInKbps bigint,         @VMNetworkVPNMaximumBandwidthOutKbps bigint,         @NATConnectionMaximum smallint = NULL,         @NATConnectionMaximumPerUser smallint = NULL     ) AS SET NOCOUNT ON DECLARE @error int DECLARE @ParentUserRole uniqueidentifier DECLARE @IsDuplicateName bit DECLARE @OldName nvarchar(256) SELECT @ParentUserRole = [ParentUserRole], @OldName = [Name] FROM [dbo].[tbl_RBS_UserRole] WHERE [RoleID] = @RoleID IF (@OldName = @Name) BEGIN    -- We are not changing role name. This is necessary if Admin has already an SSU1 and TA created SSU1, we should not error out here    SELECT @IsDuplicateName = 0 END ELSE BEGIN    SELECT @IsDuplicateName = [dbo].[fn_RBS_UserRole_NameExists](@RoleID, @ParentUserRole, @Name) END IF (@IsDuplicateName = 0) BEGIN UPDATE [dbo].[tbl_RBS_UserRole]            SET [Description] = @Description,            [OwnerIdentifier] = @OwnerIdentifier,            [Name] = @Name,            [LastUpdatedTimestamp] = @LastUpdatedTimestamp,            [ShowPROTips] = @ShowPROTips,            [VMNetworkMaximum] = @VMNetworkMaximum,            [VMNetworkMaximumPerUser] = @VMNetworkMaximumPerUser,            [VPNConnectionMaximum] = @VPNConnectionMaximum,            [VPNConnectionMaximumPerUser] = @VPNConnectionMaximumPerUser,            [VMNetworkVPNMaximumBandwidthInKbps] = @VMNetworkVPNMaximumBandwidthInKbps,            [VMNetworkVPNMaximumBandwidthOutKbps] = @VMNetworkVPNMaximumBandwidthOutKbps,            [NATConnectionMaximum] = @NATConnectionMaximum,            [NATConnectionMaximumPerUser] = @NATConnectionMaximumPerUser   WHERE [RoleID] = @RoleID SELECT @error = @@ERROR END ELSE BEGIN   SET @error = 50008 END SET NOCOUNT OFF RETURN @error GO SET NOEXEC OFF
  4. 从原始安装媒体中安装 VMM 2012 R2。在某些情况下,VMM 服务可能无法正常启动。但是,这种行为可以忽略在此处。
  5. VMM 2012 R2 以前安装的版本应用更新汇总 (如更新汇总 7 或 8) 相对应。这是必需的数据库才能正常工作。
  6. 使用 SQL 管理 Studio 对 VMM 数据库运行以下存储的过程:
    /****** Object: StoredProcedure [dbo].[prc_WLC_GetVNetworkAdapterByNicId] Script Date: 12/16/2015 2:13:12 AM ******/ -- ========================================================= -- Create date: 08/31/2007 -- Description: Get VNetworkAdapter for a given NicId -- ========================================================= ALTER PROCEDURE [dbo].[prc_WLC_GetVNetworkAdapterByNicId]     @VNicId uniqueidentifier AS BEGIN     DECLARE @error int     SET @error = 0     SET NOCOUNT ON;     SELECT       [Name],       [Description],       [OwnerIdentifier],       [CreationTime],       vna.[ModifiedTime],       [Accessibility],       [ObjectState],       [VNicId],       [HWProfileId],       [ParentType],       [VirtualNetwork],       [MACAddressType],       [MACAddress],       [IPv4AddressType],       [IPv6AddressType],       [PortId],       [DeviceId],       [NetworkAdapterType],       [VMSubnetId],       [VMNetworkId],       [PortClassificationId],       [PortProfileSetId],       [VLanEnabled],       [VLanId],       [VmwAdapterIndex],       [VmwPortGroup],       [SlotId],       [MACSpoofingEnabled],       [EnableGuestIPNetworkVirtualizationUpdates],       [VMNetworkOptimizationEnabled],       [HostId],       [LogicalSwitchId],       [NetworkKBytesReadTieredPerfCounterID],       [NetworkKBytesWriteTieredPerfCounterID],       [VMNetworkServiceSetting],       [UsesSriov],       [IsUsedForHostManagement],       [IPv4Addresses],       [IPv6Addresses],       [DefaultGateways],       [DNSServers],       [TemplateNicName],       compliance.PortClassificationComplianceErrors AS [PortClassificationComplianceErrors],       compliance.VMNetworkComplianceErrors AS [VMNetworkComplianceErrors],       [AccessControlListID],       compliance.NetworkAccessControlListComplianceErrors AS [NetworkAccessControlListComplianceErrors]     FROM dbo.tbl_WLC_VNetworkAdapter vna     LEFT JOIN dbo.tbl_NetMan_VirtualNetworkAdapterCompliance compliance         ON vna.VNicId = compliance.VirtualNetworkAdapterId     WHERE VNicId = @VNicId     SET @error = @@ERROR     SET NOCOUNT OFF     RETURN @error END GO 
  7. 重新启动 VMM 2012 R2 服务器,并确保 VMM 服务成功启动。


高度可用的 VMM 安装时安装的特殊注意事项

在 VMM 的高可用性 (HA) 安装中,请执行以下步骤:
  1. VMM 所在的节点上停止 VMM 服务器服务。
  2. VMM 数据库上,从上一节中的步骤 3 中运行该脚本。
  3. 在第二个节点上安装 VMM 2012 R2 RTM 和选择要在安装过程中使用现有数据库。
  4. 第二个节点上安装 SC 2012 R2 VMM UR8。
  5. 从 VMM 数据库在前面第 6 步中运行安装后脚本。
  6. 您想要激活如果它没有自动启动的节点上启动 VMM 服务。

vmm ur8 设置 vmm 数据库

属性

文章 ID:3132774 - 上次审阅时间:01/07/2016 07:07:00 - 修订版本: 1.0

Microsoft System Center 2012 R2 Virtual Machine Manager

  • kbexpertiseadvanced kbsurveynew kbinfo kbhowto kbmt KB3132774 KbMtzh
反馈