How To Automate SSIS and SQL Agent Job Deployments
How To Automate SSIS and SQL Agent Job Deployments
Save the package on a physical location on hard drive or any shared folder <?xml v
<DtsSe
SQL Server xmlns:x
MSDB <StopE
SSIS Package Store down>
<TopL
File system <Fol
Default Root Folder : %ProgramFiles%\Microsoft SQL Server\110\DTS\Packages <Na
<Se
RootFolder is controlled by MsDtsSrvr.ini.xml(..\110\DTS\Binn)
</Fo
SSIS Catalog <Fol
<Na
SSISDB <St
Default Folder : [YourFolderNmae]\Projects </Fo
</Top
</DtsSe
Multi-environment Configuration
Configuration file
Single configuration file on the network share
Configuration table
Config tables + System environment variable/registry key/SQL Server
Alias on every server and developer computer
Single configuration table on a centralized server
SSIS multi-environment configuration in a single SQL Server
table by Scott Coleman
SSISDB Environment
SSISDB per environment
Can not reference remote servers SSISDB environment
One ETL server for all environment
My Choices
Deployment model - Project
Deploy destination - SSIS Catalog
Configuration management
Store in DB table(CMDB)
SSIS configuration will be
deployed to SSIS catalogs
environment variable
CMDB will be a common
configuration repository
Deployment Process
-Source Control Archive Deployment
Deployment Test
Test
Build Deploy Test
Artifact
CI tool
- Jenkins
- TeamCity
- TFS Release Manager
- etc
Build
-Source Control Archive Deployment
Deployment Test
Test
Build Deploy Test
Artifact
SSIS Catalog
ISDeploymentWizard.exe
catalog.deploy_project in SSISDB
MOM(Management Object Model) - Powershell, .net
SSIS Deployments with SQL Server 2012 by Koen Verbeeck
MSBuild with Microsoft.SqlServer.IntegrationServices.Build.dll
MSDB
dtutil.exe
Scripting SSIS Package Deployments by CHAD MILLER
File system
copy
Test
-Source Control Archive Deployment
Deployment Test
Test
Build Deploy Test
Artifact
SSIS 2012 Continuous Integration using Jenkins and Octopus from https://speaksql.wordpress.com
Implementation example 2
Demo Environment
VS2012 - SSDT,SSDT-BI Jenkins plugin
TFS 2013 Role-based Authorization Strategy
CloudBees Folders Plugin
Jenkins Environment Injector Plugin
build-name-setter
Team Foundation Server Plug-in
MSBuild Plugin
Hudson PowerShell plugin
Scriptler
Jenkins Dynamic Parameter Plug-in
Dynamic Parameter Plug-in
Extensible Choice Parameter plugin
Demo
SSIS deployment
References
Deployment model
http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/101240/
http://msdn.microsoft.com/en-us/library/hh213290.aspx
http://sqlmag.com/sql-server-integration-services/ssis-deployment-sql-server-2012
http://nexxtjump.com/2013/01/14/ssis-2012-configuration-guide-part-1-introduction/
Deployment destination
http://stackoverflow.com/questions/11240761/understanding-stored-packages-on-integration-services
http://help.pragmaticworks.com/dtsxchange/scr/FAQ%20-%20What%20are%20the%20advantages_disadvantages%20of%
20storing%20SSIS%20packages%20to%20MSDB%20vs%20File%20System.htm
https://msdn.microsoft.com/en-us/library/ms137789(v=sql.110).aspx
http://www.mssqltips.com/sqlservertip/2061/how-to-manage-ssis-packages-stored-in-multiple-sql-server-database-instances/
Deployment process
http://www.infoq.com/articles/orch-pipelines-jenkins#_Toc2
http://msdn.microsoft.com/en-us/library/ff953020(v=sql.105).aspx
https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/
http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/101240/
http://sev17.com/2012/11/06/scripting-ssis-package-deployments/
http://ibmdatamag.com/2013/07/data-warehouse-testing-part-1/
http://ibmdatamag.com/2013/07/data-warehouse-testing-part-2/
https://nbi.codeplex.com/
http://ssisunit.codeplex.com/
http://biquality.codeplex.com/
Delta deployment
Change list
Diff
If you deploy to file system, you can diff using tools
like rsync, robocopy, etc.
Changeset list from SCM
Get changeset number of last successful deployment
Jenkins - you can get this using Groovy script
Generate change list after that changeset number
TFS - Team Foundation Server Power Tools
Microsoft Team Foundation PowerShell Snap-In
Demo
Delta deployment
Reference
Changeset number
Jenkins
http://stackoverflow.com/questions/21236268/access-to-build-environment-
variables-from-a-groovy-script-in-a-jenkins-build-st
TeamCity
http://stackoverflow.com/questions/20332397/teamcity-how-to-get-names-of-the-
files-edited
Change list
TFS
http://programmaticponderings.wordpress.com/2012/08/10/using-powershell-to-
generate-a-tfs-change-manifest-for-artifact-delivery/
Job
Requirements
Deploying jobs using CI tool(Jenkins)
Job script should be managed by source
control manager(TFS)
Being able to use variable in the job script so
that value changes as environment changes.
Job execution history should be kept after
the deployment
Challenges
No automated tool
SQL Server Database Project(SSDT) doesnt
support SQL Agent Job
Redgate SQL Source control, Apex SQL Source
control and other third party tools dont support
either
This means
You need to script out and check in to TFS
manually
Theres no automated way to generate a change
script(ex; publish.sql)
Some approaches
Post deployment script of SSDT database project
SSDT SQL Agent Job Deployment Template by Kent Chenery
Script out final version and check into source control
Database Deployment: The Bits - Agent Jobs and Other Server Objects
by Phil Factor
Some people tried to generate change script using tables
in MSDB but didnt work well
Yet another approach
Create Job Script out using Replace actual value Check in Deploy using
on Local DB Powershell with a SQLCMD variable script to TFS Jenkins
Job deployment
Reference
http://blog.sqlconcepts.co.nz/2012/09/ssdt-sql-agent-job-deployment-template.html
https://www.simple-talk.com/sql/t-sql-programming/database-deployment-the-bits---agent-
jobs-and-other-server-objects/
http://blog.sqlconcepts.co.nz/2012/09/ssdt-sql-agent-job-deployment-template.html
http://msdn.microsoft.com/en-us/library/ms191305.aspx
http://sqlmag.com/database-administration/multiserver-task-administration
http://www.mssqltips.com/sqlservertip/2223/how-to-setup-and-manage-sql-server-agent-
shared-job-schedules/
Q&A
Blog : http://speaksql.wordpress.com/
Email : kulmam92@gmail.com