Tuesday 19 May 2020

Deploying Packages to SQL Server Integration Services Catalog (SSISDB)

Starting with SQL Server 2012, Integration Services (SSIS) packages can now be deployed to a single source for managing execution in multiple environments. The SSIS Catalog is a single database container for all deployed packages. The configuration files are replaced with Environments. Deployed versions are tracked historically and a package can be reverted to a previous deployment. On top of these features, internal reports with a dashboard help when debugging errors or examining performance over time.

To use this feature, the SSIS Catalog must be created. The System Administrator of the SQL Server instance needs to create the Catalog or a user with elevated permissions for creating databases. Figure 1 shows the menu after right clicking on the Integration Services Catalog folder in SSMS
Figure 1 Integration Service Catalog
The Create Catalog... menu option will launch the Create Catalog window. Some configuration takes place during the creation. CLR integration will need to be enabled on this instance. On SQL Server Startup, the automatic execution of SSIS stored procedure(s) can be enabled or not. The most important part is to provide a strong password for the management of this new database container,
Figure 2: Create Catalog Window
When the configuration is complete a new database is created on this instance: SSISDB. The database needs the same maintenance as any other production database on this system. Maintenance items include backups, index rebuild/reorganize and update statistics. The recovery model of the database inherits the properties from the Model database just like all new databases. Simple recovery mode is adequate for SSISB because of the infrequent deployments.
Figure 3: SSIS Catalog Projects Deployed
A user does not need to be a SysAdmin to deploy projects (and packages) to the Catalog. There is a Database Role named ssis_admin in the SSIS database. This role contains the permissions to deploy projects from Visual Studio. A developer's Active Directory (AD) account or an AD group can be added to this role.
Figure 4: ssis_admin Database Role in SSISDB
Deploying SSIS projects along with the project's package(s), was added in SQL Server 2012 as well as the SSIS Catalog. This organization of packages in SSIS Project enables objects, properties and values to be shared among the packages in a project. Figure 5 shows the project.param file associated with a SSIS Project.
Figure 5: Project Parameters
This project has multiple packages. The Source Database and Source Server is shared with packages like DimProduct and DimCategory. The connection is created under the Connection Manager in the Project's solution as seen in Figure 6. Not only can the package can share parameter values, it also shares these database connections. This example contains staging, source and destination databases. The prefix (project) is added to the Package Connection Managers connections as seen in Figure 6 under the objects of the package.
Figure 6: Project Connection Managers
In this environment the development team uses a separate server as the testing team and production system. The use of Project Parameter enables a single change to effect multiple packages in the project. To deploy the project to the SSIS catalog, right-click the project in the solution explorer of Visual Studio.
Figure 7: Deploy Projects and Packages
The Integration Services Deployment Wizard will show a welcome screen. Yon can disable this screen for future deployments. The Select Source will default to the project selected while in Visual Studio. The wizard first brings you to the Select Destination page, but you can use the back button to go to the Selected Source page. The Source Selection can be changed, but usually the deployment wizard is launched from the project being deployed. Figure 8 shows the Select Destination screen where the Server Name and Path in the SSIS Catalog are selected.
Figure 8: Select Destination Screen of SSIS Deployment Wizard
The Server name will be the instance the Catalog was created. The Path can be an existing one or a New Path can be created. The same path can be used for different projects. All project packages will be together under the project in the Path.

The Review screen gives the options to view the selected source and destination. Once the Deploy button is selected on the Review screen, the Results screen will show the success list or an indication of what failed during deployment.
Figure 9: Result screen of SSIS Deployment Wizard
A package can be launched in several ways. In SSMS, the Integration Services Catalog folder can be expanded to see the paths created in the Catalog. Figure 10 shows the menu from right clicking the package DimCategory in the SSIS Catalog.
Figure 10: Executing a Package from SSIS Catalog
After selecting Execute... from the menu, the execution prompts for Parameters, Connection Managers and Advanced Options. Figure 11 show the Parameters that can be changed before the DimCategory package is executed. This is where we can change the server or database names for the Project Parameters before the package is executed.
Figure 11: Executing a Package from SSIS Catalog
One of the cool features of the SSIS Catalog are free ports. Figure 12 shows the execution report that can be displayed after launching the package. There is a prompt to view or not view the report. There are two additional links to drill down into Messages and Performance. Individual Tasks can be drilled into to show messages from different steps of the package.
Figure 12: Report Overview of Package Execution
If there is an error, the messages are the best place to start to debug a package. To see the performance of this package over time, click the View Performance drill down report.

There is a main Dashboard that can be used to see an overview of all packages running from the Catalog. This dashboard is launched from SSMS by right clicking on the SSISDB folder under the Integration Services Catalog. Figure 13 shows the path to the report.
Figure 13: Launching the Integration Services Dashboard
Figure 14 shows for today one package has executed successfully and another has failed.
Figure 14: Integration Services Dashboard
By clicking on the Failed number, the next report gives the ability to drill into the Messages returned from the success and fail steps of the package like in Figure 15.
Figure 15: Failed Package Messages report
As you can see, the SSIS Catalog has a wealth of information and management for SSIS projects and packages. The reports and drill down capabilities help with debugging problems before opening the package in Visual Studio. Performance reports can give an idea if a package is taking longer to run in the last execution than previous executions. History can be configured and is explained more in the side note at the end of this article. The Catalog is a great place to store and manage SSIS package deployment and execution

SQL Server Query Execution Plans for beginners – Clustered Index Operators

In this article we will continue discussing the various execution plan operators related to clustered indexes and what they do, when do the...