SlideShare a Scribd company logo
1 of 3
Download to read offline
Introduction to Change Data Capture in SQL Server 2008 | TechRepublic



   ZDNet Asia    SmartPlanet    TechRepublic                                                                                    Log In   Join TechRepublic   FAQ   Go Pro!




                                                   Blogs     Downloads        Newsletters       Galleries      Q&A     Discussions       News
                                               Research Library


     IT Management             Development         IT Support           Data Center       Networks         Security




     Home / Blogs / The Enterprise Cloud                                                   Follow this blog:

     The Enterprise Cloud


     Introduction to Change Data
     Capture in SQL Server 2008
     By Tim Chapman
     January 12, 2009, 11:47 AM PST

     Takeaway: In today’s database tip, SQL Server database consultant Tim Chapman takes a look
     at the great new auditing features available in SQL Server 2008.

     Almost all industries require some type of data auditing in one form or another. This is especially
     true in the financial and health care industries, where changes in data can have critical effects.
     Sarbanes-Oxley compliance is a great example of how important data auditing is. Auditing data is
     important for processes other than just the retention of data. Extract, Transformation, and Loading
     (ETL) activities that incrementally load altered data into the data warehouse typically have to make
     use of some type of auditing to identify those records where the data has changed. Change Data
     Capture (CDC), a brand new feature in SQL Server 2008, features the ability to capture and store
     structure and data alterations in your SQL Server system.

     What is Change Data Capture?
     Change Data Capture (CDC), a wonderful new feature in SQL Server 2008, provides the ability to
     set up and manage database data auditing without requiring custom auditing procedures and
     triggers. This feature captures DML operations (Insert, Update, Delete statements) and makes the
     altered database available for later reporting. CDC is first enabled at the database level, and then
     to the necessary tables. After you enable a table for CDC, a similar table is created to track the
     data changes.

     Insert and delete operations are represented as a single record in the change audit table, whereas
     update statements are represented as two records. Insert and delete statements involve only a
     single aspect of data: the row that has been inserted or the row that has been deleted. On the
     other hand, update statements involve two different sets of data: the record values that existed
     before the update statement and those that exist after the statement occurs. The CDC system
     captures both of these records, which makes it very convenient to compare values correlated to
     the update statement.

     In addition to capturing the previous value and new value from Update statements, CDC also
     captures the fields that were updated in the form of a bitmask. This mask can be used to easily
     determine which fields were included in the Update statement, and which fields were not.

     As time goes on, and data keeps changing, you may find yourself in a position to clear out some
     of the data that has been captured by the CDC system. Luckily, SQL Server 2008 includes a
     retention policy for CDC that allows you to specify and remove data that has been captured and
     held for a certain amount of days.




http://www.techrepublic.com/blog/datacenter/introduction-to-change-data-capture-in-sql-server-2008/520[08/29/2012 3:47:51 PM]
Introduction to Change Data Capture in SQL Server 2008 | TechRepublic

     CDC also does a pretty good job of keeping track and accommodating new fields and alterations
     to the underlying tables that are being audited. This is a great feature for reporting any type of
     structure changes.

     The CDC process scans the transaction log to capture the changed data and write it to the audit
     tables. The auditing process is asynchronous and occurs in its own transaction scope, so there’s
     no overhead involved in the transaction that alters the data.

     Your database does not need to be set to the Full recovery model in order to take advantage of
     CDC’s features. However, there are some things to consider if you’re using the Simple recovery
     model with CDC. The major point of interest is the fact that the log will not truncate until the data
     altered has been captured by the CDC process. This may eventually delay log truncation
     accomplished by the Checkpoint process, which could cause the log file to remain larger than
     expected. This is something that you should consider if you’re limited to space on your SQL
     Server.

     In addition to capturing data that has been changed for CDC audited tables, CDC also has the
     ability to keep track of Data Definition Language (DDL) changes that are executed to the base
     tables. The ability to capture and maintain this data is paramount not only for auditing purposes,
     but also for change management purposes.

     Next time
     Today I looked at the capabilities and features of the new Change Data Capture technology in
     SQL Server 2008. These are without doubt great new features. However, the functionality present
     in CDC is available in SQL Server 2005, and can be accomplished with some custom coding and
     a little bit of replication work. Next time I’ll expand on the CDC subject and show you how you can
     set up data auditing using CDC on your SQL Server 2008 system. Perhaps in a future article I’ll
     look at how you can develop your own custom CDC functionality in SQL Server 2005.


     Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free
     newsletters.




                    About Tim Chapman
                       Full Bio     Contact




                 Configure the screen saver                      Oil & Water: Hyper-V and 3D
                 timeout in Windows Server                       graphics adapters
                 2008 Core Edition

       People who read this...
          Four cool new features slated for SQL Server 2008
          Choose the proper Oracle design for auditing




         3          Join the conversation!                                                 Add Your Opinion
      Comments      Follow via:



      Staff Picks     Top Rated       Most Recent       My Contacts                              See All Comments




                      RE: Introduction to Change Data Capture in SQL Server                            0
                      2008                                                                            Votes




http://www.techrepublic.com/blog/datacenter/introduction-to-change-data-capture-in-sql-server-2008/520[08/29/2012 3:47:51 PM]
Introduction to Change Data Capture in SQL Server 2008 | TechRepublic




                      eralper.yilmaz@... 19th Jan 2009

            Hello, Here is some screenshots for a sample usage of CDC in sql2008
            http://www.kodyaz.com/articles/change-data-capture.aspx CDC is a handy feature
            where it can be used for also logging changed data... Read Whole Comment +


               View in thread




                      CDC by whom?                                                                     0
                      ashepard@... 14th Jan 2009                                                      Votes



            CDC for DML seem much easier than archive log miner of Oracle. The first question
            is What was changed and who changed it.

            Any word on "on line table rebuild" like SQL 2005 online index rebuild??


               View in thread




                      Excellent Article                                                                0
                      Terry_Pino@... 13th Jan 2009                                                    Votes



            Well written, thanks for the overview. Would you happen to have any references to
            CDC in mssql2005?

            Thanks


               View in thread




                                                 See all comments



     Join the TechRepublic Community and join the conversation! Signing-up is
     free and quick, Do it now, we want to hear your opinion.

       Join       Login




http://www.techrepublic.com/blog/datacenter/introduction-to-change-data-capture-in-sql-server-2008/520[08/29/2012 3:47:51 PM]

More Related Content

What's hot

Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...djkucera
 
Help! my sql server log file is too big!!! tech republic
Help! my sql server log file is too big!!!   tech republicHelp! my sql server log file is too big!!!   tech republic
Help! my sql server log file is too big!!! tech republicKaing Menglieng
 
Sql server 2012 roadshow masd overview 003
Sql server 2012 roadshow masd overview 003Sql server 2012 roadshow masd overview 003
Sql server 2012 roadshow masd overview 003Mark Kromer
 
Scalable scheduling of updates in streaming data warehouses
Scalable scheduling of updates in streaming data warehousesScalable scheduling of updates in streaming data warehouses
Scalable scheduling of updates in streaming data warehousesFinalyear Projects
 
SQL Server R2 Sunumu
SQL Server R2 SunumuSQL Server R2 Sunumu
SQL Server R2 SunumuÇözümPARK
 
What's new in SQL Server 2012 for philly code camp 2012.1
What's new in SQL Server 2012 for philly code camp 2012.1What's new in SQL Server 2012 for philly code camp 2012.1
What's new in SQL Server 2012 for philly code camp 2012.1Mark Kromer
 
Dell Active System 800 converged infrastructure solution: VDI and collaborati...
Dell Active System 800 converged infrastructure solution: VDI and collaborati...Dell Active System 800 converged infrastructure solution: VDI and collaborati...
Dell Active System 800 converged infrastructure solution: VDI and collaborati...Principled Technologies
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...webhostingguy
 
Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...
Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...
Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...Principled Technologies
 
Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...
Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...
Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...Microsoft Private Cloud
 
Oracle_DB_sobre_Oracle
Oracle_DB_sobre_OracleOracle_DB_sobre_Oracle
Oracle_DB_sobre_OracleFran Navarro
 
White Paper Dell Reference Configuration Deploying Microsoft ...
White Paper Dell Reference Configuration Deploying Microsoft ...White Paper Dell Reference Configuration Deploying Microsoft ...
White Paper Dell Reference Configuration Deploying Microsoft ...webhostingguy
 
Sql Server 2008 And Moss
Sql Server 2008 And MossSql Server 2008 And Moss
Sql Server 2008 And MossEduardo Castro
 
Sql Server 2008 Security Enhanments
Sql Server 2008 Security EnhanmentsSql Server 2008 Security Enhanments
Sql Server 2008 Security EnhanmentsEduardo Castro
 
Sql Server 2012 overview and licensing
Sql Server 2012 overview and licensingSql Server 2012 overview and licensing
Sql Server 2012 overview and licensingRay Cochrane
 
SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...
SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...
SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...Michael Noel
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Serverwebhostingguy
 

What's hot (20)

Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
 
Help! my sql server log file is too big!!! tech republic
Help! my sql server log file is too big!!!   tech republicHelp! my sql server log file is too big!!!   tech republic
Help! my sql server log file is too big!!! tech republic
 
Sql server 2012 roadshow masd overview 003
Sql server 2012 roadshow masd overview 003Sql server 2012 roadshow masd overview 003
Sql server 2012 roadshow masd overview 003
 
Scalable scheduling of updates in streaming data warehouses
Scalable scheduling of updates in streaming data warehousesScalable scheduling of updates in streaming data warehouses
Scalable scheduling of updates in streaming data warehouses
 
SQL Server R2 Sunumu
SQL Server R2 SunumuSQL Server R2 Sunumu
SQL Server R2 Sunumu
 
What's new in SQL Server 2012 for philly code camp 2012.1
What's new in SQL Server 2012 for philly code camp 2012.1What's new in SQL Server 2012 for philly code camp 2012.1
What's new in SQL Server 2012 for philly code camp 2012.1
 
Dell Active System 800 converged infrastructure solution: VDI and collaborati...
Dell Active System 800 converged infrastructure solution: VDI and collaborati...Dell Active System 800 converged infrastructure solution: VDI and collaborati...
Dell Active System 800 converged infrastructure solution: VDI and collaborati...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Caracteristicas sql
Caracteristicas sqlCaracteristicas sql
Caracteristicas sql
 
Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...
Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...
Keep your data safe by moving from unsupported SQL Server 2008 to SQL Server ...
 
Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...
Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...
Microsoft SQL Server 2008 - Ten Reasons to Choose Microsoft SQL Server 2008 R...
 
Oracle_DB_sobre_Oracle
Oracle_DB_sobre_OracleOracle_DB_sobre_Oracle
Oracle_DB_sobre_Oracle
 
White Paper Dell Reference Configuration Deploying Microsoft ...
White Paper Dell Reference Configuration Deploying Microsoft ...White Paper Dell Reference Configuration Deploying Microsoft ...
White Paper Dell Reference Configuration Deploying Microsoft ...
 
Sql Server 2008 And Moss
Sql Server 2008 And MossSql Server 2008 And Moss
Sql Server 2008 And Moss
 
KarenResumeDBA
KarenResumeDBAKarenResumeDBA
KarenResumeDBA
 
Sql Server 2008 Security Enhanments
Sql Server 2008 Security EnhanmentsSql Server 2008 Security Enhanments
Sql Server 2008 Security Enhanments
 
Sql Server 2012 overview and licensing
Sql Server 2012 overview and licensingSql Server 2012 overview and licensing
Sql Server 2012 overview and licensing
 
Windows server 2012_r2_
Windows server 2012_r2_ Windows server 2012_r2_
Windows server 2012_r2_
 
SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...
SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...
SharePoint 2010 High Availability and Disaster Recovery - SharePoint Connecti...
 
MICROSOFT SQL Server
MICROSOFT SQL ServerMICROSOFT SQL Server
MICROSOFT SQL Server
 

Viewers also liked

Analysis of magazine contents pages
Analysis of magazine contents pagesAnalysis of magazine contents pages
Analysis of magazine contents pagesLiamDonnelly
 
Opin hu twitter_chavez_20121008
Opin hu twitter_chavez_20121008Opin hu twitter_chavez_20121008
Opin hu twitter_chavez_20121008GeoX
 
Professional Resume2
Professional Resume2Professional Resume2
Professional Resume2Ed Morris
 
Continuum
ContinuumContinuum
ContinuumPato_Ch
 
สภาพสมดุล
สภาพสมดุลสภาพสมดุล
สภาพสมดุลpumarin20012
 
Goals On Every Level
Goals On Every LevelGoals On Every Level
Goals On Every LevelTom Sommer
 

Viewers also liked (8)

Unit 1
Unit 1Unit 1
Unit 1
 
Analysis of magazine contents pages
Analysis of magazine contents pagesAnalysis of magazine contents pages
Analysis of magazine contents pages
 
Mis nenas
Mis nenasMis nenas
Mis nenas
 
Opin hu twitter_chavez_20121008
Opin hu twitter_chavez_20121008Opin hu twitter_chavez_20121008
Opin hu twitter_chavez_20121008
 
Professional Resume2
Professional Resume2Professional Resume2
Professional Resume2
 
Continuum
ContinuumContinuum
Continuum
 
สภาพสมดุล
สภาพสมดุลสภาพสมดุล
สภาพสมดุล
 
Goals On Every Level
Goals On Every LevelGoals On Every Level
Goals On Every Level
 

Similar to Introduction to change data capture in sql server 2008 tech republic

What is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionWhat is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionSoftwareDeals
 
Introduction to policy based management in sql server 2008 tech-republic
Introduction to policy based management in sql server 2008   tech-republicIntroduction to policy based management in sql server 2008   tech-republic
Introduction to policy based management in sql server 2008 tech-republicKaing Menglieng
 
Sql Server 2008 Enhancements
Sql Server 2008 EnhancementsSql Server 2008 Enhancements
Sql Server 2008 Enhancementskobico10
 
Capture Change and Apply It!
Capture Change and Apply It!Capture Change and Apply It!
Capture Change and Apply It!Steve Wake
 
Using sql server 2008's merge statement tech republic
Using sql server 2008's merge statement   tech republicUsing sql server 2008's merge statement   tech republic
Using sql server 2008's merge statement tech republicKaing Menglieng
 
ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012Steve Wake
 
Under New Management
Under New ManagementUnder New Management
Under New Managementukdpe
 
An introduction to new data warehouse scalability features in sql server 2008
An introduction to new data warehouse scalability features in sql server 2008An introduction to new data warehouse scalability features in sql server 2008
An introduction to new data warehouse scalability features in sql server 2008Klaudiia Jacome
 
Resume_Tushar_Kanti_DBA
Resume_Tushar_Kanti_DBAResume_Tushar_Kanti_DBA
Resume_Tushar_Kanti_DBATushar Kanti
 
Sql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scaleSql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scaleKlaudiia Jacome
 
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...Embarcadero Technologies
 
Sql Server 2008 Product Overview
Sql Server 2008 Product OverviewSql Server 2008 Product Overview
Sql Server 2008 Product OverviewIsmail Muhammad
 
Using hash fields in sql server tech republic
Using hash fields in sql server   tech republicUsing hash fields in sql server   tech republic
Using hash fields in sql server tech republicKaing Menglieng
 
Tips for managing a VLDB
Tips for managing a VLDBTips for managing a VLDB
Tips for managing a VLDBJohn Martin
 
Andrewfraserdba.com training sql_training
Andrewfraserdba.com training sql_trainingAndrewfraserdba.com training sql_training
Andrewfraserdba.com training sql_trainingmark jerald Canal
 
Sql training
Sql trainingSql training
Sql trainingpremrings
 
SSDT Workshop @ SQL Bits X (2012-03-29)
SSDT Workshop @ SQL Bits X (2012-03-29)SSDT Workshop @ SQL Bits X (2012-03-29)
SSDT Workshop @ SQL Bits X (2012-03-29)Gert Drapers
 
CA_Plex_SupportForModernizingIBM_DB2_for_i
CA_Plex_SupportForModernizingIBM_DB2_for_iCA_Plex_SupportForModernizingIBM_DB2_for_i
CA_Plex_SupportForModernizingIBM_DB2_for_iGeorge Jeffcock
 
Introduction to microsoft sql server 2008 r2
Introduction to microsoft sql server 2008 r2Introduction to microsoft sql server 2008 r2
Introduction to microsoft sql server 2008 r2Eduardo Castro
 
Whats New Sql Server 2008 R2 Cw
Whats New Sql Server 2008 R2 CwWhats New Sql Server 2008 R2 Cw
Whats New Sql Server 2008 R2 CwEduardo Castro
 

Similar to Introduction to change data capture in sql server 2008 tech republic (20)

What is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard EditionWhat is SQL Server 2019 Standard Edition
What is SQL Server 2019 Standard Edition
 
Introduction to policy based management in sql server 2008 tech-republic
Introduction to policy based management in sql server 2008   tech-republicIntroduction to policy based management in sql server 2008   tech-republic
Introduction to policy based management in sql server 2008 tech-republic
 
Sql Server 2008 Enhancements
Sql Server 2008 EnhancementsSql Server 2008 Enhancements
Sql Server 2008 Enhancements
 
Capture Change and Apply It!
Capture Change and Apply It!Capture Change and Apply It!
Capture Change and Apply It!
 
Using sql server 2008's merge statement tech republic
Using sql server 2008's merge statement   tech republicUsing sql server 2008's merge statement   tech republic
Using sql server 2008's merge statement tech republic
 
ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012ABCs of CDC with SSIS 2012
ABCs of CDC with SSIS 2012
 
Under New Management
Under New ManagementUnder New Management
Under New Management
 
An introduction to new data warehouse scalability features in sql server 2008
An introduction to new data warehouse scalability features in sql server 2008An introduction to new data warehouse scalability features in sql server 2008
An introduction to new data warehouse scalability features in sql server 2008
 
Resume_Tushar_Kanti_DBA
Resume_Tushar_Kanti_DBAResume_Tushar_Kanti_DBA
Resume_Tushar_Kanti_DBA
 
Sql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scaleSql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scale
 
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
DB Optimizer Datasheet - Automated SQL Profiling & Tuning for Optimized Perfo...
 
Sql Server 2008 Product Overview
Sql Server 2008 Product OverviewSql Server 2008 Product Overview
Sql Server 2008 Product Overview
 
Using hash fields in sql server tech republic
Using hash fields in sql server   tech republicUsing hash fields in sql server   tech republic
Using hash fields in sql server tech republic
 
Tips for managing a VLDB
Tips for managing a VLDBTips for managing a VLDB
Tips for managing a VLDB
 
Andrewfraserdba.com training sql_training
Andrewfraserdba.com training sql_trainingAndrewfraserdba.com training sql_training
Andrewfraserdba.com training sql_training
 
Sql training
Sql trainingSql training
Sql training
 
SSDT Workshop @ SQL Bits X (2012-03-29)
SSDT Workshop @ SQL Bits X (2012-03-29)SSDT Workshop @ SQL Bits X (2012-03-29)
SSDT Workshop @ SQL Bits X (2012-03-29)
 
CA_Plex_SupportForModernizingIBM_DB2_for_i
CA_Plex_SupportForModernizingIBM_DB2_for_iCA_Plex_SupportForModernizingIBM_DB2_for_i
CA_Plex_SupportForModernizingIBM_DB2_for_i
 
Introduction to microsoft sql server 2008 r2
Introduction to microsoft sql server 2008 r2Introduction to microsoft sql server 2008 r2
Introduction to microsoft sql server 2008 r2
 
Whats New Sql Server 2008 R2 Cw
Whats New Sql Server 2008 R2 CwWhats New Sql Server 2008 R2 Cw
Whats New Sql Server 2008 R2 Cw
 

More from Kaing Menglieng

What is your sql server backup strategy tech_republic
What is your sql server backup strategy    tech_republicWhat is your sql server backup strategy    tech_republic
What is your sql server backup strategy tech_republicKaing Menglieng
 
Using object dependencies in sql server 2008 tech republic
Using object dependencies in sql server 2008   tech republicUsing object dependencies in sql server 2008   tech republic
Using object dependencies in sql server 2008 tech republicKaing Menglieng
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republicKaing Menglieng
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republicKaing Menglieng
 
Sql server indexed views speed up your select queries part 1 - code-projec
Sql server indexed views   speed up your select queries  part 1 - code-projecSql server indexed views   speed up your select queries  part 1 - code-projec
Sql server indexed views speed up your select queries part 1 - code-projecKaing Menglieng
 
Sql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookupSql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookupKaing Menglieng
 
Sql server common interview questions and answers
Sql server   common interview questions and answersSql server   common interview questions and answers
Sql server common interview questions and answersKaing Menglieng
 
Sql server common interview questions and answers page 6
Sql server   common interview questions and answers page 6Sql server   common interview questions and answers page 6
Sql server common interview questions and answers page 6Kaing Menglieng
 
Sql server common interview questions and answers page 5
Sql server   common interview questions and answers page 5Sql server   common interview questions and answers page 5
Sql server common interview questions and answers page 5Kaing Menglieng
 
Sql server common interview questions and answers page 4
Sql server   common interview questions and answers page 4Sql server   common interview questions and answers page 4
Sql server common interview questions and answers page 4Kaing Menglieng
 
Sql server common interview questions and answers page 2
Sql server   common interview questions and answers page 2Sql server   common interview questions and answers page 2
Sql server common interview questions and answers page 2Kaing Menglieng
 
Sql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql seSql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql seKaing Menglieng
 
Speeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joinsSpeeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joinsKaing Menglieng
 
Speed up sql server apps - visual studio magazine
Speed up sql server apps  - visual studio magazineSpeed up sql server apps  - visual studio magazine
Speed up sql server apps - visual studio magazineKaing Menglieng
 
See sql server graphical execution plans in action tech republic
See sql server graphical execution plans in action   tech republicSee sql server graphical execution plans in action   tech republic
See sql server graphical execution plans in action tech republicKaing Menglieng
 
Reviewing sql server permissions tech republic
Reviewing sql server permissions   tech republicReviewing sql server permissions   tech republic
Reviewing sql server permissions tech republicKaing Menglieng
 
Query optimization how to search millions of record in sql table faster -
Query optimization   how to search millions of record in sql table faster  -Query optimization   how to search millions of record in sql table faster  -
Query optimization how to search millions of record in sql table faster -Kaing Menglieng
 
Optimize sql server queries with these advanced tuning techniques tech repu
Optimize sql server queries with these advanced tuning techniques   tech repuOptimize sql server queries with these advanced tuning techniques   tech repu
Optimize sql server queries with these advanced tuning techniques tech repuKaing Menglieng
 
New date datatypes in sql server 2008 tech republic
New date datatypes in sql server 2008   tech republicNew date datatypes in sql server 2008   tech republic
New date datatypes in sql server 2008 tech republicKaing Menglieng
 

More from Kaing Menglieng (20)

What is your sql server backup strategy tech_republic
What is your sql server backup strategy    tech_republicWhat is your sql server backup strategy    tech_republic
What is your sql server backup strategy tech_republic
 
Using object dependencies in sql server 2008 tech republic
Using object dependencies in sql server 2008   tech republicUsing object dependencies in sql server 2008   tech republic
Using object dependencies in sql server 2008 tech republic
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republic
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republic
 
Sql server indexed views speed up your select queries part 1 - code-projec
Sql server indexed views   speed up your select queries  part 1 - code-projecSql server indexed views   speed up your select queries  part 1 - code-projec
Sql server indexed views speed up your select queries part 1 - code-projec
 
Sql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookupSql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookup
 
Sql server common interview questions and answers
Sql server   common interview questions and answersSql server   common interview questions and answers
Sql server common interview questions and answers
 
Sql server common interview questions and answers page 6
Sql server   common interview questions and answers page 6Sql server   common interview questions and answers page 6
Sql server common interview questions and answers page 6
 
Sql server common interview questions and answers page 5
Sql server   common interview questions and answers page 5Sql server   common interview questions and answers page 5
Sql server common interview questions and answers page 5
 
Sql server common interview questions and answers page 4
Sql server   common interview questions and answers page 4Sql server   common interview questions and answers page 4
Sql server common interview questions and answers page 4
 
Sql server common interview questions and answers page 2
Sql server   common interview questions and answers page 2Sql server   common interview questions and answers page 2
Sql server common interview questions and answers page 2
 
Sql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql seSql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql se
 
Speeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joinsSpeeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joins
 
Speed up sql
Speed up sqlSpeed up sql
Speed up sql
 
Speed up sql server apps - visual studio magazine
Speed up sql server apps  - visual studio magazineSpeed up sql server apps  - visual studio magazine
Speed up sql server apps - visual studio magazine
 
See sql server graphical execution plans in action tech republic
See sql server graphical execution plans in action   tech republicSee sql server graphical execution plans in action   tech republic
See sql server graphical execution plans in action tech republic
 
Reviewing sql server permissions tech republic
Reviewing sql server permissions   tech republicReviewing sql server permissions   tech republic
Reviewing sql server permissions tech republic
 
Query optimization how to search millions of record in sql table faster -
Query optimization   how to search millions of record in sql table faster  -Query optimization   how to search millions of record in sql table faster  -
Query optimization how to search millions of record in sql table faster -
 
Optimize sql server queries with these advanced tuning techniques tech repu
Optimize sql server queries with these advanced tuning techniques   tech repuOptimize sql server queries with these advanced tuning techniques   tech repu
Optimize sql server queries with these advanced tuning techniques tech repu
 
New date datatypes in sql server 2008 tech republic
New date datatypes in sql server 2008   tech republicNew date datatypes in sql server 2008   tech republic
New date datatypes in sql server 2008 tech republic
 

Introduction to change data capture in sql server 2008 tech republic

  • 1. Introduction to Change Data Capture in SQL Server 2008 | TechRepublic ZDNet Asia SmartPlanet TechRepublic Log In Join TechRepublic FAQ Go Pro! Blogs Downloads Newsletters Galleries Q&A Discussions News Research Library IT Management Development IT Support Data Center Networks Security Home / Blogs / The Enterprise Cloud Follow this blog: The Enterprise Cloud Introduction to Change Data Capture in SQL Server 2008 By Tim Chapman January 12, 2009, 11:47 AM PST Takeaway: In today’s database tip, SQL Server database consultant Tim Chapman takes a look at the great new auditing features available in SQL Server 2008. Almost all industries require some type of data auditing in one form or another. This is especially true in the financial and health care industries, where changes in data can have critical effects. Sarbanes-Oxley compliance is a great example of how important data auditing is. Auditing data is important for processes other than just the retention of data. Extract, Transformation, and Loading (ETL) activities that incrementally load altered data into the data warehouse typically have to make use of some type of auditing to identify those records where the data has changed. Change Data Capture (CDC), a brand new feature in SQL Server 2008, features the ability to capture and store structure and data alterations in your SQL Server system. What is Change Data Capture? Change Data Capture (CDC), a wonderful new feature in SQL Server 2008, provides the ability to set up and manage database data auditing without requiring custom auditing procedures and triggers. This feature captures DML operations (Insert, Update, Delete statements) and makes the altered database available for later reporting. CDC is first enabled at the database level, and then to the necessary tables. After you enable a table for CDC, a similar table is created to track the data changes. Insert and delete operations are represented as a single record in the change audit table, whereas update statements are represented as two records. Insert and delete statements involve only a single aspect of data: the row that has been inserted or the row that has been deleted. On the other hand, update statements involve two different sets of data: the record values that existed before the update statement and those that exist after the statement occurs. The CDC system captures both of these records, which makes it very convenient to compare values correlated to the update statement. In addition to capturing the previous value and new value from Update statements, CDC also captures the fields that were updated in the form of a bitmask. This mask can be used to easily determine which fields were included in the Update statement, and which fields were not. As time goes on, and data keeps changing, you may find yourself in a position to clear out some of the data that has been captured by the CDC system. Luckily, SQL Server 2008 includes a retention policy for CDC that allows you to specify and remove data that has been captured and held for a certain amount of days. http://www.techrepublic.com/blog/datacenter/introduction-to-change-data-capture-in-sql-server-2008/520[08/29/2012 3:47:51 PM]
  • 2. Introduction to Change Data Capture in SQL Server 2008 | TechRepublic CDC also does a pretty good job of keeping track and accommodating new fields and alterations to the underlying tables that are being audited. This is a great feature for reporting any type of structure changes. The CDC process scans the transaction log to capture the changed data and write it to the audit tables. The auditing process is asynchronous and occurs in its own transaction scope, so there’s no overhead involved in the transaction that alters the data. Your database does not need to be set to the Full recovery model in order to take advantage of CDC’s features. However, there are some things to consider if you’re using the Simple recovery model with CDC. The major point of interest is the fact that the log will not truncate until the data altered has been captured by the CDC process. This may eventually delay log truncation accomplished by the Checkpoint process, which could cause the log file to remain larger than expected. This is something that you should consider if you’re limited to space on your SQL Server. In addition to capturing data that has been changed for CDC audited tables, CDC also has the ability to keep track of Data Definition Language (DDL) changes that are executed to the base tables. The ability to capture and maintain this data is paramount not only for auditing purposes, but also for change management purposes. Next time Today I looked at the capabilities and features of the new Change Data Capture technology in SQL Server 2008. These are without doubt great new features. However, the functionality present in CDC is available in SQL Server 2005, and can be accomplished with some custom coding and a little bit of replication work. Next time I’ll expand on the CDC subject and show you how you can set up data auditing using CDC on your SQL Server 2008 system. Perhaps in a future article I’ll look at how you can develop your own custom CDC functionality in SQL Server 2005. Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters. About Tim Chapman Full Bio Contact Configure the screen saver Oil & Water: Hyper-V and 3D timeout in Windows Server graphics adapters 2008 Core Edition People who read this... Four cool new features slated for SQL Server 2008 Choose the proper Oracle design for auditing 3 Join the conversation! Add Your Opinion Comments Follow via: Staff Picks Top Rated Most Recent My Contacts See All Comments RE: Introduction to Change Data Capture in SQL Server 0 2008 Votes http://www.techrepublic.com/blog/datacenter/introduction-to-change-data-capture-in-sql-server-2008/520[08/29/2012 3:47:51 PM]
  • 3. Introduction to Change Data Capture in SQL Server 2008 | TechRepublic eralper.yilmaz@... 19th Jan 2009 Hello, Here is some screenshots for a sample usage of CDC in sql2008 http://www.kodyaz.com/articles/change-data-capture.aspx CDC is a handy feature where it can be used for also logging changed data... Read Whole Comment + View in thread CDC by whom? 0 ashepard@... 14th Jan 2009 Votes CDC for DML seem much easier than archive log miner of Oracle. The first question is What was changed and who changed it. Any word on "on line table rebuild" like SQL 2005 online index rebuild?? View in thread Excellent Article 0 Terry_Pino@... 13th Jan 2009 Votes Well written, thanks for the overview. Would you happen to have any references to CDC in mssql2005? Thanks View in thread See all comments Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion. Join Login http://www.techrepublic.com/blog/datacenter/introduction-to-change-data-capture-in-sql-server-2008/520[08/29/2012 3:47:51 PM]