启用 SQL Server 上的 CDC。

huangapple go评论54阅读模式
英文:

Enable CDC on SQL Server

问题

我正在尝试通过运行命令 EXEC sys.sp_cdc_enable_db 在 SQL Server 上启用 CDC,但我一直收到以下消息:

无法更新指示数据库 X 已启用 Change Data Capture 的元数据。故障发生在执行命令 'create user cdc' 时。

返回的错误代码是 15562:'正在执行的模块未受信任。数据库的所有者或模块的所有者需要被授予身份验证权限,或者模块需要进行数字签名。' 请使用操作和错误信息确定故障的原因,然后重新提交请求。

我尝试过添加和移除 sa 作为 db_owner;我尝试手动创建 cdc 用户,但都没有效果。

我还能尝试什么?

英文:

I am trying to enable CDC on SQL Server by running the command EXEC sys.sp_cdc_enable_db but I keep getting the message:

Could not update the metadata that indicates database X is enabled for Change Data Capture.
The failure occurred when executing the command 'create user cdc'.

The error returned was 15562: 'The module being executed is not trusted. Either the owner of the database of the module needs to be granted authenticate permission, or the module needs to be digitally signed.'. Use the action and error to determine the cause of the failure and resubmit the request.

I've tried adding and removing sa as db_onwer; I've tried to create cdc user manually, but nothing works.

What else could I try?

答案1

得分: 1

我遇到了相同的问题。我发现这与我们在数据库上的一个触发器有关。禁用了触发器后,问题解决了。这是在这里的评论中得到的提示:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/31e1c9c4-a15d-4f38-ab59-2bb0851e7d63/unable-to-enable-a-database-for-cdc?forum=sqlreplication

英文:

I had the same issue. I found it was related to a database trigger we had on the DB. Disabled the trigger and it worked. Was tipped off by comments here:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/31e1c9c4-a15d-4f38-ab59-2bb0851e7d63/unable-to-enable-a-database-for-cdc?forum=sqlreplication

huangapple
  • 本文由 发表于 2023年4月7日 00:24:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/75951714.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定