Questions tagged [change-data-capture]

Questions under this tag are expected to relate to Change Data Capture technologies available in many RDBMS server products. Change data capture is designed to capture insert, update, and delete activity applied to Server tables, and to make the details of the changes available in an easily consumed relational format.

Filter by
Sorted by
Tagged with
27
votes
4answers
16k views

When to use CDC to track history?

SQL Server Change Data Capture is a feature that reads historical data from the SQL Server transaction logs and stores them in a special table. Through the use of special table value functions (TVF) ...
12
votes
3answers
6k views

Find the identity of the client firing a query in SQL Server without using triggers?

I'm currently using Change Data Capture (CDC) to track data changes, and I wish to track the host name and IP address of the client submitting the query that made the changes. If there are 5 different ...
10
votes
3answers
9k views

Change data capture - how to know who made the change?

Tracking who made the change identified by CDC. Along the lines of my datetime hack I tried the same approach by adding suser_sname as a new field with default value on the cdc change track table. ...
9
votes
2answers
6k views

Change Data Capture and the __$update_mask binary

We're using CDC to capture changes made to a production table. The changed rows are being exported out to a data warehouse (informatica). I know that the __$update_mask column stores what columns ...
9
votes
1answer
2k views

How to tell if a backup file contains CDC?

Using SQL Server 2008 through to 2014, I know how to backup and restore a database with Change Data Capture enabled (CDC), but what I am looking for is a way to query a full backup file to determine ...
8
votes
3answers
7k views

Capturing datetime of change in SQL Server CDC

So we've started exploring using change data capture on one of our production databases. We'd like to know the datetime of each change. Reading through walkthrough's and tutorials etc it seems that ...
7
votes
5answers
15k views

Does MySQL have a version of Change Data Capture?

We're in the process of phasing out an old system and migrating onto a new one. The last time that we phased out an old system, we ran both systems in parallel and integrated data between both until ...
7
votes
1answer
1k views

In Change Data Capture (CDC), why lsn is used instead of timestamp?

I am learning to use CDC in SQL server 2008, I have read that LSN is always incremented and is based upon timestamp, so why LSN is required, if it is calculated from timestamp which can be used as ...
7
votes
2answers
4k views

Can CDC or Change Tracking be against a read only secondary?

We will be deploying SQL Server 2012 Availability Groups with read only secondaries and would like to execute our SSIS extracts against the secondary while utilizing CDC or change tracking (the ...
7
votes
1answer
4k views

CDC Capture job failure/CT table column changes after applying 2014 SP2+CU4

We had an issue with CDC where the capture job failed and wouldn't restart itself. It was in a DEV environment so no harm but has anyone seen these errors or know what exactly went wrong with CDC? ...
7
votes
1answer
6k views

SQL Server 2016: Temporal table performance vs. Triggers and CDC

It seems to be quite difficult to find comparisons between system-versioned temporal tables and the older options, such as DB triggers and CDC. I currently don't have the time to write an extended ...
7
votes
2answers
2k views

What tables are affected by Change Data Capture

We're looking at using Change Data Capture in SQL 2012. We're trying to work out if there is an easy way to find out what tables have been changed by a given lsn. Is there an inbuilt function, or ...
7
votes
1answer
269 views

Capturing change deltas when database replication or CDC breaks

The company I work for is in the process of implementing change data capture on a Microsoft BI stack for the purpose of capturing incremental changes that need to be loaded into the data warehouse. So ...
6
votes
1answer
3k views

CDC system tables missing from backup

I am migrating a database that uses CDC from SQL Server 2008 R2 to SQL Server 2012. There are CDC-related tables under the "System Tables" branch in Object Explorer: cdc.ddl_history cdc....
6
votes
1answer
1k views

Change Tracking across several Tables

I'm looking into providing DB level change tracking within my system. I need to be able to track changes at an entity level, rather than just individual tables. Right now, we have triggers on each of ...
4
votes
2answers
3k views

Why is CDC capture failing due to a missing dbo principal

I am having a problem running the CDC change capture job against some of my test databases. The error message I'm getting is the following: Executed as user: NT AUTHORITY\NETWORK SERVICE. Cannot ...
4
votes
2answers
3k views

CDC with AlwaysOn Availability Groups

So I just recently got to enable CDC on an always on AG. While many sources claimed enabling CDC on alwaysON AG is as easy as it is on any standalone server, turns out it really isn't. As MS says here:...
4
votes
2answers
264 views

SQL Server Change Data Capture order of records

Does anybody know if change data capture functions return always data in the order of occurence?. In a CDC system is quite important to get the data modifications in the order they have been generated....
4
votes
1answer
2k views

Doing a point in time restore with CDC enabled; Possible?

I discovered this week, the hard way, that the database restore options NORECOVERY and KEEP_CDC are mutually exclusive. So, this begs the question. How do you do a database restore, keeping CDC ...
3
votes
2answers
5k views

Change Data Capture vs trigger for logging changes

I am going to create history table which is populated by trigger (after insert, update, delete). As only 20% of the columns are going to be updated, I decided to log only the changed values - if the ...
3
votes
3answers
3k views

Does Change Data Capture (CDC) work in a SQL Server 2012 AlwaysOn Failover Cluster Instances setup?

Does Change Data Capture (CDC) work in a SQL Server 2012 AlwaysOn Failover Cluster Instances setup? There would be two nodes in the AlwaysOn Failover Cluster Instances setup and two Domain ...
3
votes
1answer
2k views

Querying Change Data Capture data

I have Change Data Capture enabled and working fine. The question that I have is how do I query the data to show users what changes occurred.
3
votes
2answers
170 views

Use Netbackup 7.7 `WITH KEEP_CDC`

I'm using SQL Server Change Data Capture in a production database. To my surprise, I found that when restoring that database to a lower environment the CDC data is not kept—all the tables, functions, ...
3
votes
1answer
316 views

Change Data Capture Use Case?

I'm working on a custom application that needs to determine changes to a particular column, on particular rows in our database (MS SQL 2008R2). When the row is created a created & modify ...
3
votes
1answer
527 views

Change Data Capture not running when Mirror is Suspended

We have 2 SQL 2012 SP2 Enterprise servers that have some mirrored databases. One of these databases also has CDC enabled on a number of tables so that we can run some business logic when there are ...
3
votes
0answers
723 views

Msg 22830 level 16 on sp_cdc_enable_db_internal - could not update metadata that indicates database is enabled for Change Data Capture

I'm attempting to create an MCVE for this recent question. SQL Server is returning an error when attempting to update the system tables in master to indicate CDC is enabled for my test database. ...
3
votes
1answer
889 views

Automatically detect table name in MSSQL Server database using stored function

I'm working on implementing Change Data Tracking in a SQL Server database and I set up a single table to test changes. In the past, changes have been made manually, but I'd like to create a way to ...
2
votes
1answer
970 views

Sql Server 2012 Change Data Capture weird behaviour

In my Sql Server 2012 I have the following table in a database CREATE TABLE [dbo].[HumanResource]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](50) NOT NULL, [IsHired] [bit] NULL,...
2
votes
2answers
5k views

How to retrieve the Capture Instance for a given table?

Working with SQL Server 2012, I have a hierarchical table layout (TPT). All tables "inherit" from the same base table (dbo.DataObjects). All tables have history tracking via CDC enabled. I am trying ...
2
votes
2answers
576 views

Using Change Data Capture with a frequently changing schema

We are following an agile development process, which in this case means that we frequently make changes to the database schema, e.g. adding new columns, moving data to other columns, etc. Is there a ...
2
votes
1answer
79 views

Which are the downsides of not deleting the CDC records in change tables?

If I do something like this: USE AdventureWorks2012; GO EXECUTE sys.sp_cdc_change_job @job_type = N'cleanup', @retention = 52494800; -- (100 years) GO The records in the change ...
2
votes
2answers
2k views

Best way to capture historical changes between levels in a dimensional hierarchy

What is the cleanest way to capture changes between levels in a dimensional hierarchy? I have the dimensional hierarchy [Area] > [Region] > [Location], where Area is the parent to Region and Region ...
2
votes
1answer
1k views

Incremental extract strategy using SSIS and CDC

I'm looking for a strategy for extracting data from a SQL Server database that is configured for change data capture (CDC) using SSIS. Most of the documentation I have seen around using CDC and SSIS ...
2
votes
1answer
1k views

How do I add versioning to this CMS I'm designing?

As you can see, my CMS consists of several widgets (for example an Articles widget), of which you can create several instances, which I call blocks, and those blocks are linked to pages and the ...
2
votes
1answer
1k views

Delayed availability of historical data when using CDC

I am using the SQL Change Data Capture feature to retrieve historical data from my tables. During testing, I noticed that when I insert/update a row and query the change data right afterwards (see my ...
2
votes
1answer
2k views

Monitoring CDC (Change Data Capture) performance

We currently have in place CDC, DW team is reading data, everyone happy. Then we needed to add couple new columns. Easy peasy following this answer... well, actually we had some hiccups but that's ...
2
votes
1answer
399 views

Cannot disable CDC - sp_cdc_disable_db_internal gives error 8152: 'String or binary data would be truncated'?

Trying to disable CDC and getting this error: Msg 22831, Level 16, State 1, Procedure sp_cdc_disable_db_internal, Line 264 Could not update the metadata that indicates database … is not enabled ...
2
votes
1answer
170 views

How to make cdc skip the point that it is stuck at?

I have an issue where the transnational log has grown to its max size. Running fn_dblog I noticed that its complaining that a drop was done. It looks like cdc is stuck there. The description column in ...
2
votes
2answers
3k views

CDC vs replication vs anything else

In my product we need to create a solution for the reporting team to extract and process the data. We need to send them incremental data changes from our DB. I am evaluating various solutions. Looked ...
2
votes
1answer
883 views

Change Data Capture missing changes for a specific record

I have enabled CDC in SQL Server and it generally works well but sometimes the changes are not recorded for some reason. And only for a couple of records. But then if I issue an UPDATE from SSMS, the ...
2
votes
1answer
3k views

In Change Data Capture (CDC), how to configure retention with success?

We have CDC enabled on SQL Server 2008 with retention re-configured to a number other than the default 3 days (or something similar). When we first configured it (with default options), it worked ...
2
votes
0answers
9 views

Is there a reliable way to determine the order in which Postgres transactions were committed without logical decoding?

Is there a reliable way to determine the serial order in which Postgres transactions were committed without logical decoding? From what I understand pg_xact_commit_timestamp can’t necessarily be ...
2
votes
0answers
16 views

How can I seed all the rows through CDC

We want to add a Kafka stream to publish changes to a table. The stream will be populated through the bin log and Atunity CDC. How do I seed the change data with the initial state of the table?
2
votes
1answer
47 views

How can I SELECT an 'instance' in PostgreSQL?

I am reading a paper called "Real Time Delta Extraction Based on Triggers to Support Data Warehousing" from the IEEE and they proposed the following code: CREATE TRIGGER cdc_table ON db.table AS ...
2
votes
0answers
515 views

SQL Server 2012 CDC not working on certain tables only

I am using SQL 2012 sp3. I have CDC working on many tables and DBs without issue. Last night a change was put into the system and 2 of my CDC'd tables were dropped and modified without properly ...
2
votes
0answers
614 views

CDC capture job failing due to trigger execution error apparently

I'm using Change Data Capture(CDC) to track DML changes that are being performed on my SQL Server Tables. However, the capture job is failing post a DDL alteration, with the following error: Msg 3616,...
2
votes
0answers
514 views

Any way to ensure that Change Data Capture clean up process does not delete the change data that you haven't processed yet?

I'm using CDC feature to track changes that are being made, since the cleanup period is set to 3 days by default, I have to run jobs to archive this change data from the CDC system tables to my tables....
2
votes
0answers
140 views

Options for copying data out of continuously updating tables

I work with a pretty large (O(10^1) TB) DB2 (LUW, v. 9.7) database. It's got data coming in on a continuous basis via Golden Gate replication from another DB2 database. It's used for business ...
2
votes
1answer
1k views

Can you use CDC on a subscriber for transactional replicaiton [closed]

Is there a way with SQL Server to have a limited number of tables replicated to another server using transactional replication and then use CDC or Change Tracking ONLY in the server replicated to?
1
vote
2answers
566 views

What is the impact on a running database when OS date is changed and set to past

My SAP back end db is db2. Need to understand the impact on this running database (db2 under HPUX) if I change the OS date and set it to a past date please. Thanks.