You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/relational-databases/track-changes/change-data-capture-and-other-sql-server-features.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
2
title: "Change data capture and Other Features"
3
3
description: "Learn how change data capture and functions with other features such as change tracking and database mirroring."
4
-
author: MikeRayMSFT
5
-
ms.author: mikeray
6
-
ms.date: "01/02/2019"
4
+
author: croblesm
5
+
ms.author: roblescarlos
6
+
ms.date: "09/11/2023"
7
7
ms.service: sql
8
8
ms.topic: conceptual
9
9
helpviewer_keywords:
@@ -12,7 +12,7 @@ helpviewer_keywords:
12
12
# Change data capture and other features
13
13
[!INCLUDE [SQL Server - ASDBMI](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
14
14
15
-
This topic describes how the following features interact with change data capture:
15
+
This article describes how the following features interact with change data capture:
16
16
17
17
## <aname="ChangeTracking"></a> Change tracking
18
18
Change data capture and [change tracking](../../relational-databases/track-changes/about-change-tracking-sql-server.md) can be enabled on the same database. No special considerations are required. For more information, see [Work with Change Tracking (SQL Server)](../../relational-databases/track-changes/work-with-change-tracking-sql-server.md).
@@ -38,7 +38,7 @@ This topic describes how the following features interact with change data captur
38
38
> [!NOTE]
39
39
> When the Log Reader Agent is used for both change data capture and transactional replication, replicated changes are first written to the distribution database. Then, captured changes are written to the change tables. Both operations are committed together. If there is any latency in writing to the distribution database, there will be a corresponding latency before changes appear in the change tables.
40
40
41
-
The **proc exec** option of transactional replication is not available when change data capture is enabled.
41
+
The **proc exec** option of transactional replication isn't available when change data capture is enabled.
42
42
43
43
## <aname="RestoreOrAttach"></a> Database restore or attach
44
44
[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] uses the following logic to determine if change data capture remains enabled after a database is restored or attached:
@@ -60,28 +60,28 @@ This topic describes how the following features interact with change data captur
60
60
After restoring a database on Azure SQL Managed Instance, CDC will remain enabled, but you must ensure that the scan and cleanup jobs are added and running. You can manually add the jobs by running [sys.sp_cdc_add_job](../system-stored-procedures/sys-sp-cdc-add-job-transact-sql.md).
61
61
62
62
## <aname="Contained"></a> Contained databases
63
-
Change data capture is not supported in [contained databases](../../relational-databases/databases/contained-databases.md).
63
+
Change data capture isn't supported in [contained databases](../../relational-databases/databases/contained-databases.md).
64
64
65
65
## <aname="Serverless"></a> Serverless databases
66
-
If a serverless database is enabled for Change Data Capture (CDC) is in pause state, CDC will not run. The CDC scan shall not affect auto-pause.
66
+
If a serverless database is enabled for Change Data Capture (CDC) is in pause state, CDC won't run. The CDC scan shall not affect autopause.
67
67
68
68
## <aname="AlwaysOn"></a> Availability groups
69
69
70
70
When you use Always On availability groups, change enumeration should be done on the secondary replica to reduce disk load on the primary.
71
71
72
72
## <aname="FailoverAzureSQLDB"></a> Failover (local & GeoDR) in Azure SQL Database
73
73
74
-
In case of local as well as GeoDR failover scenarios, if the database is enabled for change data capture (CDC), capture and cleanup happen automatically on the new primary, following the failover.
74
+
In case of local and GeoDR failover scenarios, if the database is enabled for change data capture (CDC), capture and cleanup happen automatically on the new primary, following the failover.
75
75
76
76
## <aname="Point-in-time-restore"></a> Point-in-time-restore (PITR) in Azure SQL Database
77
77
78
-
If you enabled change data capture (CDC) on your Azure SQL Database as SQL user, point-in-time-restore (PITR) retains the CDC as well in the restored DB, unless it is restored to sub-core SLO. If restored to sub-core SLO, CDC artifacts will not be available.
78
+
If you enabled change data capture (CDC) on your Azure SQL Database as SQL user, point-in-time-restore (PITR) retains the CDC as well in the restored DB, unless it's restored to subcore SLO. If restored to subcore SLO, CDC artifacts won't be available.
79
79
80
-
If you enabled CDC on your Azure SQL Database as an Azure AD user, PITR retains the CDC if restored to same or higher SLO than the source database. PITR to sub-core SLO will fail as mentioned under [known limitations and issues](./about-change-data-capture-sql-server.md?#known-limitations-and-issues).
80
+
If you enabled CDC on your Azure SQL Database as an Azure AD user, PITR retains the CDC if restored to same or higher SLO than the source database. PITR to subcore SLO fails as mentioned under [Known issues and limitations](/azure/azure-sql/database/change-data-capture-overview#known-issues-and-limitations).
81
81
82
82
## <aname="AzureActiveDirectory"></a> Azure Active Directory in Azure SQL Database
83
83
84
-
If you create a database in Azure SQL Database as an Azure AD user and enable change data capture on it, a SQL user (e.g. even sys admin role) will not be able to disable/make changes to change data capture artifacts. However, another Azure AD user will be able to enable/disable change data capture on the same database.
84
+
If you create a database in Azure SQL Database as an Azure AD user and enable change data capture on it, a SQL user (for example, even sys admin role) won't be able to disable/make changes to change data capture artifacts. However, another Azure AD user is able to enable/disable change data capture on the same database.
85
85
86
86
Similarly, if you create an Azure SQL Database as a SQL user, enabling/disabling change data capture as an Azure AD user won't work.
description: "Known issues and limitations Change Data Capture"
4
+
author: croblesm
5
+
ms.author: roblescarlos
6
+
ms.reviewer: "mathoma"
7
+
ms.date: "09/01/2023"
8
+
ms.service: sql
9
+
ms.topic: troubleshooting
10
+
helpviewer_keywords:
11
+
- "Change data capture"
12
+
- "Known issues"
13
+
- "Limitations"
14
+
---
15
+
16
+
# Known issues and limitations
17
+
18
+
This article explains Change Data Capture (CDC) known issues and limitations with **SQL Server and Azure SQL Managed Instance**. For Azure SQL Database, see [CDC with Azure SQL Database - Known issues and limitations](/azure/azure-sql/database/change-data-capture-overview#known-issues-and-limitations).
19
+
20
+
### Aggressive log truncation
21
+
22
+
When you enable change data capture (CDC) on SQL Server, the aggressive log truncation feature of Accelerated Database Recovery (ADR) is disabled. This is because the CDC scan accesses the database transaction log. Active transactions continue to hold the transaction log truncation until the transaction commits and CDC scan catches up, or transaction aborts. This might result in the transaction log filling up more than usual and should be monitored so that the transaction log doesn't fill.
23
+
24
+
When enabling CDC, we recommend using the Resumable index option. Resumable index doesn't require to keep open a long-running transaction to create or rebuild an index, allowing log truncation during this operation and better log space management. For more information, see [Guidelines for online index operations - Resumable Index considerations](../../relational-databases/indexes/guidelines-for-online-index-operations.md#resumable-index-considerations)
25
+
26
+
### Attempt to enable CDC fails if the custom schema or user named `cdc` pre-exist in database*
27
+
28
+
When you enable CDC on a database, it creates a new schema and user named `cdc`. So, it's not recommended to manually create custom schema or user named `cdc`, as it's reserved for system use.
29
+
30
+
If you've manually defined a custom schema or user named `cdc` in your database that isn't related to CDC, the system stored procedure `sys.sp_cdc_enable_db` fails to enable CDC on the database with below error message.
31
+
32
+
> The database `<database_name>` cannot be enabled for Change Data Capture because a database user named 'cdc' or a schema named 'cdc' already exists in the current database. These objects are required exclusively by Change Data Capture. Drop or rename the user or schema and retry the operation.
33
+
34
+
To resolve this issue:
35
+
36
+
- Manually drop the empty `cdc` schema and `cdc` user. Then, CDC can be enabled successfully on the database.
37
+
38
+
### CDC fails after ALTER COLUMN to VARCHAR and VARBINARY
39
+
40
+
When the datatype of a column on a CDC-enabled table is changed from `TEXT` to `VARCHAR` or `IMAGE` to `VARBINARY` and an existing row is updated to an off-row value. After the update, the CDC scan will result in errors.
41
+
42
+
### Columnstore indexes
43
+
44
+
Change data capture can't be enabled on tables with a clustered columnstore index. Beginning with SQL Server 2016, it can be enabled on tables with a nonclustered columnstore index.
45
+
46
+
### Computed columns
47
+
48
+
CDC doesn't support the values for computed columns even if the computed column is defined as persisted. Computed columns that are included in a capture instance always have a value of `NULL`. This behavior is intended, and not a bug.
49
+
50
+
### DDL changes to source tables
51
+
52
+
Changing the size of columns of a CDC-enabled table using DDL statements can cause issues with the subsequent CDC capture process, resulting in **error 2628** or **error 8115**. Remember that data in CDC change tables are retained based on user-configured settings. So, before making any changes to column size, you must assess whether the alteration is compatible with the existing data in CDC change tables.
53
+
54
+
If the `sys.dm_cdc_errors` indicate that scans are failing due to the **error 2628** or **error 8115** for change tables, you should first consume the change data in the affected change tables. After that, you need to [disable and then reenable CDC](enable-and-disable-change-data-capture-sql-server.md) on the table to resolve the problem effectively.
55
+
56
+
### Import database using data-tier Import/Export and Extract/Publish operations
57
+
58
+
For CDC enabled SQL databases, when you use SqlPackage, SSDT, or other SQL tools to Import/Export or Extract/Publish, the `cdc` schema and user get excluded in the new database. Other CDC objects not included in Import/Export and Extract/Deploy operations include the tables marked as `is_ms_shipped=1` in sys.objects.
59
+
60
+
Even if CDC isn't enabled and you've defined a custom schema or user named `cdc` in your database that will also be excluded in Import/Export and Extract/Deploy operations to import/setup a new database.
61
+
62
+
### Linux
63
+
64
+
CDC is supported for SQL Server 2017 on Linux starting with CU18, and SQL Server 2019 on Linux.
65
+
66
+
### Partition switching with variables
67
+
68
+
Using variables with partition switching on databases or tables with change data capture (CDC) isn't supported for the `ALTER TABLE ... SWITCH TO ... PARTITION ...` statement. See [partition switching limitations](../replication/publish/replicate-partitioned-tables-and-indexes.md#replication-support-for-partition-switching) to learn more.
69
+
70
+
## Next steps
71
+
72
+
- For an overview of Change Data Capture for SQL Server, see [What is change data capture (CDC)?](/sql/relational-databases/track-changes/about-change-data-capture-sql-server)
73
+
- For more information about known issues and limitations for CDC with Azure SQL Database, see [CDC known issues and limitations with Azure SQL Database](/azure/azure-sql/database/change-data-capture-overview#known-issues-and-limitations)
74
+
- For more information on how to enable and disable CDC, see [Enable and disable change data capture](/sql/relational-databases/track-changes/enable-and-disable-change-data-capture-sql-server)
0 commit comments