暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

SQLServer复制中数据冲突解决方法

原创 翰粱 2023-12-29
194

---disDB 哪此表:

select * from MSarticles ;

--reply history:

select * from MSdistribution_history;

select *   FROM [distribution_CarsemERP].[dbo].[MSreplication_monitordata];

---ERROR内容

select *   FROM [dbo].[MSrepl_errors] where time>GETDATE()-1 order by id desc;

 

---处理的事务内容:

 

select * from distribution..MSdistribution_history

where time> dateadd(HH,-2,GETDATE()) --getdate()-1

order by time desc;

 

-- Error details or message of the solected session:

--=========================================================================

select *    FROM [distribution]..MSlogreader_agents

 

use [master]

exec [distribution]..sp_MSenum_distribution_s

@name = N'CSZS141\SZERPSVR-CarsemERP-Pub_Erp141-CSZS308\ERPREPORT-9',

@hours = -4,

@session_type = 1

 

 

use distribution

go

sp_browsereplcmds '0x0027D1070000A2A5002E00000000' ,'0x0027D1070000A2A5002E00000000'

 

DECLARE @article_id int

SET @article_id = 6

 

SELECT * FROM  MSarticles WHERE article_id=@article_id

 

{CALL [dbo].[sp_MSupd_dboSSR_FG_Integration] (,,'Y',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'20231215-41151736',0x04000000000000000000000000000000)}

{CALL [dbo].[sp_MSupd_dboSSR_FG_Integration] (,,'Y',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'20231215-41151737',0x04000000000000000000000000000000)}

{CALL [dbo].[sp_MSupd_dboSSR_FG_Integration] (,,'Y',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'20231215-41151738',0x04000000000000000000000000000000)}

{CALL [dbo].[sp_MSupd_dboSSR_FG_Integration] (,,'Y',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'20231215-41152010',0x04000000000000000000000000000000)}

{CALL [dbo].[sp_MSupd_dboSSR_FG_Integration] (,,'Y',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'20231215-41152041',0x04000000000000000000000000000000)}

 

 

select  DATEDIFF(SS,(select max(lastrefresh)from distribution..[MSreplication_monitordata]

    where agent_name='CSZS141\SZERPSVR-CarsemERP-Pub_Erp141-1'

  ),last_distsync )diff,

publisher,publication,agent_name,lastrefresh,last_distsync,retention,time_stamp ,

 computetime,warning,agentstoptime,distdb,publisher_db

from  distribution..[MSreplication_monitordata]

--where agent_name like'%CSZSV002%'

order by time_stamp desc;

 

以下错误:

76        2023-12-19 13:01:02.790        Invalid object name 'MSreplication_subscriptions'.        0x0027DE3A000038A8013400000000

76        2023-12-19 13:01:02.793        if @@trancount > 0 rollback tran        0x0027DE3A000038A8013400000000

表示:订阅端,出现数据rollback了,数据不一致,订阅端手动写入数据缺少的数据。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论