单包攻击_SQL Server Integration Services 2016中的单包部署

单包攻击

SQL Server 2016 has some exciting enhancements to SQL Server Integration Services. In this article, we take a look at how the issue of single package deployment into an SSIS Catalog has been resolved with this SQL Server release.

SQL Server 2016对SQL Server集成服务进行了一些令人兴奋的增强。 在本文中,我们将研究如何使用此SQL Server版本解决将单个程序包部署到SSIS目录中的问题。

先决条件 (Prerequisites)

The demonstrations in this article were conducted using SQL Server 2016 RC3 and Visual Studio Community 2015

本文中的演示是使用SQL Server 2016 RC3和Visual Studio Community 2015进行的

背景 (Background)

In my personal experience, delivering SQL Server Business Intelligence solutions using SQL Server Data Tools (SSDT) is by far a more favourable experience compared to its predecessor, Business Intelligence Development Studio (BIDS). Some of the many advantages that makes SSDT better than BIDS ranges from features like multiple deployment models to choose from, built-in package catalog logging mechanisms; to trivial things such as the ability to undo or re-do changes in your SSIS packages.

以我个人的经验,与之前的商业智能开发工作室(BIDS)相比,使用SQL Server数据工具(SSDT)交付SQL Server商业智能解决方案是一种更为有利的体验。 使得SSDT优于BIDS的众多优势中的一些优势包括多种功能,例如多种部署模型可供选择,内置的软件包目录日志记录机制; 琐碎的事情,例如撤消或重新执行SSIS包中的更改的功能。

Most of the aforementioned features relating to SSIS packages such as catalog logging are only available in the project deployment model. Unfortunately, one of the key limitations in project deployment model is its inability to deploy single packages. For instance, if you had to refactor Package 73 in a solution with 100 packages, you will have to re-deploy the entire solution with all 100 packages even though you only made changes to a single package. Figures 1 and 2 illustrates the lack of single package limitation whereby the Deploy option is available at the project level of an SSDT 2013 solution but disappears when attempting to deploy individual package, PackageC.

与SSIS包有关的大多数上述功能(例如目录记录)仅在项目部署模型中可用。 不幸的是,项目部署模型的主要限制之一是无法部署单个软件包。 例如,如果必须在具有100个软件包的解决方案中重构Package 73 ,则即使您只对单个软件包进行了更改,也将不得不重新部署全部100个软件包的整个解决方案。 图1 2说明了缺少单个软件包的限制,因此Deploy选项在SSDT 2013解决方案的项目级别可用,但是在尝试部署单个软件包PackageC时消失。

单包攻击_SQL Server Integration Services 2016中的单包部署

单包攻击_SQL Server Integration Services 2016中的单包部署

The only workaround to this limitation was to firstly convert existing project deployment model to package deployment model and then deploy the converted solution. However, this workaround has always been ineffective as package deployment models are not setup to make deployments into SSIS Catalog which meant that every time you converted from project to package deployment model you had to forego the features inherently available in the SSIS Catalog.

对此限制的唯一解决方法是,首先将现有项目部署模型转换为程序包部署模型,然后部署转换后的解决方案。 但是,此解决方案一直无效,因为没有设置软件包部署模型以将部署部署到SSIS目录中,这意味着每次从项目转换为软件包部署模型时,都必须放弃SSIS目录中固有的功能。

如何将单个程序包部署到SSIS目录中 (How to Deploy Single Package into SSIS Catalog)

  1. Visual Studio

    Fortunately, with the release of SQL Server 2016 and SSDT 2015 the issue of single package deployment is now a thing of the past. For instance, Figure 3 shows an SSIS 2016 project with the new Deploy Package option that comes up for deploying individual packages within a project deployment model. This means you no longer have to convert to package deployment before you can deploy individual packages!

    单包攻击_SQL Server Integration Services 2016中的单包部署

    Figure 3: Project Deployment Model in SSDT 2015

    With this new feature, you are not just limited to deploying single packages instead you can also deploy multiple packages. As shown in Figure 4, all you need to do, is to click and hold down the control key (Ctrl) and then choose the packages that you want to deploy.


    Figure 4: Multiple Package Deployment in SSDT 2015

    So far we I have demonstrated how you can deploy a single package as well as multiple packages within the project deployment model. So what happens if, like in Figure 3 you have chosen to deploy PackageB but after you have been redirected to the Deployment Wizard screen you soon realise that actually you need to deploy PackageA too? Well, in this version of SSDT 2015/SSIS 2016, you are still able to later correct your selection prior to deploying to the SSIS Catalog.

    All you need to do is go back to the Select Source step and check (uncheck) the package that you want to add/remove in your deployment as shown in Figure 5.

    (Note: The Integration Services Deployment Wizard often jumps from the Introduction step to the Select Destination step. So, if you want to get to the Select Source step you will have to click the Previous button).

    单包攻击_SQL Server Integration Services 2016中的单包部署

    Figure 5: Integration Services Deployment Wizard

    视觉工作室

    幸运的是,随着SQL Server 2016和SSDT 2015的发布,单程序包部署的问题已成为过去。 例如, 图3显示了一个带有新的Deploy Package选项的SSIS 2016项目,该选项用于在项目部署模型内部署单个软件包。 这意味着您不再需要转换为程序包部署即可部署单个程序包!


    图3:SSDT 2015中的项目部署模型

    使用此新功能,您不仅可以部署单个软件包,还可以部署多个软件包。 如图4所示,您需要做的就是单击并按住Control键(Ctrl),然后选择要部署的软件包。

    单包攻击_SQL Server Integration Services 2016中的单包部署

    图4:SSDT 2015中的多包部署

    到目前为止,我们已经展示了如何在项目部署模型中部署单个程序包以及多个程序包。 那么,如果像图3中那样选择部署PackageB,但是在重定向到“部署向导”屏幕之后,您很快意识到实际上也需要部署PackageA,会发生什么呢? 好了,在此版本的SSDT 2015 / SSIS 2016中,您仍然可以稍后更正您的选择,然后再部署到SSIS目录中。

    您所需要做的就是回到Select Source步骤,然后选中(取消选中)要在部署中添加/删除的程序包, 如图5所示

    注: Integration Services部署向导通常从“ 简介”步骤跳到“ 选择目标”步骤。因此,如果要转到“ 选择源”步骤,则必须单击“ 一步”按钮)。


    图5:Integration Services部署向导
  2. ISDeploymentWizard

    Generally, many features in Visual Studio are rendered as standalone executable programs. Not surprisingly, whenever you click Deploy or Deploy Package in SSDT 2015, Visual Studio launches a separate application, ISDeploymentWizard – as shown in Figure 6.

    单包攻击_SQL Server Integration Services 2016中的单包部署

    Figure 6: Location of ISDeploymentWizard file

    Therefore, another way of deploying packages is to launch the ISDeploymentWizard application directly. There are advantages and disadvantages to deploying packages directly from the wizard. One advantage is that because Visual Studio can sometimes consume more of your system resources such as memory and CPU, as shown in Figure 7, deploying packages directly from the wizard is likely to save you from a possible system performance bottleneck experience.


    Figure 7: Task Manager

    Prior to launching the deployment wizard, Visual Studio collects all information that will be part of the deployment and passes it along to the wizard. That is why the Select Source step is often skipped as it is already preloaded with source information collected by Visual Studio. Unfortunately, when launching wizard directly, you get a blank screen as shown in Figure 8 and you will have to specify everything from the beginning.

    单包攻击_SQL Server Integration Services 2016中的单包部署

    Figure 8: Task Manager

    ISDeploymentWizard

    通常,Visual Studio中的许多功能都呈现为独立的可执行程序。 毫不奇怪,每当您单击SSDT 2015中的Deploy或Deploy Package时,Visual Studio就会启动一个单独的应用程序ISDeploymentWizard如图6所示


    图6: ISDeploymentWizard文件的位置

    因此,部署包的另一种方法是直接启动ISDeploymentWizard应用程序。 直接从向导部署程序包有优点和缺点。 一个优点是,因为Visual Studio有时会消耗更多的系统资源(例如内存和CPU), 如图7所示,所以直接从向导中部署程序包可能使您摆脱可能的系统性能瓶颈体验。

    单包攻击_SQL Server Integration Services 2016中的单包部署

    图7:任务管理器

    在启动部署向导之前,Visual Studio会收集将成为部署一部分的所有信息,并将其传递给向导。 这就是为什么选择源步骤经常被跳过的原因,因为它已经预先加载了Visual Studio收集的源信息。 不幸的是,当直接启动向导时,您将得到一个空白屏幕, 如图8所示,您将必须从头开始指定所有内容。


    图8:任务管理器
  3. Command Line Deployment

    Command line deployments are usually necessary when SSIS build and deployment is automated or managed as part of Continuous Integration process. Command line package deployment to catalog is again made possible via the ISDeploymentWizard execution file.

    The hardest part in this type of deployment is getting the command line syntax correct. The easiest way to get the command syntax is by copying it out of the wizard’s summary page as shown in Figure 9.

    单包攻击_SQL Server Integration Services 2016中的单包部署

    Figure 9: Deployment summary screen

    命令行部署

    当SSIS构建和部署是自动化或作为持续集成过程的一部分进行管理时,通常需要命令行部署。 通过ISDeploymentWizard执行文件,再次可以将命令行程序包部署到目录中。

    这种部署中最难的部分是使命令行语法正确。 获得命令语法的最简单方法是将其复制到向导的摘要页面之外, 如图9所示


    图9:“部署摘要”屏幕

The next step would be then to launch windows command line program and change its working directly to the SQL Server path that contains ISDeploymentWizard exe file. Finally, you just need to past the command line copied above and press enter to deploy as shown in Figure 10.

下一步将启动Windows命令行程序,并将其工作直接更改为包含ISDeploymentWizard exe文件SQL Server路径。 最后,您只需要跳过上面复制的命令行,然后按Enter即可进行部署, 如图10所示

单包攻击_SQL Server Integration Services 2016中的单包部署


Soon after a new line with path to working directory will come up which will mean that your deployment was successful. Another way to confirm that the deployment was successful is by looking at version number of your project – the current version should have deployed time closer to the time you deployed via command line.

在出现带有工作目录路径的新行之后不久,这将意味着您的部署成功。 确认部署是否成功的另一种方法是查看项目的版本号-当前版本的部署时间应与通过命令行部署的时间更接近。

单包攻击_SQL Server Integration Services 2016中的单包部署

结论 (Conclusion)

With all its advantages, SSDT had previously failed to address the issue surround single or manual package deployment into the SSIS Catalog. However, the recent release of SSDT 2015 for developing BI solutions into SQL Server 2016 introduces various ways of deploying single packages without converting to package deployment model.

凭借其所有优点,SSDT以前无法解决将单个或手动程序包部署到SSIS目录中的问题。 但是,用于将BI解决方案开发到SQL Server 2016的SSDT 2015的最新版本引入了多种方法来部署单个程序包,而无需转换为程序包部署模型。

参考 (Reference)

翻译自: https://www.sqlshack.com/single-package-deployment-in-sql-server-integration-services-2016/

单包攻击