SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Change Data Capture - SQL Server 2008


Change Data Capture - SQL Server 2008

Author
Message
nitesh_rd
nitesh_rd
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 101
Comments posted to this topic are about the item Change Data Capture - SQL Server 2008
Daniel Steiner
Daniel Steiner
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 52
this feature is not available in all editions of SQL Server.

Change data capture is available only on the Enterprise, Developer, and Evaluation editions of SQL Server.
Kishore.P
Kishore.P
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4653 Visits: 619
Is it possible to hold the CDC information into another database?. It means for example, I have database name call INVENTORYDB, have enabled the CDC for all tables on this database. But I want capture the CDC from INVENTORYDB into DBAUDITLOG database? If possible, please share the idea.

Thanks in advance.



Divine Flame
Divine Flame
SSCrazy Eights
SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)SSCrazy Eights (8.6K reputation)

Group: General Forum Members
Points: 8577 Visits: 2816
Nice article to start.

If would have been nice if you had explained few things in a better manner. For example, what is the difference between "All changes" & "Net Changes"?


Sujeet Singh
justdr5
justdr5
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 39
Does it have the ability to return to a previous state? Ie. If i make data changes at 1pm it has a means for me to revert back to the state at 12:59pm? Also, does it track who/what made the change?
Steve Rajkovich
Steve Rajkovich
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 293
Thanks, you have explained some good basics for me to think about...too bad it's not offered in Standard.

However, how do schema changes on the tblEmployee table impact the CDC's process and data when CDC is enabled for the tblEmployee table? Would you have to disable and re-enabled CDC for the table and basically recreate it? ...and in doing so, are all change data lost?

How are transactions handled via the CSC when ROLLBACKS are executed?

You state triggers affect performance...I agree...but WHY does the CDC perform better? Technical detail may be outside of scope of the article, but some comparison workings of the trigger vs. CDC would nice to understand why after starting with the "argument."
kapil_kk
kapil_kk
SSCrazy Eights
SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)SSCrazy Eights (9.7K reputation)

Group: General Forum Members
Points: 9735 Visits: 2778
WHen you are enabling CDC on table, you are executing a sp in this manner:

EXEC sys.sp_cdc_enable_table
@Source_schema = N'dbo',
@source_name = N'tblEmployee',
@filegroup_name = N'PRIMARY',
@supports_net_changes = 1
GO

It will not gets executed as it requires other parameters also

EXEC [sys].[sp_cdc_enable_table]
(
@source_schema sysname,
@source_name sysname,
@capture_instance sysname = null,
@supports_net_changes bit = null,
@role_name sysname,
@index_name sysname = null,
@captured_column_list nvarchar(max) = null,
@filegroup_name sysname = null,
@allow_partition_switch bit = 1
)

Specify parameter @role_name also in your article

_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Jim_K
Jim_K
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1115 Visits: 1845
A good article to read on CDC is the whitepaper that was published a couple of years ago when the feature was released with 2008. IIRC, CDC does create a schema in the local database, but it gets the changes in data from the transaction logs (which has some side effects). SSIS also can extract the data for loading into a separate database, and you can do it through SQL as well.
timothyawiseman
timothyawiseman
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4324 Visits: 920
Thanks for the article, it provides a good summary and overview of CDC.

It is worth emphasizing that CDC is mostly an enterprise feature and is not available in Standard or Express editions.

---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
YSLGuru
YSLGuru
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10208 Visits: 1670
Maybe its just me but SQL Servers CDC just feels way to kludgy. Three times now I've tried it out on SQL Server 2008R2 Enterprise and every time its left a sour taste. From its lack of information (who made the change) to the overkill required to get the info CDC has captrured, the feature just has a beta feel to it. I guess if you don't care who made the change and you don't mind the excessive number of steps (i.e. lines of SQL Code) you have to run to get any info then maybe CDC is OK to you.

What gets me the most is how you can't just call a CDC function with something simple (i.e an as of date or a date range). You have to pass in LSN values and even then you have to be careful to validate them first.

I personally prefer to NOT do anything custom and use native SQL Server functionality whenever possible but when it comes to Change Data Capture I've had a far easier time with a custom trigger and audit table. I had been so looking forward to CDC when we moved from SQL 200 to 2008R2.

Kindest Regards,

Just say No to Facebook!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search