如何配置SSIS 2012项目在不同的环境配置下运行? [英] How to configure SSIS 2012 project to run under different environment configurations?

查看:22
本文介绍了如何配置SSIS 2012项目在不同的环境配置下运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用项目部署模型配置 2012 SSIS 项目的最佳逻辑方式是什么?

What would be the best logical way of configuring 2012 SSIS project using the Project Deployment Model?

考虑具有三个包的 SSIS 项目 MyImport-Project 的场景

Consider a scenario of an SSIS Project MyImport-Project having three packages

  • MyImport-项目
    • 导入包-01
    • 导入包-02
    • Import-Package-03
    • Project-DBConnString :由所有包用于连接到单个数据库.
    • Project-FolderPath : 所有包都用来查找输入文件

    项目部署于

    • 质量检查服务器
    • 临时服务器
    • 生产服务器

    是否有配置项目参数的标准方法?

    Is there a standard method of configuring project parameters ?

    我看了很多关于包的配置文件的文章.有没有办法根据部署环境配置项目参数?

    I saw quite a few articles on Configuration Files for packages. Is there a way to configure Project Parameters depending on the deployment environment ?

    推荐答案

    SSIS 2012 项目部署模型为创建环境和配置环境特定值提供了更大的灵活性,这些值可以映射到项目参数.以下示例说明了如何针对多个环境执行部署到 Integration Services Catalog 的包.理想情况下,生产环境应该在自己的服务器上.为简单起见,此示例使用同一服务器上的所有环境.

    SSIS 2012 project deployment model provides greater flexibility to create Environments and configure environment specific values, which can mapped to project parameters. Here is a sample that illustrates how you can execute a package deployed to Integration Services Catalog against multiple environments. Ideally, production environment should be on its own server. This example uses all the environments on the same server for simplicity.

    假设您已使用两个名为 EnvironmentFilePath 的项目参数将包部署到 Integration Services Catalog>.要在不同环境下运行包,您可以在Integration Services Catalogs SSIDB Folder name Environments

    Let's assume that you have deployed a package to Integration Services Catalog with two project parameters named Environment and FilePath. To run the package under different environments, you can create multiple environments under Integration Services Catalogs SSIDB Folder name Environments

    此示例包含三个名为 DEVPRDTST

    This sample has three Environment folders named DEV, PRD and TST

    要创建稍后应映射到项目参数的变量,请双击 Environments 文件夹下的环境.此示例展示了如何在所有环境中配置值.

    To create variables that should later be mapped to the project parameters, double-click the environment under the Environments folder. This samples shows how to configure values in all environments.

    由于该包有两个项目参数,分别名为 EnvironmentFilePath,我们将创建两个环境变量同名.所有环境都配置了 same 变量名称,但具有 different 值.

    Since, the package has two project parameters named Environment and FilePath, we will create two environment variables of the same name. All the environments are configured with same variable names but with different values.

    要将环境变量映射到项目参数,请右键单击集成服务目录下的项目,然后单击配置...

    To map the environment variables to the project parameters, right-click on the project under the Integration Services Catalog and click Configure...

    Configure 对话框中,点击 References 页面并添加应该与项目关联的每个环境.

    On the Configure dialog, click References page and add each environment which should be associated with the project.

    配置对话框中,点击Parameters页面.对于 Parameters 选项卡下列出的每个参数,您需要单击 Ellipsis 按钮以映射适当的环境变量.

    On the Configure dialog, click Parameters page. For each parameter listed under Parameters tab, you need to click the Ellipsis button to map the appropriate environment variable.

    在设置参数值"对话框中,选择使用环境变量"单选按钮并选择适当的变量.这里映射的参数是[Practice.SSDT].[Environment].因此,它被映射到环境变量 Environment.

    On the Set Parameter Value dialog, select Use environment variable radiobutton and choose the appropriate variable. Here the parameter being mapped is [Practice.SSDT].[Environment]. Hence, it is being mapped against the environment variable Environment.

    一旦您将参数映射到适当的环境变量,您就可以在包执行期间选择正确的环境.要执行包,请右键单击包并单击执行...

    Once you have mapped the parameter against the appropriate environment variable, you can choose the correct environment during package execution. To execute the package, right-click on the package and click Execute...

    Execute Package 对话框中,选中 Environment 框并选择适当的环境,包应在其中使用值来执行.

    On the Execute Package dialog, check Environment box and select the appropriate environment from which the package should use the values for execution.

    本例中的示例包SO_15206184.dtsx 只是插入了项目参数EnvironmentFilePath 到表格中.以下是针对不同环境(甚至包括 SSDT 内的环境)执行包的结果.

    The sample package SO_15206184.dtsx in this example simply inserts the values of project parameters Environment and FilePath into a table. Here are the results of the package execution against different environments, even the one including from within SSDT.

    这篇关于如何配置SSIS 2012项目在不同的环境配置下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆