覆盖 SSIS 环境变量 [英] Overridding SSIS Environment variable

查看:33
本文介绍了覆盖 SSIS 环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个包配置,其中配置类型是(间接 XML 配置文件).其中环境变量指向 C:\SSIS\MasterConfig\MasterConfig.dtsConfig 文件.

I have set up a Package Configuration where the Configuration Type is (Indirect XML Configuration File). Where the Environment Variable is pointing to the C:\SSIS\MasterConfig\MasterConfig.dtsConfig file.

这很好用,可以轻松地从测试迁移到 UAT 再到生产.

This working great and allows easy migration from Test to UAT to Production.

问题出在我们的开发环境中,每个开发人员都有自己的数据库.我正在尝试为每个开发人员设置一个代理作业,其中代理作业将覆盖主配置文件.代理作业命令行是:

The problem is in our Development environment where each developer has their own DB. I am trying to set up an Agent Job for each developer where the Agent Job would override the Master Configuration File. The agent job command line is":

/FILE "C:\SSIS\Packages\Developer1\LoadPackage.dtsx"/CONFIGFILE"C:\SSIS\Packages\Developer1\Developer1_Config.dtsConfig"/X86/检查点关闭/报告E

/FILE "C:\SSIS\Packages\Developer1\LoadPackage.dtsx" /CONFIGFILE "C:\SSIS\Packages\Developer1\Developer1_Config.dtsConfig" /X86 /CHECKPOINTING OFF /REPORTING E

使用 2008 R2.

Using 2008 R2.

我期待/CONFIGFILEC:\SSIS\Packages\Developer1\Developer1_Config.dtsConfig"将是用于代替 C:\SSIS\MasterConfig\MasterConfig.dtsConfig 文件.

I was expecting that the /CONFIGFILE "C:\SSIS\Packages\Developer1\Developer1_Config.dtsConfig" would be used in stead of the C:\SSIS\MasterConfig\MasterConfig.dtsConfig file.

仅使用主配置文件.有什么想法吗?

Only the Master Config file is being used. Any ideas?

推荐答案

这就是我们所做的.

无论是指向生产、质量保证还是开发(甚至是本地),所有变量的名称都相同.我们更改的是指向配置文件的变量值.

All variables are named the same whether it points to Production, QA or Dev (or even to local). What we change are the variable values pointing to the config files.

我们创建配置文件,其中包含每个框的所有适当连接信息.所以我们将为每个数据库至少有 3 个单独的配置文件.我们将它们命名为 DB_Prod.config、DB_QA.config、DB_Dev.config,然后是 DB_Joe_local.config(如果你想要一个指向本地数据库的文件.

We create config files that have all of the appropriate connection information for each box. So we'll have at least 3 separate config files for each database. We name them DB_Prod.config, DB_QA.config, DB_Dev.config, and then DB_Joe_local.config (if you want to have one that points to your local db.

然后我们创建 .bat 文件,将我们的变量设置为正确的环境.我有 3 种不同的,一种用于 QA,一种用于开发,一种用于我的本地环境.

We then create .bat files that sets our variables to the right environment. I have 3 different ones, one for QA, one for dev, and one for my local environment.

环境变量都命名为 DB1_adonet、DB1_ole、AS400 等.没有 QA、prod 等的指示.

the environment variables are ll named things like DB1_adonet, DB1_ole, AS400, etc. With no indication of QA, prod, etc.

设置起来有点麻烦,但是一旦您开始使用它,唯一的问题就是记住您为自己设置的环境.此外,您需要记住,由于值被缓存,您需要在环境更改之间打开和关闭开发工作室.此外,如果您碰巧在本地运行一个包,它将使用您的环境变量值,而不是您运行它的机器.

It's a slight pain in the ass to set up, but once you start using it, the only issue is remembering what enviroment you've set yourself to. Also, you need to remember that you need to open and close dev studio between environment changes as the values are cached. Also, if you happen to run a package localy, it will use your environment variable values, and not the box you are running it from.

最后一点,我们已将所有配置文件签入 TFS.便于分发文件.

Final note, we have all of the config files checked into TFS. Makes for easy distribution of files.

这篇关于覆盖 SSIS 环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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