SQL Server synchronous replication troubleshooting method, SQL Server

Source: Internet
Author: User

SQL Server synchronous replication troubleshooting method, SQL Server

1. the row cannot be found on the subscription server when the command copied by the application is run.


Solution: Use System stored proceduresSp_browsereplcmds(Return the result set of the readable version Copy command stored in the distribution database and use it as a diagnostic tool. This stored procedure is executed on the distribution server for the distribution database)

sp_browsereplcmds [ [ @xact_seqno_start = ] 'xact_seqno_start' ]    [ , [ @xact_seqno_end = ] 'xact_seqno_end' ]     [ , [ @originator_id = ] 'originator_id' ]    [ , [ @publisher_database_id = ] 'publisher_database_id' ]    [ , [ @article_id = ] 'article_id' ]    [ , [ @command_id= ] command_id ]    [ , [ @agent_id = ] agent_id ]    [ , [ @compatibility_level = ] compatibility_level ]
Troubleshooting: distribution DB (distribution) on the distribution server)

Use [distribution] go -- a, general transaction serial number, find the execution statement EXEC sp_browsereplcmds @ xact_seqno_start = '0x00044ed500008f3e00ab000000000000' for command_id = 1 ', @ xact_seqno_end = '0x00044ed500008f3e00ab00000000 '-- view the synchronization object table (locate the article_id field value in the above result set) select * From MSarticles where article_id = 344


-- The following two situations may occur in the 1st statements (a/B)

-- A. The row cannot be found during the update.

{CALL [dbo]. [sp_MSupd_dbo table name] (...)}

-- B. The row cannot be found during deletion.

{CALL [dbo]. [sp_MSdel_dbo table name] (...}

Learn about the synchronization stored procedure:


Solution (a, update, B, delete): Add missing data rows on the subscription end (add a record based on the error ID above) or use the Import and Export method (the above ID is synchronously specified by the SQL statement ). (cause: An error occurred while deleting or updating data rows could not be found due to the lack of data lines on the subscription end)

-- C. Error in addition

{CALL [dbo]. [sp_MSins_dbo table]


Solution (c. An error occurred when adding the table): An error occurred when adding the table. The solution may be caused by the identity value, the fact that the primary key ID is already in (deleting the data row on the subscription end), or the table structure is not worth it.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.