change-data-capture

Change Data Capture or Change Tracking - Same as Traditional Audit Trail Table?

折月煮酒 提交于 2019-12-30 08:08:02
问题 Before I delve into the abyss of Microsoft documentation any deeper, I'd like to know if someone experienced with Change Data Capture and Change Tracking know if one or both of these can be used to replace the traditional ... "Audit trail table copy of the 'real table' (all of the fields of the original table, plus date/time, user ID, and DML action field) inserted into by Triggers" ... setup for a database table audit trail, where the trigger populates the audit trail table (which is all

How the cdc retention value can be changed for the cleanup job?

て烟熏妆下的殇ゞ 提交于 2019-12-21 07:45:04
问题 I'm implementing a logging feature on a asp.net mvc2 application, that uses SqlServer2008 as a database and Entity Framework as a data model. I enabled CDC feature of SqlServer and it's logging changes well, but I just noticed that some of the old logging data is erased. Does anyone know what's default period CDC keeps records, and does anyone know how could I set it to indefinite value. 回答1: I just discovered that the default retention value is 4320 minutes = 72 hours = 3 days. It should be

How the cdc retention value can be changed for the cleanup job?

北城以北 提交于 2019-12-21 07:44:02
问题 I'm implementing a logging feature on a asp.net mvc2 application, that uses SqlServer2008 as a database and Entity Framework as a data model. I enabled CDC feature of SqlServer and it's logging changes well, but I just noticed that some of the old logging data is erased. Does anyone know what's default period CDC keeps records, and does anyone know how could I set it to indefinite value. 回答1: I just discovered that the default retention value is 4320 minutes = 72 hours = 3 days. It should be

Updating Elastic Search index when SQL Server table changes

梦想的初衷 提交于 2019-12-13 04:56:33
问题 What is the best way to know when an Elastic Search index needs updating, assuming the upstream data source is transactional SQL Server tables with inserts, updates and deletes? Examples: Tables Parent, Child, Grandchild. Parent | Child | Grandchild ID Name | ID ParentID Name | ID ChildID Amount 1 Foo | 10 1 Bike | 100 10 5 2 Bar | 20 1 Car | 200 20 2 3 Baz | 30 3 Tran | 300 30 1 Grandchild is updated, and Elastic Search index on Parent needs to be updated for the associated record. So, on

Error while executing change data capture sql query

ε祈祈猫儿з 提交于 2019-12-13 01:55:19
问题 I am getting this error "An insufficient number of arguments were supplied for the procedure or function cdc.fn_cdc_get_all_changes_" while trying to execute the following sql query. use SpatialDB go declare @begin_time datetime, @end_time datetime, @from_lsn binary(10), @to_lsn binary(10); set @begin_time=GETDATE()-1; set @end_time=GETDATE(); set @from_lsn=sys.fn_cdc_map_time_to_lsn('smallest greater than or equal', @begin_time); set @to_lsn=sys.fn_cdc_map_time_to_lsn('largest greater than

CDC table not working after adding new columns to the source table

╄→尐↘猪︶ㄣ 提交于 2019-12-04 22:26:54
问题 Two new columns were added to our source table while CDC was still enabled on the table. I need the new columns to appear in the CDC table but do not know what procedure should be followed to do this? I have already disabled CDC on the table, disabled CDC on the DB, added the new columns to the cdc.captured_columns table, and enabled CDC. But now I am getting no data in the CDC table! Is there some other CDC table that must be updated after columns are added to the source table? These are all

CDC is enabled, but cdc.dbo<table-name>_CT table is not being populated

无人久伴 提交于 2019-12-04 10:20:45
I have enabled CDC using the following steps: exec sys.sp_cdc_enable_db; exec sys.sp_cdc_enable_table @source_schema = N'dbo', @source_name = N'table_name', @role_name = N'CDC_Access', @supports_net_changes = 1; I can see that a CT table has been created in the System Tables ; SQL Server Agent is on, and I can see the cdc.db_name_capture job has been created and is running. However, even though the table_name table is being populated, I never see anything in the CT table. I have other tables that have CDC enabled for them in the same database which are being updated, and CDC is capturing data

Is Change Data Capture Performance Loss Restricted to CDC Enabled Tables?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 08:32:07
问题 I have read that enabling Change Data Capture obviously has an impact on database performance. Would this performance loss only effect the tables that have CDC enabled or would it effect all actions across the database In my situation I am using SSIS and have a large amount of data moving into and out of a staging database. I also have some lookup tables in the system that are used for transforms. I am hoping to use CDC as a means to audit changes to these reference tables only (not the

How the cdc retention value can be changed for the cleanup job?

末鹿安然 提交于 2019-12-04 00:07:49
I'm implementing a logging feature on a asp.net mvc2 application, that uses SqlServer2008 as a database and Entity Framework as a data model. I enabled CDC feature of SqlServer and it's logging changes well, but I just noticed that some of the old logging data is erased. Does anyone know what's default period CDC keeps records, and does anyone know how could I set it to indefinite value. I just discovered that the default retention value is 4320 minutes = 72 hours = 3 days. It should be configurable by using sp_cdc_change_job @job_type='cleanup', @retention=minutes The maximum value is

CDC table not working after adding new columns to the source table

≡放荡痞女 提交于 2019-12-03 14:49:28
Two new columns were added to our source table while CDC was still enabled on the table. I need the new columns to appear in the CDC table but do not know what procedure should be followed to do this? I have already disabled CDC on the table, disabled CDC on the DB, added the new columns to the cdc.captured_columns table, and enabled CDC. But now I am getting no data in the CDC table! Is there some other CDC table that must be updated after columns are added to the source table? These are all the CDC tables under the System Tables folder: cdc.captured_columns <----- where I added the new