Klasa SnapshotGenerationAgent

Zapewnia funkcje replikacji agenta migawki.

Hierarchia dziedziczenia

System.Object
  System.MarshalByRefObject
    Microsoft.SqlServer.Replication.AgentCore
      Microsoft.SqlServer.Replication.SnapshotGenerationAgent

Przestrzeń nazw:  Microsoft.SqlServer.Replication
Zestaw:  Microsoft.SqlServer.Replication (w Microsoft.SqlServer.Replication.dll)

Składnia

'Deklaracja
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class SnapshotGenerationAgent _
    Inherits AgentCore _
    Implements ISnapshotGenerationAgent
'Użycie
Dim instance As SnapshotGenerationAgent
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
[GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")]
[ComVisibleAttribute(true)]
public sealed class SnapshotGenerationAgent : AgentCore, 
    ISnapshotGenerationAgent
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
[GuidAttribute(L"141945FD-18BD-4222-B6D9-F937704C7FFE")]
[ComVisibleAttribute(true)]
public ref class SnapshotGenerationAgent sealed : public AgentCore, 
    ISnapshotGenerationAgent
[<SealedAttribute>]
[<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)>]
[<GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")>]
[<ComVisibleAttribute(true)>]
type SnapshotGenerationAgent =  
    class
        inherit AgentCore
        interface ISnapshotGenerationAgent
    end
public final class SnapshotGenerationAgent extends AgentCore implements ISnapshotGenerationAgent

Typ SnapshotGenerationAgent uwidacznia następujące elementy członkowskie.

Konstruktorzy

  Nazwa Opis
Metoda publiczna SnapshotGenerationAgent Tworzy wystąpienie SnapshotGenerationAgent klasy

Do góry

Właściwości

  Nazwa Opis
Właściwość publiczna AbortPolicy Pobiera lub ustawia jak uruchomiony agent replikacja wątki są przerywane, gdy występuje niekontrolowanej zamknięcia. (Dziedziczony z AgentCore).
Właściwość publiczna BcpBatchSize Pobiera lub zestaw liczbę wierszy do wysłania do dystrybutora w zbiorczej operacji kopiowania.
Właściwość publiczna ComErrorCollection Zwraca informacje na temat błędów występujących podczas wykonywania agenta. (Dziedziczony z AgentCore).
Właściwość publiczna Distributor Pobiera lub ustawia nazwę wystąpienie programu SQL Server, działając jako dystrybutor publikacja.
Właściwość publiczna DistributorDeadlockPriority Pobiera lub ustawia priorytet połączenia agenta migawki dystrybutora, po wystąpieniu zakleszczenie.
Właściwość publiczna DistributorEncryptedPassword Infrastruktura.
Właściwość publiczna DistributorEncryptionLevel Pobiera zestawów poziom szyfrowanie SSL (Secure Sockets Layer) używane przez agenta migawki, nawiązując do dystrybutora.
Właściwość publiczna DistributorLogin Pobiera lub ustawia nazwę logowania używane lokalnie do dystrybutora za pomocą SQL Server uwierzytelniania.
Właściwość publiczna DistributorNetworkLibrary Infrastruktura.
Właściwość publiczna DistributorPassword Ustawia hasło używane przy łączeniu się lokalnie do dystrybutora za pomocą SQL Server uwierzytelniania.
Właściwość publiczna DistributorSecurityMode Pobiera lub ustawia tryb zabezpieczeń używany przy łączeniu się lokalnie do dystrybutora.
Właściwość publiczna DynamicFilterHostName Pobiera lub ustawia wartość dostarczonych do HOST_NAME w funkcji sparametryzowany filtr wierszy.
Właściwość publiczna DynamicFilterLogin Pobiera lub ustawia wartość dostarczonych do SUSER_SNAME w funkcji sparametryzowany filtr wierszy.
Właściwość publiczna DynamicSnapshotLocation Pobiera lub Ustawia lokalizację partycjonowana migawka subskrypcja scalania publikacja, która jest zdefiniowana na podstawie filtr wiersza sparametryzowanej.
Właściwość publiczna FieldDelimiter Pobiera lub ustawia znak lub sekwencję znaków, który oznacza koniec pole w pliku masowego kopiowania danych programu SQL Server.
Właściwość publiczna FlatExceptionCollection Infrastruktura. (Dziedziczony z AgentCore).
Właściwość publiczna HistoryVerboseLevel Pobiera lub ustawia ilość historia zarejestrowane podczas wykonywania agenta. (Dziedziczony z AgentCore).
Właściwość publiczna HRBcpBlocks Infrastruktura.
Właściwość publiczna HRBcpBlockSize Infrastruktura.
Właściwość publiczna HRBcpDynamicBlocks Infrastruktura.
Właściwość publiczna LoginTimeout GET lub ustawia liczbę sekund przed logowania limit czasu połączeń nawiązywanych przez agenta. (Dziedziczony z AgentCore).
Właściwość publiczna MaxBcpThreads Pobiera lub ustawia liczbę kopiowanie masowe operacji, które mogą być wykonywane równolegle.
Właściwość publiczna MaxNetworkOptimization Pobiera lub ustawia, czy limit partycji usuwa są wysyłane do subskrybenta.
Właściwość publiczna OnetimeDynamicSnapshot Infrastruktura.
Właściwość publiczna Output Pobieranie lub ustawia nazwę i ścieżka pliku wyjściowego agenta. (Dziedziczony z AgentCore).
Właściwość publiczna OutputVerboseLevel Pobiera lub ustawia poziom szczegółowości informacje zapisane w pliku wyjściowym agenta. (Dziedziczony z AgentCore).
Właściwość publiczna PacketSize Infrastruktura. (Dziedziczony z AgentCore).
Właściwość publiczna ProfileName Pobiera lub ustawia profil programu agent używane podczas uruchamiania agenta. (Dziedziczony z AgentCore).
Właściwość publiczna Publication Pobiera lub ustawia nazwę publikacja.
Właściwość publiczna Publisher Pobiera lub ustawia nazwę wystąpienie programu SQL Server, który jest Wydawca.
Właściwość publiczna PublisherDatabase Pobiera lub ustawia nazwę baza danych publikacja.
Właściwość publiczna PublisherDeadlockPriority Pobiera lub ustawia priorytet połączenie migawki agenta Wydawca po wystąpieniu zakleszczenie.
Właściwość publiczna PublisherEncryptedPassword Infrastruktura.
Właściwość publiczna PublisherEncryptionLevel Pobiera zestawów poziom szyfrowanie SSL (Secure Sockets Layer) używane przez agenta migawki, nawiązując do dystrybutora.
Właściwość publiczna PublisherFailoverPartner Pobiera lub ustawia wystąpienie partner pracy awaryjnej SQL Server uczestniczących w bazie danych, dublowanie sesja z baza danych publikacja. (Dziedziczony z AgentCore).
Właściwość publiczna PublisherLogin Pobiera lub ustawia nazwę logowania używane podczas łączenia się przy użyciu Wydawca SQL Server uwierzytelniania.
Właściwość publiczna PublisherNetworkLibrary Infrastruktura.
Właściwość publiczna PublisherPassword Ustawia hasło używane przy łączeniu się z pomocą Wydawca SQL Server uwierzytelniania.
Właściwość publiczna PublisherSecurityMode Pobiera lub ustawia tryb zabezpieczeń używane podczas łączenia się z Wydawca.
Właściwość publiczna QueryTimeout GET lub ustawia limit czasu liczba sekund przed kwerendy. (Dziedziczony z AgentCore).
Właściwość publiczna ReplicationType Pobiera lub ustawia typ publikacja.
Właściwość publiczna RowDelimiter Pobiera lub ustawia znak lub sekwencję znaków, znaki końca wiersza w pliku masowego kopiowania danych programu SQL Server.
Właściwość publiczna SecureDistributorEncryptedPassword Infrastruktura.
Właściwość publiczna SecureDistributorPassword Ustawia hasło (jako SecureString obiektu) używanej przy łączeniu się lokalnie do dystrybutora przy użyciu uwierzytelniania programu SQL Server.
Właściwość publiczna SecurePublisherEncryptedPassword Infrastruktura.
Właściwość publiczna SecurePublisherPassword Ustawia hasło (jako SecureString obiektu) używane podczas łączenia się z Wydawca przy użyciu uwierzytelniania programu SQL Server.
Właściwość publiczna StartQueueTimeout Pobiera lub ustawia czas oczekiwania agenta migawki przy uruchomionym maksymalną liczbę równoczesnych partycjonowana migawka procesów dla publikacja seryjnej.
Właściwość publiczna Supports70Subscribers Pobiera lub ustawia, czy wygenerowane migawka obsługuje programu SQL Server 7.0 subskrybentów.

Do góry

Metody

  Nazwa Opis
Metoda publiczna Abort (Dziedziczony z AgentCore).
Metoda publiczna CreateObjRef (Dziedziczony z MarshalByRefObject).
Metoda publiczna Equals (Dziedziczony z Object).
Metoda chroniona Finalize (Dziedziczony z Object).
Metoda publiczna GenerateSnapshot Uruchamia agenta migawka, aby wygenerować migawkę.
Metoda publiczna GetHashCode (Dziedziczony z Object).
Metoda publiczna GetLifetimeService (Dziedziczony z MarshalByRefObject).
Metoda publiczna GetType (Dziedziczony z Object).
Metoda publiczna InitializeLifetimeService (Dziedziczony z MarshalByRefObject).
Metoda chroniona MemberwiseClone() (Dziedziczony z Object).
Metoda chroniona MemberwiseClone(Boolean) (Dziedziczony z MarshalByRefObject).
Metoda publiczna ResetParametersToDefault (Dziedziczony z AgentCore).
Metoda publiczna ToString (Dziedziczony z Object).

Do góry

Zdarzenia

  Nazwa Opis
Zdarzenie publiczne ComStatus (Dziedziczony z AgentCore).
Zdarzenie publiczne Status Występuje, gdy uruchomiony agent zwraca informacje o stanie. (Dziedziczony z AgentCore).

Do góry

Jawne implementacje interfejsu

  Nazwa Opis
Jawna implementacja interfejsuMetoda prywatna ISnapshotGenerationAgent.ResetParametersToDefault

Do góry

Uwagi

SnapshotGenerationAgent Klasy zapewnia programowego, bezpośredniego dostępu do agenta migawki.

SnapshotGenerationAgent Klasy pozwala wykonywać następujące zadania replikacja:

  • Wstępne generowaniemigawka

  • Generowanie partycjonowana migawka dla subskrypcja zdefiniowane na podstawie sparametryzowana filtru.

Przykłady

Ten przykład generuje standard migawka dla transakcyjnych publikacja.

            // Set the Publisher, publication database, and publication names.
            string publicationName = "AdvWorksProductTran";
            string publicationDbName = "AdventureWorks2008R2";
            string publisherName = publisherInstance;
            string distributorName = publisherInstance;

            SnapshotGenerationAgent agent;

            try
            {
                // Set the required properties for Snapshot Agent.
                agent = new SnapshotGenerationAgent();
                agent.Distributor = distributorName;
                agent.DistributorSecurityMode = SecurityMode.Integrated;
                agent.Publisher = publisherName;
                agent.PublisherSecurityMode = SecurityMode.Integrated;
                agent.Publication = publicationName;
                agent.PublisherDatabase = publicationDbName;
                agent.ReplicationType = ReplicationType.Transactional;

                // Start the agent synchronously.
                agent.GenerateSnapshot();

            }
            catch (Exception ex)
            {
                // Implement custom application error handling here.
                throw new ApplicationException(String.Format(
                    "A snapshot could not be generated for the {0} publication."
                    , publicationName), ex);
            }
' Set the Publisher, publication database, and publication names.
Dim publicationName As String = "AdvWorksProductTran"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim publisherName As String = publisherInstance
Dim distributorName As String = publisherInstance

Dim agent As SnapshotGenerationAgent

Try
    ' Set the required properties for Snapshot Agent.
    agent = New SnapshotGenerationAgent()
    agent.Distributor = distributorName
    agent.DistributorSecurityMode = SecurityMode.Integrated
    agent.Publisher = publisherName
    agent.PublisherSecurityMode = SecurityMode.Integrated
    agent.Publication = publicationName
    agent.PublisherDatabase = publicationDbName
    agent.ReplicationType = ReplicationType.Transactional

    ' Start the agent synchronously.
    agent.GenerateSnapshot()

Catch ex As Exception
    ' Implement custom application error handling here.
    Throw New ApplicationException(String.Format( _
     "A snapshot could not be generated for the {0} publication." _
     , publicationName), ex)
End Try

Ten przykład generuje standard migawka do publikacja korespondencji seryjnej.

// Set the Publisher, publication database, and publication names.
string publicationName = "AdvWorksSalesOrdersMerge";
string publicationDbName = "AdventureWorks2008R2";
string publisherName = publisherInstance;
string distributorName = publisherInstance;

SnapshotGenerationAgent agent;

try
{
    // Set the required properties for Snapshot Agent.
    agent = new SnapshotGenerationAgent();
    agent.Distributor = distributorName;
    agent.DistributorSecurityMode = SecurityMode.Integrated;
    agent.Publisher = publisherName;
    agent.PublisherSecurityMode = SecurityMode.Integrated;
    agent.Publication = publicationName;
    agent.PublisherDatabase = publicationDbName;
    agent.ReplicationType = ReplicationType.Merge;

    // Start the agent synchronously.
    agent.GenerateSnapshot();

}
catch (Exception ex)
{
    // Implement custom application error handling here.
    throw new ApplicationException(String.Format(
        "A snapshot could not be generated for the {0} publication."
        , publicationName), ex);
}
' Set the Publisher, publication database, and publication names.
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim publisherName As String = publisherInstance
Dim distributorName As String = publisherInstance

Dim agent As SnapshotGenerationAgent

Try
    ' Set the required properties for Snapshot Agent.
    agent = New SnapshotGenerationAgent()
    agent.Distributor = distributorName
    agent.DistributorSecurityMode = SecurityMode.Integrated
    agent.Publisher = publisherName
    agent.PublisherSecurityMode = SecurityMode.Integrated
    agent.Publication = publicationName
    agent.PublisherDatabase = publicationDbName
    agent.ReplicationType = ReplicationType.Merge

    ' Start the agent synchronously.
    agent.GenerateSnapshot()

Catch ex As Exception
    ' Implement custom application error handling here.
    Throw New ApplicationException(String.Format( _
     "A snapshot could not be generated for the {0} publication." _
     , publicationName), ex)
End Try

W tym przykładzie overloads HOST_NAME funkcja Generowanie filtrowane dane migawka subskrypcja do publikacja korespondencji seryjnej, która została sparametryzowana filtru.

           // Set the Publisher, publication database, and publication names.
            string publicationName = "AdvWorksSalesOrdersMerge";
            string publicationDbName = "AdventureWorks2008R2";
            string publisherName = publisherInstance;
            string distributorName = publisherInstance;

            SnapshotGenerationAgent agent;

            try
            {
                // Set the required properties for Snapshot Agent.
                agent = new SnapshotGenerationAgent();
                agent.Distributor = distributorName;
                agent.DistributorSecurityMode = SecurityMode.Integrated;
                agent.Publisher = publisherName;
                agent.PublisherSecurityMode = SecurityMode.Integrated;
                agent.Publication = publicationName;
                agent.PublisherDatabase = publicationDbName;
                agent.ReplicationType = ReplicationType.Merge;

                // Specify the partition information to generate a 
                // filtered snapshot based on Hostname.
                agent.DynamicFilterHostName = hostname;

                // Start the agent synchronously.
                agent.GenerateSnapshot();
            }
            catch (Exception ex)
            {
                // Implement custom application error handling here.
                throw new ApplicationException(String.Format(
                    "A snapshot could not be generated for the {0} publication."
                    , publicationName), ex);
            }
' Set the Publisher, publication database, and publication names.
Dim publicationName As String = "AdvWorksSalesOrdersMerge"
Dim publicationDbName As String = "AdventureWorks2008R2"
Dim publisherName As String = publisherInstance
Dim distributorName As String = publisherInstance

Dim agent As SnapshotGenerationAgent

Try
    ' Set the required properties for Snapshot Agent.
    agent = New SnapshotGenerationAgent()
    agent.Distributor = distributorName
    agent.DistributorSecurityMode = SecurityMode.Integrated
    agent.Publisher = publisherName
    agent.PublisherSecurityMode = SecurityMode.Integrated
    agent.Publication = publicationName
    agent.PublisherDatabase = publicationDbName
    agent.ReplicationType = ReplicationType.Merge

    ' Specify the partition information to generate a 
    ' filtered snapshot based on Hostname.
    agent.DynamicFilterHostName = hostname

    ' Start the agent synchronously.
    agent.GenerateSnapshot()
Catch ex As Exception
    ' Implement custom application error handling here.
    Throw New ApplicationException(String.Format( _
     "A snapshot could not be generated for the {0} publication." _
     , publicationName), ex)
End Try

Bezpieczeństwo wątków

Wszystkie publiczne statyczny (Shared w języku Visual Basic) elementy członkowskie tego typu są bezpieczne dla wątków. Nie ma gwarancji, że elementy członkowskie wystąpień będą bezpieczne dla wątków.