• SSIS CDC(Change Data Capture)组件在数据库中启用报错。 The error returned was 14234: 'The specified '@server' is invalid


    昨天实验CDC,在数据库中执行以下语句的时候出错。

    EXEC sys.sp_cdc_enable_table
      @source_schema = N'stg',
      @source_name = N'CDCSalesOrderHeader',
      @role_name = N'cdc_role',
      @supports_net_changes = 1;
    
    
    Msg 22832, Level 16, State 1, Procedure sp_cdc_enable_table_internal, Line 623
    Could not update the metadata that indicates table [stg].[CDCSalesOrderHeader] is enabled for Change Data Capture. The failure occurred when executing the command '[sys].[sp_cdc_add_job] @job_type = N'capture''. The error returned was 22836: 'Could not update the metadata for database TK463DW to indicate that a Change Data Capture job has been added. The failure occurred when executing the command 'sp_add_jobstep_internal'. The error returned was 14234: 'The specified '@server' is invalid (valid values are returned by sp_helpserver).'. Use the action and error to determine the cause of the failure and resubmit the request.'. Use the action and error to determine the cause of the failure and resubmit the request.


    一开始看到一个方案,把数据库的owner改为SA。执行以后无效。

    EXEC sp_changedbowner 'sa'

    根据下面错误又查了一下,才发现是因为我改了计算机名字,导致数据库中的实例名不一样。

    The error returned was 14234: 'The specified '@server' is invalid (valid values are returned by sp_helpserver)

    处理步骤:

     1.执行sp_helpserver查看当前实例清单

    EXEC sp_helpserver 

    2. 使用sp_addserver 添加实例名

    EXEC sp_addserver 'WIN2K8SQL2K8'

    sp_addserver 在SQL Server 2012 中已经淘汰,需要改用sp_addlinkedserver

    EXEC sp_addlinkedserver 'WIN2K8SQL2K8','SQL Server'

    3. 再次执行CDC代码即可

    参考文档

    #0164-SQL Server 2012-Discontinued Features-sp_addserver-Remote server registration-Msg: 15663

  • 相关阅读:
    dljd_(004_005)_jdbc编程步骤
    dljd_003_jdbc编程_概述
    dljd_002_通过接口降低代码的耦合度(2)
    dljd_001_通过接口降低代码的耦合度(1)
    dljd_(002-003)_什么是持久化
    dljd_001_由hibernate名称引出的相关知识
    001_学习26个英文字母
    06_dljd_mysql数据库常用操作
    05_dljd_mysql数据库表的介绍
    【数据结构】树状数组(简单名次树)
  • 原文地址:https://www.cnblogs.com/haseo/p/4261577.html
Copyright © 2020-2023  润新知