Brian Garraty @NULLgarity. Brian D. Garraty SQL Server DBA, Va Beach Public Schools HRSSUG...

70
SSIS for the Disinterested Brian Garraty @NULLgarity

Transcript of Brian Garraty @NULLgarity. Brian D. Garraty SQL Server DBA, Va Beach Public Schools HRSSUG...

Page 1: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

SSIS for the Disinterested

Brian Garraty@NULLgarity

Page 2: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Who I am

Brian D. Garraty SQL Server DBA, Va Beach Public

Schools HRSSUG Leadership Team Background in C++, VB, ASP, C# @NULLgarity NULLgarity.wordpress.com >10 years experience with SSIS &

DTS

Page 3: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Why I’ve Come to You Today

SSIS is often Misunderstood Disliked Considered difficult to learn Subject to ridicule

Page 4: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Why I’ve Come to You Today

SSIS is actually Fairly simple (mostly) Pretty good at a lot of things Fun The right set of tools for the job

(sometimes)

Page 5: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Success Requires

A desire to learn new things The time to learn new things Willingness to work through

frustrations Willingness to start over The right project

Page 6: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Who I Come to You As Today

Brian D. Garraty, SSIS Defender

Brian D. Garraty, SSIS Apologist

Page 7: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Who You Are

Type of Work You Do Experience with SSIS Rank your love of SSIS on Scale of 1

to 10 10 = God, Family, Country, SSIS 5 = Like it like a friend 1 = I want to fight it, really

Page 8: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Where we are headed…

Starting from scratch – 100 Level Control Flow Data Flow Configurations Dynamic SSIS

What you can do with SSIS What I have done with SSIS

Page 9: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Where we are headed…

Defense Will Rest If I knew then... Resources Questions

Page 10: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Out of Scope

SSIS in SQL Server Denali How to do this Stuff Demos

Page 11: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

SSIS 101SQL Server Integration Services

Page 12: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

History

Bundled Extract, Transform, Load (ETL) Platform

Rewrite of Data Transformation Services (DTS)

Released with SQL Server 2005

Page 13: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Dev Environment

Developed in Visual Studio (err…”Business Intelligence Development Studio”)

Solutions, Projects, Packages

Page 14: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Run!!!!!!

Page 15: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Solution Explorer

Page 16: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Package Level Connections

Page 17: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Variables

Page 18: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Runtime Environment

Packages are Deployed as files or to msdb Executed via dtexec Utility (or wrapper

to it)

SSIS Service Runs on the server Doesn’t do much

Page 19: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

A New Paradigm

Control Flow Ordered workflow Isolated tasks Precedence Constraints Data flow tasks

Data Flow Move data from Point A to Point B Manipulate data along the way

Page 20: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Control FlowWhere You Build Your Workflow

Page 21: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Control Flow Picture

Page 22: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Control Flow Toolbox

Page 23: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Sequence Containers

Group related tasks Can be enabled/disabled Can serve as source for Precedence

Constraints, even when empty

Page 24: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Loop Containers

Page 25: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Precedence Constraints

Page 26: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Execute SQL Tasks

Page 27: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Script Task

Page 28: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Other Control Flow Tasks

Execute Process Task Send Mail Task Execute Package Task

Data Flow Task…

Page 29: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Control Flow Picture

Page 30: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Data FlowWhere You Manipulate Data

Page 31: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Data Flow Picture

Page 32: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Data Flow Sources

Page 33: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Data Flow Transformations

Page 34: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Data Destinations

Page 35: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Data Flow Picture - Big

Page 36: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Dynamic SSISWhat You See Isn’t Always What You Get

Page 37: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

What can be dynamic?

Object property values Variable values

Page 38: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Expressions

Determined Dynamic Values Expressions evaluate at runtime Example: Use current date to build

unique log file name

Page 39: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Configurations

Instructed Dynamic Values XML file Example: Connection Strings

Page 40: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Dynamic SSIS

What you see may not be what you get…

But it is what you asked for!

Page 41: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

What You Can Dowith SQL Server Integration Services

Page 42: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Disparate Data Sources

Join data from Oracle with data from SQL Server? No problem. No linked server. No OPENROWSET No xp_cmdshell No bcp

Page 43: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Discover Workloads

Have two SQL Servers with 1500 databases, give or take, and need to pull data from all? No problem. No linked server. No OPENROWSET No xp_cmdshell No bcp

Page 44: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Parallelize Workloads

Multiple lines == Multiple threads Often equals, at least

Page 45: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Offload Workloads

Pull data off OLTP systems Crunch it to your heart’s content Location agnostic

OLTP = Online Transactional Processing

Page 46: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Exploit Your Talents

Seemless integration with your comfort zone .NET Stored Procedures XML

Page 47: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

The Random

Can you have it email me? Can you only email when X and Y but

not Z? This program needs to run when the

extract finishes but only if…

Page 48: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

What I’ve Donewith SQL Server Integration Services

Page 49: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Hosted Data Warehouse Pull

Extract data from numerous sources Stage to database Apply transforms and business logic Write final data to files Zip files and ftp to host Track each run

Page 50: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

(Oh no!) System Integration

How will the data get from these 100 databases on these two servers to this one?

Can you not send any dups? Can you email us the dups? Can you track the dups that have

been fixed?

Page 51: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Active Directory Extract

Extract users, groups, & membership Load data into SQL Server Ensure it always works

Page 52: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

The Defense RestsThe Dark Side of SSIS

Page 53: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

GUI-Intensive

If you aren’t comfortable in a GUI-intensive IDE, SSIS will be a challenge

Page 54: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

!WYSIWYG

But you do get what you asked for! WYSIWYAF

Page 55: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Expression Syntax

Inconsistent Difficult to Master Flying solo (No Intellisense)

Page 56: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Wound Tight

SSIS binds itself to your meta data and holds on tight

SSIS continually checks that things have not changed

Single column change in data source must trickle all the way down your data source

Page 57: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

What’s the Difference?

Source Control? In my experience you can check things in, label them, and do “gets”.

Trying to do a Diff might induce panic

If needed, seek a third party

Page 58: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Tradeoff

The more dynamic you get, the less parallel you tend to get

Page 59: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Read only? If only!

Just viewing details of SSIS components often leads SSIS to want to make changes to the file

Code review often leads to check out the entire project

Page 60: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

But It Works on My Machine!

The server is not your machine Early on, budget some time to work

through issues upon deployment Drivers, rights, O/S, platform, etc.

may cause problems Be patient!

Page 61: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Misc Rants

No Undo (yet) Variable Scope is read-only Variable Scope is context-default

Audience?

Page 62: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

If I Knew Then…Best Practices and Words of Caution

Page 63: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Multiple Package Projects

Benefits: Encapsulation Readability Collaboration

Page 64: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Deploy as Files

Packages in development must be files

You will have multiple file projects To minimize changes on deployment,

deploy as files More info: bit.ly/lSniJS

Page 65: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Root Folder Variable

String variable to store location of package

Use to build relative file paths Input files (xsd, raw, etc) Output files (xml, raw, etc) Connection strings (packages, log files,

etc) More info: bit.ly/iuLctD

Page 66: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Indirect Configurations

Store location of configuration file in environment variable

More info: bit.ly/ksAQOG

Page 67: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Recreate over Edit

In response to certain changes, delete

Take advantage of ease of creating a new item rather than suffer through unpleasant editing experience

Particularly true for file connections

Page 68: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Resources

The New ETL Paradigm, Jamie Thomson bit.ly/e17DUR

Jamie Thomson’s Blogs sqlblog.com/blogs/jamie_thomson consultingblogs.emc.com/jamiethomson

Page 69: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Resources (con’t)

SSIS Community Tasks and Components ssisctc.codeplex.com

Locally grown SSIS Training andyleonard.net

Page 70: Brian Garraty @NULLgarity.  Brian D. Garraty  SQL Server DBA, Va Beach Public Schools  HRSSUG Leadership Team  Background in C++, VB, ASP, C#  @NULLgarity.

Questions?