How to run sp_browsereplcmds on a Distribution db backup

Share this Post

From time to time we need to restore a customer’s Distribution database to a secondary server or to a lab server for testing.  When you restore a distribution database it will not be configured to execute Replication commands such as sp_browsereplcmds.  However, there is a simple solution.  You can execute the command below to configure the restored distribution database as a “Replication Distribution” database.

sp_adddistributiondb [distribution_A]
http://msdn.microsoft.com/en-us/library/ms189755.aspx

Once configured, the restored database shows up in the Distributor properties

image

image

You can now run commands such as sp_browsereplcmds to explore data in the Distribution database


Share this Post

One thought on “How to run sp_browsereplcmds on a Distribution db backup”

  1. I've also simply casted the command column as nvarchar and returned the results in text.  Its not as clean as what Chris proposes above, but it is a bit faster:

    select top 10 CAST(command as varchar(500))as text from distribution.dbo.msrepl_commands

Leave a Reply to Jonathan (CTS) Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.