cdc in sql server 2012 ssis - allan mitchell

18
Change Data Capture for SSIS in SQL Server 2012

Upload: beyondgood

Post on 30-Dec-2015

51 views

Category:

Documents


0 download

DESCRIPTION

CDC in SQL Server 2012 SSIS - Allan Mitchell

TRANSCRIPT

Page 1: CDC in SQL Server 2012 SSIS - Allan Mitchell

Change Data Capture for

SSIS in SQL Server 2012

Page 2: CDC in SQL Server 2012 SSIS - Allan Mitchell

Who am I? •Allan Mitchell

• Joint author on 2005/2008 SSIS Book by Wrox

•Websites

–www.CopperBlueConsulting.com

•StreamInsight and SQL Azure Advisory Boards

•Specialise in Data and Process Integration

•Microsoft SQL Server MVP

•Twitter: allanSQLIS

•E: [email protected]

Page 3: CDC in SQL Server 2012 SSIS - Allan Mitchell

Why?

Page 4: CDC in SQL Server 2012 SSIS - Allan Mitchell

Data

Data, Data Everywhere

Everyone has it

Lots of it

Dispersed around our environment

Heterogeneous Sources

The Problem

Page 5: CDC in SQL Server 2012 SSIS - Allan Mitchell

Problem with data – Part 1

What is data?

Raw

Doesn’t mean a lot

Needs context

Needs enriching

Need to take next steps

Information

Knowledge

Wisdom

Page 6: CDC in SQL Server 2012 SSIS - Allan Mitchell

Problem with data – Part 2

Timeliness

When do people need it

How do they need it

“Out of date” data is next to useless

Not everyone needs real-time

Everyone should make “in date” their goal

Page 7: CDC in SQL Server 2012 SSIS - Allan Mitchell

Problem with data – Part 3

Quantity

No longer only for big Corps

1TB of disk is ~ $50

Moving it around

Windows of operation

Only transfer what we need

Page 8: CDC in SQL Server 2012 SSIS - Allan Mitchell

What are people doing?

As soon as data in source changes

Extract

Cleanse

Conform

Load

Only moving what needs to be moved

Right?

Page 9: CDC in SQL Server 2012 SSIS - Allan Mitchell

Why?

Hard

No tracking on Source Systems

Costs money to design

Need new skillsets

Page 10: CDC in SQL Server 2012 SSIS - Allan Mitchell

How?

Page 11: CDC in SQL Server 2012 SSIS - Allan Mitchell

CDC in SQL Server 2012

• Introduced in SQL Server 2008 • Not the easiest thing to code • No integration with SSIS • Uses Transactional replication

Agent to read log LSNs

Page 12: CDC in SQL Server 2012 SSIS - Allan Mitchell

Setup

• Enable DB for CDC • sys.sp_cdc_enable_db

• Enable table for CDC • sys.sp_cdc_enable_table

Page 13: CDC in SQL Server 2012 SSIS - Allan Mitchell

Components

• Control Flow • CDC Control Task: Manages state and

recovery of CDC Packages.

• Data Flow • CDC Source: Reads change data from

capture tables • CDC Splitter: A Conditional Split for CDC

Page 14: CDC in SQL Server 2012 SSIS - Allan Mitchell

Packages

• Initial: This package does the initial “Full Pull” • Incremental: This does the incremental extracts

Page 15: CDC in SQL Server 2012 SSIS - Allan Mitchell

CDC Control Task

• Initial Load • Mark initial load start • Mark initial load end • Mark CDC start

• CDC • Get processing range • Mark processed range • Reset CDC state

Page 16: CDC in SQL Server 2012 SSIS - Allan Mitchell

CDC Source

• All • All with old values • Net • Net with update mask • Net with merge

Page 17: CDC in SQL Server 2012 SSIS - Allan Mitchell

Demo

Putting it together

Page 18: CDC in SQL Server 2012 SSIS - Allan Mitchell

e: [email protected]

t: @allanSQLIS

Thankyou