SQLServerWiki

“The Only Thing That Is Constant Is Change”

Quick and easy Script to collect Merge Replication Agent History tables.

Posted by database-wiki on April 11, 2016

Problem Description:
Quick and easy way to collect Merge Replication Agent History tables for SQL 2005.

Resolution:
–Create database to hold a copy of the Agent history tables
Create Database MergeAgentHistory
Go

Select * Into MergeAgentHistory.dbo.MSMerge_history
from distribution.dbo.MSMerge_history
Go

Select * Into MergeAgentHistory.dbo.MSmerge_sessions
from distribution.dbo.MSmerge_sessions
Go

Select * Into MergeAgentHistory.dbo.MSmerge_articlehistory
from distribution.dbo.MSmerge_articlehistory
Go

Select * Into MergeAgentHistory.dbo.MSmerge_agents
from distribution.dbo.MSmerge_agents
Go

Select * Into MergeAgentHistory.dbo.MSrepl_errors
from distribution.dbo.MSrepl_errors
Go

–Backup Database
Backup Database MergeAgentHistory
To disk=’c:\temp\MergeAgentHistory.bak’
Go

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: