Readme_Subscriber Monitor Utility Merge Replication Sample

11/05/2008 21:36:06


This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005.
The Subscriber Monitor Utility sample is a Windows application that demonstrates how the Subscriber-side monitoring functionality provided by Replication Management Objects (RMO) is used to monitor merge subscriptions at the Subscriber. This sample solution can be built and run standalone at the Subscriber (using SubscriberMonitorUtility.exe). The SubscriberMonitor.dll assembly is also used by the Readme_Sales Orders Merge Replication Sample to display subscription status.

Scenario

A replication topology is generally monitored at the Publisher or Distributor. The Microsoft SQL Server Replication Monitor is the most important tool for monitoring replication, presenting a Publisher-focused view of all replication activity. For more information, see Monitoring Replication with Replication Monitor. SQL Server Management Studio provides access to Replication Monitor. However, merge replication is designed specifically to support disconnected clients. Because it is still necessary to monitor the status of a subscription, even when the Subscriber is disconnected from the Publisher, RMO provides classes that enable this Subscriber-side monitor functionality.

Languages

  • C#

Features

The Subscriber Monitor Utility sample primarily demonstrates the facilities of RMO for monitoring merge subscriptions at the Subscriber. This sample is designed to run at a server that subscribes to a merge publication.

Prerequisites

Before running this sample, make sure the following software is installed:
  • Microsoft SQL Server 2005 or later version, including the following optionally installed components:
  • SQL Server Database Engine Services (including replication)
  • Client Tools
  • AdventureWorks Sample OLTP Database. This sample database is available on the Microsoft SQL Server Samples and Community Projects page on CodePlex.
  • The SQL Server samples. These samples are available on the Microsoft SQL Server Samples and Community Projects page on CodePlex. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.
  • .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. You can obtain .NET Framework SDK free of charge. For more information, see Installing the .NET Framework Documentation.

Required Permissions

This sample uses Windows Authentication. To run the sample, your Windows account must be a member of the replmonitor fixed database role or the db_owner fixed database role on the subscription database.

Building and Configuring the Sample

To build the sample solution, you will need to do the following:
To build the Subscriber Monitor Utility sample Install the replication samples. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\. Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:sn -k SampleKey.snkNote: You can skip this step if this key was previously created for use with another sample. Navigate to the SubscriberMonitorUtility folder in the replication samples directory and open the SubscriberMonitorUtility.sln solution file in Visual Studio. The location of this folder for a default installation is C:\Program Files\Microsoft SQL Server\100\Samples\Replication\Merge\SubscriberMonitorUtility\CS. Build the solution.

Running the Sample

To run the sample, you need to navigate to the location of the built executable and run it.
To run the Subscriber Monitor Utility sample at the Subscriber Start SubscriberMonitorUtility.exe from Visual Studio or from the command prompt. In the Select Subscription to Monitor dialog box, choose an instance of SQL Server from the Local Server Name drop-down box.Select a subscription to monitor from the Available Subscriptions drop-down list box.(Optional) Click the Edit button to change subscription properties.Click Connect. Select a Merge Agent session from the Merge Sessions tree view. (Optional) Click the Refresh button to refresh the session list.

Comments

Samples are provided for educational purposes only. They have not been tested in nor are they intended to be used in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator.

See Also

Other Resources
How to: Programmatically Monitor Replication (RMO Programming) Developer InfoCenter (Replication) Using the Subscriber Monitor Sample
Help and Information
  • Getting SQL Server 2008 Assistance* © 2008 Microsoft Corporation. All rights reserved.

Last edited Nov 6, 2008 at 11:00 PM by bonniefe, version 9

Comments

No comments yet.