Readme_Subscriber Monitor Utility Merge Replication Sample

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.

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.

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.

Before running this sample, make sure the following software is installed:

  • Microsoft SQL Server 2005 or later version, including the following optionally installed components:

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.

To build the sample solution, you will need to do the following:

To build the Subscriber Monitor Utility sample
  1. Install the replication samples. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.

  2. At the command prompt, navigate to the SQL Server samples installation directory. The default is C:\Program Files\Microsoft SQL Server\100\Samples\.

  3. Execute the following at a .NET Framework or Microsoft Visual Studio 2005 command prompt:

    sn -k SampleKey.snk

    You can skip this step if this key was previously created for use with another sample.

  4. 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.

  5. Build the solution.

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
  1. Start SubscriberMonitorUtility.exe from Visual Studio or from the command prompt.

  2. In the Select Subscription to Monitor dialog box, choose an instance of SQL Server from the Local Server Name drop-down box.

  3. Select a subscription to monitor from the Available Subscriptions drop-down list box.

  4. (Optional) Click the Edit button to change subscription properties.

  5. Click Connect.

  6. Select a Merge Agent session from the Merge Sessions tree view.

  7. (Optional) Click the Refresh button to refresh the session list.

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.