Freigeben über


Synchronisieren eines Pushabonnements

In diesem Thema wird beschrieben, wie Sie ein Pushabonnement in SQL Server 2014 mithilfe von SQL Server Management Studio, Replikations-Agents oder Replikationsverwaltungsobjekten (Replication Management Objects, RMO) synchronisieren.

Verwendung von SQL Server Management Studio

Abonnements werden vom Verteilungsagent (für Schnappschuss- und Transaktionsreplikation) oder vom Merge-Agent (für die Zusammenführungsreplikation) synchronisiert. Agents können kontinuierlich, bei Bedarf oder nach einem Zeitplan ausgeführt werden. Weitere Informationen zum Angeben von Synchronisierungszeitplänen finden Sie unter Angeben von Synchronisierungszeitplänen.

Synchronisieren Sie ein Abonnement bei Bedarf aus den Ordnern " Lokale Publikationen " und " Lokale Abonnements " in Microsoft SQL Server Management Studio und der Registerkarte "Alle Abonnements " im Replikationsmonitor. Abonnements für Oracle-Publikationen können nicht bei Bedarf vom Abonnenten synchronisiert werden. Informationen zum Starten des Replikationsmonitors finden Sie unter Starten des Replikationsmonitors.

So synchronisieren Sie ein Pushabonnement bei Bedarf in Management Studio (in Publisher)

  1. Stellen Sie eine Verbindung mit Publisher in Management Studio her, und erweitern Sie dann den Serverknoten.

  2. Erweitern Sie den Replikationsordner , und erweitern Sie dann den Ordner " Lokale Publikationen ".

  3. Erweitern Sie die Publikation, für die Sie Abonnements synchronisieren möchten.

  4. Klicken Sie mit der rechten Maustaste auf das Abonnement, das Sie synchronisieren möchten, und klicken Sie dann auf "Synchronisierungsstatus anzeigen".

  5. Klicken Sie im Dialogfeld "Synchronisierungsstatus <anzeigen – Subscriber>:<SubscriptionDatabase> " auf "Start". Nach Abschluss der Synchronisierung wird die Meldung "Synchronisierung abgeschlossen " angezeigt.

  6. Klicken Sie auf Schließen.

So synchronisieren Sie ein Pushabonnement bei Bedarf in Management Studio (beim Abonnenten)

  1. Stellen Sie eine Verbindung mit dem Abonnenten in Management Studio her, und erweitern Sie dann den Serverknoten.

  2. Erweitern Sie den Replikationsordner , und erweitern Sie dann den Ordner " Lokale Abonnements" .

  3. Klicken Sie mit der rechten Maustaste auf das Abonnement, das Sie synchronisieren möchten, und klicken Sie dann auf "Synchronisierungsstatus anzeigen".

  4. Es wird eine Meldung zum Herstellen einer Verbindung mit dem Distributor angezeigt. Klicke auf OK.

  5. Klicken Sie im Dialogfeld "Synchronisierungsstatus <anzeigen – Subscriber>:<SubscriptionDatabase> " auf "Start". Nach Abschluss der Synchronisierung wird die Meldung "Synchronisierung abgeschlossen " angezeigt.

  6. Klicken Sie auf Schließen.

So synchronisieren Sie ein Pushabonnement bei Bedarf im Replikationsmonitor

  1. Erweitern Sie im Replikationsmonitor eine Publisher-Gruppe im linken Bereich, erweitern Sie einen Publisher, und klicken Sie dann auf eine Publikation.

  2. Klicken Sie auf die Registerkarte Alle Abonnements .

  3. Klicken Sie mit der rechten Maustaste auf das Abonnement, das Sie synchronisieren möchten, und klicken Sie dann auf " Synchronisieren starten".

  4. Klicken Sie zum Anzeigen des Synchronisierungsfortschritts mit der rechten Maustaste auf das Abonnement, und klicken Sie dann auf "Details anzeigen".

Verwenden von Replikations-Agenten

Pushabonnements können programmgesteuert und bei Bedarf synchronisiert werden, indem die entsprechende ausführbare Replikations-Agent-Datei über die Kommandozeile aufgerufen wird. Die ausführbare Datei des Replikations-Agents, die aufgerufen wird, hängt vom Typ der Publikation ab, zu der das Pushabonnement gehört.

So starten Sie den Verteilungs-Agent, um ein Pushabonnement mit einer transaktionsbasierten Publikation zu synchronisieren

  1. Führen Sie an der Eingabeaufforderung oder in einer Batchdatei im Distributor distrib.exe aus. Geben Sie die folgenden Befehlszeilenargumente an:

    • -Verlag

    • -PublisherDB

    • -Verteiler

    • -Abonnent

    • -SubscriberDB

    • -SubscriptionType = 0

    Wenn Sie die SQL Server-Authentifizierung verwenden, müssen Sie auch die folgenden Argumente angeben:

    • -DistributorLogin

    • -Vertriebspasswort

    • -DistributorSecurityMode = 0

    • -PublisherLogin

    • -PublisherPassword

    • -PublisherSecurityMode = 0

    • -SubscriberLogin

    • -SubscriberPassword

    • -SubscriberSecurityMode = 0

      Von Bedeutung

      Verwenden Sie nach Möglichkeit die Windows-Authentifizierung.

So starten Sie den Zusammenführungs-Agenten, um ein Push-Abonnement mit einer Zusammenführungsveröffentlichung zu synchronisieren.

  1. Führen Sie an der Eingabeaufforderung oder in einer Batchdatei im Distributor replmerg.exe aus. Geben Sie die folgenden Befehlszeilenargumente an:

    • -Verlag

    • -PublisherDB

    • -Veröffentlichung

    • -Verteiler

    • -Abonnent

    • -SubscriberDB

    • -SubscriptionType = 0

    Wenn Sie die SQL Server-Authentifizierung verwenden, müssen Sie auch die folgenden Argumente angeben:

    • -DistributorLogin

    • -Vertriebspasswort

    • -DistributorSecurityMode = 0

    • -PublisherLogin

    • -PublisherPassword

    • -PublisherSecurityMode = 0

    • -SubscriberLogin

    • -SubscriberPassword

    • -SubscriberSecurityMode = 0

      Von Bedeutung

      Verwenden Sie nach Möglichkeit die Windows-Authentifizierung.

Beispiele (Replikationsagenten)

Im folgenden Beispiel wird der Verteilungs-Agent gestartet, um ein Pushabonnement zu synchronisieren.

REM -- Declare the variables.  
SET Publisher=%instancename%  
SET Subscriber=%instancename%  
SET PublicationDB=AdventureWorks2012  
SET SubscriptionDB=AdventureWorks2012Replica   
SET Publication=AdvWorksProductsTran  
  
REM -- Start the Distribution Agent with four subscription streams.  
REM -- The following command must be supplied without line breaks.  
"C:\Program Files\Microsoft SQL Server\120\COM\DISTRIB.EXE" -Subscriber %Subscriber%   
-SubscriberDB %SubscriptionDB% -SubscriberSecurityMode 1 -Publication %Publication%   
-Publisher %Publisher% -PublisherDB %PublicationDB% -Distributor %Publisher%   
-DistributorSecurityMode 1 -Continuous -SubscriptionType 0 -SubscriptionStreams 4

Im folgenden Beispiel wird der Merge-Agent gestartet, um ein Pushabonnement zu synchronisieren.

REM -- Declare the variables.  
SET Publisher=%instancename%  
SET Subscriber=%instancename%  
SET PublicationDB=AdventureWorks2012  
SET SubscriptionDB=AdventureWorks2012Replica   
SET Publication=AdvWorksSalesOrdersMerge  
  
REM -- Start the Merge Agent.  
REM -- The following command must be supplied without line breaks.  
"C:\Program Files\Microsoft SQL Server\120\COM\REPLMERG.EXE"  -Publisher %Publisher%   
-Subscriber  %Subscriber%  -Distributor %Publisher% -PublisherDB  %PublicationDB%   
-SubscriberDB %SubscriptionDB% -Publication %Publication% -PublisherSecurityMode 1   
-OutputVerboseLevel 3  -Output -SubscriberSecurityMode 1  -SubscriptionType 0   
-DistributorSecurityMode 1

Verwenden von Replikationsverwaltungsobjekten (RMO)

Sie können Pushabonnements programmgesteuert synchronisieren, indem Sie Replikationsverwaltungsobjekte (Replication Management Objects, RMO) und verwalteten Codezugriff auf Replikations-Agent-Funktionen verwenden. Die Klassen, die Sie zum Synchronisieren eines Pushabonnements verwenden, hängen von der Art der Veröffentlichung ab, zu der das Abonnement gehört.

Hinweis

Wenn Sie eine Synchronisierung starten möchten, die unabhängig ausgeführt wird, ohne dass sich dies auf Ihre Anwendung auswirkt, starten Sie den Agent asynchron. Wenn Sie jedoch das Ergebnis der Synchronisierung überwachen und Rückrufe vom Agent während des Synchronisierungsprozesses empfangen möchten (z. B. wenn Sie eine Statusanzeige anzeigen möchten), sollten Sie den Agent synchron starten. Für MicrosoftSQL Server 2005 Express Edition-Abonnenten müssen Sie den Agent synchron starten.

So synchronisieren Sie ein Pushabonnement mit einer Momentaufnahme oder transaktionsbasierten Publikation

  1. Erstellen Sie mithilfe der ServerConnection Klasse eine Verbindung mit dem Distributor.

  2. Erstellen Sie eine Instanz der TransSubscription Klasse, und legen Sie die folgenden Eigenschaften fest:

  3. Rufen Sie die LoadProperties Methode auf, um die verbleibenden Abonnementeigenschaften abzurufen. Wenn diese Methode zurückgegeben wird false, überprüfen Sie, ob das Abonnement vorhanden ist.

  4. Starten Sie den Vertriebsmitarbeiter beim Distributor auf eine der folgenden Arten:

    • Rufen Sie die SynchronizeWithJob-Methode auf der Instanz von TransSubscription aus Schritt 2 auf. Mit dieser Methode wird der Verteilungs-Agent asynchron gestartet, und die Kontrolle kehrt sofort zu deiner Anwendung zurück, während der Agent ausgeführt wird. Sie können diese Methode nicht aufrufen, wenn das Abonnement mit dem Wert false für CreateSyncAgentByDefault erstellt wurde.

    • Erhalten Sie eine Instanz der TransSynchronizationAgent Klasse aus der SynchronizationAgent Eigenschaft und rufen Sie die Synchronize Methode auf. Diese Methode startet den Agenten synchron, und die Steuerung bleibt beim laufenden Agentenauftrag. Während der synchronen Ausführung können Sie das Status Ereignis behandeln, während der Agent ausgeführt wird.

So synchronisieren Sie ein Pushabonnement mit einer Zusammenführungsveröffentlichung

  1. Erstellen Sie mithilfe der ServerConnection Klasse eine Verbindung mit dem Distributor.

  2. Erstellen Sie eine Instanz der MergeSubscription Klasse, und legen Sie die folgenden Eigenschaften fest:

  3. Rufen Sie die LoadProperties Methode auf, um die verbleibenden Abonnementeigenschaften abzurufen. Wenn diese Methode zurückgegeben wird false, überprüfen Sie, ob das Abonnement vorhanden ist.

  4. Starten Sie den Zusammenführungs-Agenten beim Distributor auf eine der folgenden Weisen:

    • Rufen Sie die SynchronizeWithJob Methode an der Instanz von MergeSubscription aus Schritt 2 auf. Diese Methode startet den Zusammenführungs-Agent asynchron, und die Steuerung kehrt sofort zu Ihrer Anwendung zurück, während der Agent-Prozess ausgeführt wird. Sie können diese Methode nicht aufrufen, wenn das Abonnement für CreateSyncAgentByDefault mit dem Wert false erstellt wurde.

    • Erhalten Sie eine Instanz der MergeSynchronizationAgent-Klasse von der Eigenschaft SynchronizationAgent, und rufen Sie die Synchronize-Methode auf. Diese Methode startet den Replikations-Agenten synchron, und die Steuerung verbleibt beim laufenden Agentenauftrag. Während der synchronen Ausführung können Sie das Status Ereignis behandeln, während der Agent läuft.

Beispiele (RMO)

In diesem Beispiel wird ein Pushabonnement mit einer transaktionsbasierten Publikation synchronisiert, bei der der Agent asynchron mit dem Agentauftrag gestartet wird.

// Define the server, publication, and database names.
string subscriberName = subscriberInstance;
string publisherName = publisherInstance;
string publicationName = "AdvWorksProductTran";
string subscriptionDbName = "AdventureWorks2012Replica";
string publicationDbName = "AdventureWorks2012";

/// Create a connection to the Publisher.
ServerConnection conn = new ServerConnection(publisherName);

TransSubscription subscription;

try
{
    // Connect to the Publisher.
    conn.Connect();

    // Instantiate the push subscription.
    subscription = new TransSubscription();
    subscription.ConnectionContext = conn;
    subscription.DatabaseName = publicationDbName;
    subscription.PublicationName = publicationName;
    subscription.SubscriptionDBName = subscriptionDbName;
    subscription.SubscriberName = subscriberName;

    // If the push subscription and the job exists, start the agent job.
    if (subscription.LoadProperties() && subscription.AgentJobId != null)
    {
        // Start the Distribution Agent asynchronously.
        subscription.SynchronizeWithJob();
    }
    else
    {
        // Do something here if the subscription does not exist.
        throw new ApplicationException(String.Format(
            "A subscription to '{0}' does not exists on {1}",
            publicationName, subscriberName));
    }
}
catch (Exception ex)
{
    // Implement appropriate error handling here.
    throw new ApplicationException("The subscription could not be synchronized.", ex);
}
finally
{
    conn.Disconnect();
}
' Define the server, publication, and database names.
Dim subscriberName As String = subscriberInstance
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksProductTran"
Dim subscriptionDbName As String = "AdventureWorks2012Replica"
Dim publicationDbName As String = "AdventureWorks2012"

' Create a connection to the Publisher.
Dim conn As ServerConnection = New ServerConnection(publisherName)

Dim subscription As TransSubscription

Try
    ' Connect to the Publisher.
    conn.Connect()

    ' Instantiate the push subscription.
    subscription = New TransSubscription()
    subscription.ConnectionContext = conn
    subscription.DatabaseName = publicationDbName
    subscription.PublicationName = publicationName
    subscription.SubscriptionDBName = subscriptionDbName
    subscription.SubscriberName = subscriberName

    ' If the push subscription and the job exists, start the agent job.
    If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then
        ' Start the Distribution Agent asynchronously.
        subscription.SynchronizeWithJob()
    Else
        ' Do something here if the subscription does not exist.
        Throw New ApplicationException(String.Format( _
         "A subscription to '{0}' does not exists on {1}", _
         publicationName, subscriberName))
    End If
Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("The subscription could not be synchronized.", ex)
Finally
    conn.Disconnect()
End Try

In diesem Beispiel wird ein Pushabonnement mit einer transaktionsbasierten Publikation synchronisiert, in der der Agent synchron gestartet wird.

// Define the server, publication, and database names.
string subscriberName = subscriberInstance;
string publisherName = publisherInstance;
string publicationName = "AdvWorksProductTran";
string subscriptionDbName = "AdventureWorks2012Replica";
string publicationDbName = "AdventureWorks2012";

// Create a connection to the Publisher.
ServerConnection conn = new ServerConnection(publisherName);

TransSubscription subscription;

try
{
    // Connect to the Publisher.
    conn.Connect();

    // Define the push subscription.
    subscription = new TransSubscription();
    subscription.ConnectionContext = conn;
    subscription.DatabaseName = publicationDbName;
    subscription.PublicationName = publicationName;
    subscription.SubscriptionDBName = subscriptionDbName;
    subscription.SubscriberName = subscriberName;

    // If the push subscription exists, start the synchronization.
    if (subscription.LoadProperties())
    {
        // Check that we have enough metadata to start the agent.
        if (subscription.SubscriberSecurity != null)
        {
            // Synchronously start the Distribution Agent for the subscription.
            subscription.SynchronizationAgent.Synchronize();
        }
        else
        {
            throw new ApplicationException("There is insufficent metadata to " +
                "synchronize the subscription. Recreate the subscription with " +
                "the agent job or supply the required agent properties at run time.");
        }
    }
    else
    {
        // Do something here if the push subscription does not exist.
        throw new ApplicationException(String.Format(
            "The subscription to '{0}' does not exist on {1}",
            publicationName, subscriberName));
    }
}
catch (Exception ex)
{
    // Implement appropriate error handling here.
    throw new ApplicationException("The subscription could not be synchronized.", ex);
}
finally
{
    conn.Disconnect();
}
' Define the server, publication, and database names.
Dim subscriberName As String = subscriberInstance
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksProductTran"
Dim subscriptionDbName As String = "AdventureWorks2012Replica"
Dim publicationDbName As String = "AdventureWorks2012"

' Create a connection to the Publisher.
Dim conn As ServerConnection = New ServerConnection(publisherName)

Dim subscription As TransSubscription

Try
    ' Connect to the Publisher.
    conn.Connect()

    ' Define the push subscription.
    subscription = New TransSubscription()
    subscription.ConnectionContext = conn
    subscription.DatabaseName = publicationDbName
    subscription.PublicationName = publicationName
    subscription.SubscriptionDBName = subscriptionDbName
    subscription.SubscriberName = subscriberName

    ' If the push subscription exists, start the synchronization.
    If subscription.LoadProperties() Then
        ' Check that we have enough metadata to start the agent.
        If Not subscription.SubscriberSecurity Is Nothing Then

            ' Synchronously start the Distribution Agent for the subscription.
            subscription.SynchronizationAgent.Synchronize()
        Else
            Throw New ApplicationException("There is insufficent metadata to " + _
             "synchronize the subscription. Recreate the subscription with " + _
             "the agent job or supply the required agent properties at run time.")
        End If
    Else
        ' Do something here if the push subscription does not exist.
        Throw New ApplicationException(String.Format( _
         "The subscription to '{0}' does not exist on {1}", _
         publicationName, subscriberName))
    End If
Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("The subscription could not be synchronized.", ex)
Finally
    conn.Disconnect()
End Try

In diesem Beispiel wird ein Pushabonnement mit einer Zusammenführungsveröffentlichung synchronisiert, bei der der Agent asynchron mit dem Agentauftrag gestartet wird.

// Define the server, publication, and database names.
string subscriberName = subscriberInstance;
string publisherName = publisherInstance;
string publicationName = "AdvWorksSalesOrdersMerge";
string subscriptionDbName = "AdventureWorks2012Replica";
string publicationDbName = "AdventureWorks2012";

// Create a connection to the Publisher.
ServerConnection conn = new ServerConnection(publisherName);

MergeSubscription subscription;

try
{
    // Connect to the Publisher.
    conn.Connect();

    // Define push subscription.
    subscription = new MergeSubscription();
    subscription.ConnectionContext = conn;
    subscription.DatabaseName = publicationDbName;
    subscription.PublicationName = publicationName;
    subscription.SubscriptionDBName = subscriptionDbName;
    subscription.SubscriberName = subscriberName;

    // If the push subscription and the job exists, start the agent job.
    if (subscription.LoadProperties() && subscription.AgentJobId != null)
    {
        // Start the Merge Agent asynchronously.
        subscription.SynchronizeWithJob();
    }
    else
    {
        // Do something here if the subscription does not exist.
        throw new ApplicationException(String.Format(
            "A subscription to '{0}' does not exists on {1}",
            publicationName, subscriberName));
    }
}
catch (Exception ex)
{
    // Implement appropriate error handling here.
    throw new ApplicationException("The subscription could not be synchronized.", ex);
}
finally
{
    conn.Disconnect();
}
' Define the server, publication, and database names.
Dim subscriberName As String = subscriberInstance
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim subscriptionDbName As String = "AdventureWorks2012Replica"
Dim publicationDbName As String = "AdventureWorks2012"

' Create a connection to the Publisher.
Dim conn As ServerConnection = New ServerConnection(publisherName)

Dim subscription As MergeSubscription

Try
    ' Connect to the Publisher.
    conn.Connect()

    ' Define push subscription.
    subscription = New MergeSubscription()
    subscription.ConnectionContext = conn
    subscription.DatabaseName = publicationDbName
    subscription.PublicationName = publicationName
    subscription.SubscriptionDBName = subscriptionDbName
    subscription.SubscriberName = subscriberName

    ' If the push subscription and the job exists, start the agent job.
    If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then
        ' Start the Merge Agent asynchronously.
        subscription.SynchronizeWithJob()
    Else
        ' Do something here if the subscription does not exist.
        Throw New ApplicationException(String.Format( _
            "A subscription to '{0}' does not exists on {1}", _
            publicationName, subscriberName))
    End If
Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("The subscription could not be synchronized.", ex)
Finally
    conn.Disconnect()
End Try

In diesem Beispiel wird ein Push-Abonnement mit einer Zusammenführungsveröffentlichung synchronisiert, wobei der Agent synchron gestartet wird.

// Define the server, publication, and database names.
string subscriberName = subscriberInstance;
string publisherName = publisherInstance;
string publicationName = "AdvWorksSalesOrdersMerge";
string subscriptionDbName = "AdventureWorks2012Replica";
string publicationDbName = "AdventureWorks2012";

// Create a connection to the Publisher.
ServerConnection conn = new ServerConnection(publisherName);

MergeSubscription subscription;

try
{
    // Connect to the Publisher
    conn.Connect();

    // Define the subscription.
    subscription = new MergeSubscription();
    subscription.ConnectionContext = conn;
    subscription.DatabaseName = publicationDbName;
    subscription.PublicationName = publicationName;
    subscription.SubscriptionDBName = subscriptionDbName;
    subscription.SubscriberName = subscriberName;

    // If the push subscription exists, start the synchronization.
    if (subscription.LoadProperties())
    {
        // Check that we have enough metadata to start the agent.
        if (subscription.SubscriberSecurity != null)
        {
            // Synchronously start the Merge Agent for the subscription.
            subscription.SynchronizationAgent.Synchronize();
        }
        else
        {
            throw new ApplicationException("There is insufficent metadata to " +
                "synchronize the subscription. Recreate the subscription with " +
                "the agent job or supply the required agent properties at run time.");
        }
    }
    else
    {
        // Do something here if the push subscription does not exist.
        throw new ApplicationException(String.Format(
            "The subscription to '{0}' does not exist on {1}",
            publicationName, subscriberName));
    }
}
catch (Exception ex)
{
    // Implement appropriate error handling here.
    throw new ApplicationException("The subscription could not be synchronized.", ex);
}
finally
{
    conn.Disconnect();
}
' Define the server, publication, and database names.
Dim subscriberName As String = subscriberInstance
Dim publisherName As String = publisherInstance
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim subscriptionDbName As String = "AdventureWorks2012Replica"
Dim publicationDbName As String = "AdventureWorks2012"

' Create a connection to the Publisher.
Dim conn As ServerConnection = New ServerConnection(publisherName)

Dim subscription As MergeSubscription

Try
    ' Connect to the Publisher
    conn.Connect()

    ' Define the subscription.
    subscription = New MergeSubscription()
    subscription.ConnectionContext = conn
    subscription.DatabaseName = publicationDbName
    subscription.PublicationName = publicationName
    subscription.SubscriptionDBName = subscriptionDbName
    subscription.SubscriberName = subscriberName

    ' If the push subscription exists, start the synchronization.
    If subscription.LoadProperties() Then
        ' Check that we have enough metadata to start the agent.
        If Not subscription.SubscriberSecurity Is Nothing Then
            ' Synchronously start the Merge Agent for the subscription.
            ' Log agent messages to an output file.
            subscription.SynchronizationAgent.Output = "mergeagent.log"
            subscription.SynchronizationAgent.OutputVerboseLevel = 2
            subscription.SynchronizationAgent.Synchronize()
        Else
            Throw New ApplicationException("There is insufficent metadata to " + _
             "synchronize the subscription. Recreate the subscription with " + _
             "the agent job or supply the required agent properties at run time.")
        End If
    Else
        ' Do something here if the push subscription does not exist.
        Throw New ApplicationException(String.Format( _
         "The subscription to '{0}' does not exist on {1}", _
         publicationName, subscriberName))
    End If
Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("The subscription could not be synchronized.", ex)
Finally
    conn.Disconnect()
End Try

Siehe auch

Konzepte für Replikationsverwaltungsobjekte
Synchronisieren von Daten
Bewährte Methoden für Replikationssicherheit