Skip to content

Commit e347173

Browse files
Merge pull request #28362 from MikeRayMSFT/202208_cdcfix_squash
Move Azure CDC content to dedicated article
2 parents 36ecb07 + a55f0f5 commit e347173

11 files changed

Lines changed: 574 additions & 152 deletions

azure-sql/database/change-data-capture-overview.md

Lines changed: 404 additions & 0 deletions
Large diffs are not rendered by default.
35.4 KB
Loading
17.6 KB
Loading

azure-sql/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@
384384
href: database/logical-servers.md
385385
- name: Serverless
386386
href: database/serverless-tier-overview.md
387+
387388
- name: Hyperscale
388389
items:
389390
- name: Overview
@@ -835,6 +836,8 @@
835836
href: database/replication-to-sql-database.md
836837
- name: Replicate schema changes (Data sync)
837838
href: database/sql-data-sync-update-sync-schema.md
839+
- name: Change data capture (CDC)
840+
href: database/change-data-capture-overview.md
838841
- name: Database sharding
839842
items:
840843
- name: Upgrade client library

docs/relational-databases/track-changes/about-change-data-capture-sql-server.md

Lines changed: 79 additions & 140 deletions
Large diffs are not rendered by default.

docs/relational-databases/track-changes/change-data-capture-and-other-sql-server-features.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: "Change data capture and Other Features"
33
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"
77
ms.service: sql
88
ms.topic: conceptual
99
helpviewer_keywords:
@@ -12,7 +12,7 @@ helpviewer_keywords:
1212
# Change data capture and other features
1313
[!INCLUDE [SQL Server - ASDBMI](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
1414

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:
1616

1717
## <a name="ChangeTracking"></a> Change tracking
1818
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 &#40;SQL Server&#41;](../../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
3838
> [!NOTE]
3939
> 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.
4040
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.
4242

4343
## <a name="RestoreOrAttach"></a> Database restore or attach
4444
[!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
6060
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).
6161

6262
## <a name="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).
6464

6565
## <a name="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.
6767

6868
## <a name="AlwaysOn"></a> Availability groups
6969

7070
When you use Always On availability groups, change enumeration should be done on the secondary replica to reduce disk load on the primary.
7171

7272
## <a name="FailoverAzureSQLDB"></a> Failover (local & GeoDR) in Azure SQL Database
7373

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.
7575

7676
## <a name="Point-in-time-restore"></a> Point-in-time-restore (PITR) in Azure SQL Database
7777

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.
7979

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).
8181

8282
## <a name="AzureActiveDirectory"></a> Azure Active Directory in Azure SQL Database
8383

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.
8585

8686
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.
8787

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: "Known issues and limitations"
3+
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)
-12 KB
Binary file not shown.
41.8 KB
Loading
20.5 KB
Loading

0 commit comments

Comments
 (0)