简体   繁体   English

需要帮助以在 SQL 服务器上启用变更数据捕获 (CDC)

[英]Need help to enable Change Data Capture (CDC) on SQL Server

I'm looking to enable change data capture on a SQL Server Database.我希望在 SQL 服务器数据库上启用更改数据捕获。

Version: Microsoft SQL Azure (RTM) - 12.0.2000.8 Apr 9 2020 16:39:55 Copyright (C) 2019 Microsoft Corporation版本:Microsoft SQL Azure (RTM) - 12.0.2000.8 Apr 9 2020 16:39:55 版权所有 (C) 2019 Microsoft Corporation

Used below command to check if the CDC is enabled on the db and it returned '0'使用下面的命令来检查 CDC 是否在 db 上启用并返回“0”

SELECT is_cdc_enabled FROM sys.databases WHERE name = 'XXXX'; SELECT is_cdc_enabled FROM sys.databases WHERE name = 'XXXX';

Tried to enable the CDC at the database level by issuing below command..尝试通过发出以下命令在数据库级别启用 CDC..

EXEC sys.sp_cdc_enable_db执行 sys.sp_cdc_enable_db

It returned below error message Msg 22830, Level 16, State 1, Procedure sys.sp_cdc_enable_db_internal, Line 198 [Batch Start Line 4] Could not update the metadata that indicates database XXXX is enabled for Change Data Capture.它返回以下错误消息 Msg 22830, Level 16, State 1, Procedure sys.sp_cdc_enable_db_internal, Line 198 [Batch Start Line 4] 无法更新指示数据库 XXXX 已启用更改数据捕获的元数据。 The failure occurred when executing the command 'SetCDCTracked(Value = 1)'.执行命令“SetCDCTracked(Value = 1)”时发生故障。 The error returned was 22845: 'Cannot enable change data capture in this edition of SQL Server.'.返回的错误为 22845:“无法在此版本的 SQL 服务器中启用更改数据捕获。”。 Use the action and error to determine the cause of the failure and resubmit the request.使用操作和错误来确定失败的原因并重新提交请求。

Now my question is- do I need admin privileges to enabled CDC or is this feature not available with Azure SQL server version?现在我的问题是 - 我需要管理员权限才能启用 CDC,还是 Azure SQL 服务器版本不提供此功能? Thanks for reading and your help is appreciated.感谢您的阅读,感谢您的帮助。

Please reference this document: Enable and Disable Change Data Capture (SQL Server)请参考此文档: 启用和禁用更改数据捕获 (SQL Server)

在此处输入图像描述

The feature only support Azure SQL managed instance.该功能仅支持 Azure SQL 托管实例。 For Azure SQL database, wen can not Enable and Disable Change Data Capture.对于 Azure SQL 数据库,无法启用和禁用更改数据捕获。

Hope this helps.希望这可以帮助。

CDC is now Available for Azure SQL Databases CDC 现在可用于 Azure SQL 数据库SQL CDC 微软

I can't enable in my database.我无法在我的数据库中启用。 Does it have something to do with the Tier that is Standard?它与标准层有关吗? Gives this error: The database 'DataBaseFoo' is not enabled for Change Data Capture.给出此错误:没有为更改数据捕获启用数据库“DataBaseFoo”。 Ensure that the correct database context is set and retry the operation.确保设置了正确的数据库上下文并重试该操作。 To report on the databases enabled for Change Data Capture, query the is_cdc_enabled column in the sys.databases catalog view.要报告为更改数据捕获启用的数据库,请查询 sys.databases 目录视图中的 is_cdc_enabled 列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Debezium更改数据捕获(CDC)在SQL Server 2017上不起作用 - Debezium Change Data Capture (CDC) not working on sql-server 2017 SQL依赖与变更数据捕获(CDC) - SQL Dependency vs Change Data Capture (CDC) 有没有办法同时使用 SQL Server 2019 和 CDC(变更数据捕获)? - Is there a way to use SQL Server 2019 and CDC (Change Data Capture) at the same time? 在哪些Sql Server产品级别上可以使用更改数据捕获(CDC)功能? - on what Sql Server product levels the Change Data Capture (CDC) feature is available? SQL Server CDC(更改数据捕获)仅用于表数据更改吗? 我可以使用它来跟踪过程或其他类型的对象更改吗? - SQL Server CDC(change data capture) is used just for table data change? Can I use it to track procedure or other types of objects change? 更改数据捕获 (CDC) SSIS 不起作用 - Change data capture (CDC) SSIS not working 如何存储更改数据(CDC)SQL Server 2012 - How to store change data (CDC) SQL Server 2012 更改数据捕获 - SQL SERVER? - Change Data Capture - SQL SERVER? 在 CHANGE DATA CAPTURE (CDC) 中如何捕获时间戳 - In CHANGE DATA CAPTURE (CDC) how can capture timestamp SQL Server更改数据捕获-捕获进行更改的用户 - SQL Server Change Data Capture - Capture user who made the change
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM