Skip to main content

Replication

Replication Monitor

The MSreplication_monitordata table in distribution database contains cached data used by Replication Monitor. So you will not get the real time details on latency, performance, etc.
image.png

Replication alerts

image.png

Undistributed commands

The number of pending commands that are yet to be applied to the subscriber by distribution agent for a transactional publication. It also provides a rough estimate of how much time it takes to process them.
image.png

Undistributed commands for each table

If you want to find undelivered commands for each table in a publication, you can get the detail from MSdistribution_status view from distribution database.
image.png
image.png

Find replication errors in error log.

image.png

Agent History

Get details about snapshot agent history

image.png

Get details about log reader agent history

image.png

Get details about distribution agent history

image.png

Agents Detail

Get details about snapshot agents

Get details about log reader agents

Get details about distribution agents

Get details about merge agents

Get details about Q-reader agents

Get details about the agent profiles

image.png

Publisher Detail

Get the publisher database details

Subscriber Detail

Get details about subscriber

Get subscription details

image.png

Get subscriber schedule details

image.png

How to regenerate the sp_MS custom stored procedures in SQL Server

If you are adding a subscription using “initialize with LSN” option when the log reader agent is stopped, the auto generated stored procs will not be generated. You can use the below script to generate it. This script will generate the below stored procedures for each of the table article that are replicated.
  • sp_MSins*
  • sp_MSupd*
  • sp_MSdel*
Once you execute, you will get the stored procedure definitions. You can just copy that and execute it in subscriber database to create the stored procedures. The generated stored procedure’s schema is based on the publisher database’s schema. Sample Output:
image.png