SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Script to review replications

This script is from my library and I use it to review what is going on with my transactional replications, try to remove statements that didn't get purged for whatever reason. This is my last resource before getting the need to reinitialize or drop and recreate my publications.

use distribution
go

/*Query to get your articleID*/
select top 100 * from Distribution.dbo.MSarticles


/*Use this when you have the xac_seqno that is failing or your last that was replicated*/
select * from MSrepl_commands Where xact_seqno >= 0x0005AEF70000004A000900000000

/*use this to review your errors*/
select
*
From MSrepl_errors

/*use this to list the commands to be replicated*/
sp_browsereplcmds '0x0005AEF70000004A000900000000', '0x0005AEF70000004A000900000000'

/*Once that you have the commands to be deleted, add them inside the IN*/
DELETE from MSrepl_commands where command_id=1 and xact_seqno in (0x0005ADE2000001E00009)
and [command] like '%MSins%'

SQLDbaInternals

Christian lives in Guatemala. He has worked with Databases for about 12 years, at the beginning as a software developer and for the last 10 years as DBA. His expertise areas are Database migration, Performance tuning, Security of SQL Server and Designing and Implementing HA and DR environments. He has worked with SQL Server since version 2000. Passionate about SQL Server, Azure and joining to the Online SQL Server community. You can always find him on Twitter (@charaujo).

Comments

Leave a comment on the original post [sqldbagt.blogspot.com, opens in a new window]

Loading comments...