使用 MDSModelDeploy 部署模型部署包Deploy a Model Deployment Package by Using MDSModelDeploy

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - 仅限 Windows 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - Windows only 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance

Master Data ServicesMaster Data Services中,使用 MDSModelDeploy 工具来部署包含以下任一信息的包:In Master Data ServicesMaster Data Services, use the MDSModelDeploy tool to deploy a package that contains either:

  • 仅模型对象。Model objects only.

  • 模型对象和数据。Model objects and data.

如果需要部署仅包含模型对象的包,可改为在 主数据管理器Master Data Manager Web 应用程序中使用模型部署向导。If you want to deploy a package that contains model objects only, you can use the model deployment wizard in the 主数据管理器Master Data Manager web application instead. 有关详细信息,请参阅通过使用向导部署模型部署包For more information, see Deploy a Model Deployment Package by Using the Wizard.

重要

包只能部署到创建它们的 SQL ServerSQL Server 版本中。Packages can be deployed to the edition of SQL ServerSQL Server they were created in only. 这意味着在 SQL Server 2012 (11.x)SQL Server 2012 (11.x) 中创建的包不能部署到 SQL Server 2014 (12.x)SQL Server 2014 (12.x) 或更高版本。This means that packages created in SQL Server 2012 (11.x)SQL Server 2012 (11.x) cannot be deployed to SQL Server 2014 (12.x)SQL Server 2014 (12.x) or higher.

先决条件Prerequisites

若要执行此过程:To perform this procedure:

  • 您必须有权访问目标 环境中的 “系统管理” Master Data ServicesMaster Data Services 功能区域。You must have permission to access the System Administration functional area in the target Master Data ServicesMaster Data Services environment.

  • 模型部署包必须存在。A model deployment package must exist. 有关详细信息,请参阅使用向导创建模型部署包For more information, see Create a Model Deployment Package by Using MDSModelDeploy.

  • 您必须是部署模型的环境中的管理员。You must be an administrator in the environment where you are deploying the model. 有关详细信息,请参阅 管理员 (Master Data Services)For more information, see Administrators (Master Data Services).

  • 如果要使用数据更新模型,则不能 锁定提交 正在部署到的版本。If you are updating a model with data, the version you're deploying to cannot be Locked or Committed.

部署模型部署包To deploy a model deployment package

  1. 确定您是在部署一个新模型、部署模型的一个克隆副本,还是在更新先前克隆的模型。Determine whether you are deploying a new model, a clone of a model, or updating a previously-cloned model. 有关详细信息,请参阅模型部署选项 (Master Data Services)For more information, see Model Deployment Options (Master Data Services).

  2. 打开管理员命令提示符,然后导航到 MDSModelDeploy.exe。Open an Administrator: Command Prompt and navigate to MDSModelDeploy.exe.

    • 如果 MDS 安装在默认位置,则该工具位于 drive:\Program Files\Microsoft SQL Server\130\Master Data Services\ConfigurationIf MDS is installed at the default location, the tool is available at drive:\Program Files\Microsoft SQL Server\130\Master Data Services\Configuration

    • 如果 MDS 未安装在默认位置,请在本地计算机上搜索 MDSModelDeploy.exe。If MDS is not installed at the default location, search the local computer for MDSModelDeploy.exe.

  3. 可选。Optional. 查看选项和帮助。View options and help.

    • 若要显示所有可用选项,请键入 MDSModelDeploy ,然后按 Enter 键。To display all available options, type MDSModelDeploy and press Enter.

    • 若要显示某个选项的帮助,请键入以下命令,其中 OptionName 是该选项的名称:MDSModelDeploy help OptionNameTo display help for an option, type the following, where OptionName is the name of the option: MDSModelDeploy help OptionName.

  4. 可选。Optional. 如果您有多个 Web 应用程序,通过键入下面的命令并按 Enter 键,确定您要部署到的服务的名称:If you have multiple web applications, determine the name of the service you will deploy to by typing this command and pressing Enter:

    MDSModelDeploy listservices  
    

    随即返回一个值列表,例如 MDS1, Default Web Site, MDSA list of values is returned, for example MDS1, Default Web Site, MDS. 需要此列表中的第一个值(在此例中为 MDS1)来部署模型。The first value in this list (in this case, MDS1) is needed to deploy the model.

  5. 根据您是在创建模型部署、克隆模型还是更新模型,在命令提示符处,键入以下命令并按 Enter 键。Depending on whether you are creating a model, cloning a model, or updating a model, at the command prompt, type the following and press Enter.

    • 创建新模型:To create a new model:

      MDSModelDeploy deploynew -package PackageName -model ModelName -service ServiceName  
      
    • 创建模型的克隆:To create a clone of a model:

      MDSModelDeploy deployclone -package PackageName  
      
    • 更新现有模型及其数据:To update an existing model and its data:

      MDSModelDeploy deployupdate -package PackageName -version VersionName  
      

    重要

    如果使用 MDSModelDeploy 工具更新现有模型及其数据,并且该包不包含目标模型中存在的实体、属性或成员,则 MDSModelDeploy 不会从模型中删除此实体、属性或成员。If you use the MDSModelDeploy tool to update an existing model and its data, and the package does not contain an entity, attribute, or member that exists in the destination model, MDSModelDeploy will not delete that entity, attribute, or member from the model.

    其中,PackageName 是包文件 (.pkg) 的名称,ModelName 是新模型的名称,VersionName 是版本的名称,ServiceName 是上一步中返回的服务的名称。Where PackageName is the name of the package (.pkg) file, ModelName is the name of the new model, VersionName is the name of the version, and ServiceName is the name of the service that you returned in the previous step. 确保模型名称和版本名称完全匹配区分大小写的名称。Ensure that the model and version names match the exact case-sensitive names.

  6. 成功部署包后,将显示一条消息“MDSModelDeploy 操作已成功完成”。When the package is successfully deployed, a message stating "MDSModelDeploy operation completed successfully" is displayed.

注意:Notes:

  • 如果包中的订阅视图与现有模型中的订阅视图同名,则显示此警告: Deployer 订阅视图已重命名 ,且视图创建为 modelname.subscriptionviewnameIf a subscription view in the package has the same name as a subscription view in an existing model, this warning is displayed: Deployer subscription view renamed and the view is created as modelname.subscriptionviewname. 如果此名称已使用,则不会创建订阅视图。If this name is already in use, the subscription view is not created.

  • 部署过程具有以下四个步骤:The deployment process has four steps:

    1. 创建模型对象。The model objects are created.

    2. 创建业务规则。Business rules are created.

    3. 创建订阅视图。Subscription views are created.

    4. 填充主数据。Master data is populated.

  • 创建一个新的或克隆的模型时,如果该过程在任何步骤期间失败,该模型将被删除。When creating a new or cloned model, if the process fails during any step, the model is deleted.

    在更新某一模型时,如果该过程在前三个步骤中失败,则该过程将不会继续;但是,已进行的更改将不会回滚。When updating a model, if the process fails during the first three steps, it does not proceed; however, changes that are already made are not rolled back. 如果该过程在步骤 4 中失败,则会更新可更新的成员。If the process fails in step 4, members that can be updated are updated.

后续步骤Next Steps

模型部署包中不包括文件属性以及用户和组权限。File attributes, and user and group permissions are not included in model deployment packages. 在您部署模型后,必须手动更新这些内容。After you deploy a model, you must update these manually. 有关详细信息,请参阅:For more information, see:

另请参阅See Also

部署模型 (Master Data Services)Deploying Models (Master Data Services)