[英]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.希望这可以帮助。
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.