다음을 통해 공유


SnapshotGenerationAgent 클래스

Provides the functionality of the Replication Snapshot Agent.

상속 계층

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

네임스페이스:  Microsoft.SqlServer.Replication
어셈블리:  Microsoft.SqlServer.Replication(Microsoft.SqlServer.Replication.dll)

구문

‘선언
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<GuidAttribute("141945FD-18BD-4222-B6D9-F937704C7FFE")> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class SnapshotGenerationAgent _
    Inherits AgentCore _
    Implements ISnapshotGenerationAgent
‘사용 방법
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

SnapshotGenerationAgent 유형에서 다음 멤버를 표시합니다.

생성자

  이름 설명
공용 메서드 SnapshotGenerationAgent Creates an instance of the SnapshotGenerationAgent class.

맨 위로 이동

속성

  이름 설명
공용 속성 AbortPolicy Gets or sets how running replication agent threads are terminated when an unanticipated shutdown occurs. (AgentCore에서 상속됨)
공용 속성 BcpBatchSize Gets or set the number of rows to send to the Distributor in a bulk copy operation.
공용 속성 ComErrorCollection Returns information on errors that occur during agent execution. (AgentCore에서 상속됨)
공용 속성 Distributor Gets or sets the name of the instance of SQL Server acting as the Distributor for the publication.
공용 속성 DistributorDeadlockPriority Gets or sets the priority of the Snapshot Agent connection to the Distributor when a deadlock occurs.
공용 속성 DistributorEncryptedPassword 인프라입니다.
공용 속성 DistributorEncryptionLevel Gets of sets the level of Secure Sockets Layer (SSL) encryption used by the Snapshot Agent when connecting to the Distributor.
공용 속성 DistributorLogin Gets or sets the login name used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성 DistributorNetworkLibrary 인프라입니다.
공용 속성 DistributorPassword Sets the password used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성 DistributorSecurityMode Gets or sets the security mode used when connecting locally to the Distributor.
공용 속성 DynamicFilterHostName Gets or sets the value supplied to the HOST_NAME function used in a parameterized row filter.
공용 속성 DynamicFilterLogin Gets or sets the value supplied to the SUSER_SNAME function used in a parameterized row filter.
공용 속성 DynamicSnapshotLocation Gets or sets the location of the partitioned snapshot for a subscription to a merge publication that is defined based-on a parameterized row filter.
공용 속성 FieldDelimiter Gets or sets the character or character sequence that marks the end of a field in the SQL Server bulk-copy data file.
공용 속성 FlatExceptionCollection 인프라입니다. (AgentCore에서 상속됨)
공용 속성 HistoryVerboseLevel Gets or sets the amount of history logged during agent execution. (AgentCore에서 상속됨)
공용 속성 HRBcpBlocks 인프라입니다.
공용 속성 HRBcpBlockSize 인프라입니다.
공용 속성 HRBcpDynamicBlocks 인프라입니다.
공용 속성 LoginTimeout Get or sets the number of seconds before the login times out for connections made by the agent. (AgentCore에서 상속됨)
공용 속성 MaxBcpThreads Gets or sets the number of bulk copy operations that can be performed in parallel.
공용 속성 MaxNetworkOptimization Gets or sets whether out-of-partition deletes are sent to the Subscriber.
공용 속성 OnetimeDynamicSnapshot 인프라입니다.
공용 속성 Output Get or sets the name and path of the agent output file. (AgentCore에서 상속됨)
공용 속성 OutputVerboseLevel Gets or sets the level of detail of information written to the agent output file. (AgentCore에서 상속됨)
공용 속성 PacketSize 인프라입니다. (AgentCore에서 상속됨)
공용 속성 ProfileName Gets or sets an agent profile to use when running the agent. (AgentCore에서 상속됨)
공용 속성 Publication Gets or sets the name of the publication.
공용 속성 Publisher Gets or sets the name of the instance of SQL Server that is the Publisher.
공용 속성 PublisherDatabase Gets or sets the name of the publication database.
공용 속성 PublisherDeadlockPriority Gets or sets the priority of the Snapshot Agent connection to the Publisher when a deadlock occurs.
공용 속성 PublisherEncryptedPassword 인프라입니다.
공용 속성 PublisherEncryptionLevel Gets of sets the level of Secure Sockets Layer (SSL) encryption used by the Snapshot Agent when connecting to the Distributor.
공용 속성 PublisherFailoverPartner Gets or sets the failover partner instance of SQL Server participating in a database mirroring session with the publication database. (AgentCore에서 상속됨)
공용 속성 PublisherLogin Gets or sets the login name used when connecting to the Publisher using SQL Server Authentication.
공용 속성 PublisherNetworkLibrary 인프라입니다.
공용 속성 PublisherPassword Sets the password used when connecting to the Publisher using SQL Server Authentication.
공용 속성 PublisherSecurityMode Gets or sets the security mode used when connecting to the Publisher.
공용 속성 QueryTimeout Get or sets the number of seconds before a query times out. (AgentCore에서 상속됨)
공용 속성 ReplicationType Gets or sets the type of publication.
공용 속성 RowDelimiter Gets or sets the character or character sequence that marks the end of a row in the SQL Server bulk-copy data file.
공용 속성 SecureDistributorEncryptedPassword 인프라입니다.
공용 속성 SecureDistributorPassword Sets the password (as a SecureString object) used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성 SecurePublisherEncryptedPassword 인프라입니다.
공용 속성 SecurePublisherPassword Sets the password (as a SecureString object) used when connecting to the Publisher using SQL Server Authentication.
공용 속성 StartQueueTimeout Gets or sets the time that the Snapshot Agent waits when the maximum number of concurrent partitioned snapshot processes for a merge publication are already running.
공용 속성 Supports70Subscribers Gets or sets whether the generated snapshot supports SQL Server 7.0 Subscribers.

맨 위로 이동

메서드

  이름 설명
공용 메서드 Abort (AgentCore에서 상속됨)
공용 메서드 CreateObjRef (MarshalByRefObject에서 상속됨)
공용 메서드 Equals (Object에서 상속됨)
보호된 메서드 Finalize (Object에서 상속됨)
공용 메서드 GenerateSnapshot Starts the Snapshot Agent to generate the snapshot.
공용 메서드 GetHashCode (Object에서 상속됨)
공용 메서드 GetLifetimeService (MarshalByRefObject에서 상속됨)
공용 메서드 GetType (Object에서 상속됨)
공용 메서드 InitializeLifetimeService (MarshalByRefObject에서 상속됨)
보호된 메서드 MemberwiseClone() () () () (Object에서 상속됨)
보호된 메서드 MemberwiseClone(Boolean) (MarshalByRefObject에서 상속됨)
공용 메서드 ResetParametersToDefault (AgentCore에서 상속됨)
공용 메서드 ToString (Object에서 상속됨)

맨 위로 이동

이벤트

  이름 설명
공용 이벤트 ComStatus (AgentCore에서 상속됨)
공용 이벤트 Status Occurs when a running agent returns status information. (AgentCore에서 상속됨)

맨 위로 이동

명시적 인터페이스 구현

  이름 설명
명시적 인터페이스 구현전용 메서드 ISnapshotGenerationAgent. . :: . .ResetParametersToDefault

맨 위로 이동

주의

The SnapshotGenerationAgent class provides direct, programmatic access to the Snapshot Agent.

The SnapshotGenerationAgent class supports the ability to do the following replication tasks:

  • Generate the initial snapshot

  • Generate a partitioned snapshot for a subscription defined based-on a parameterized filter.

This example generates a standard snapshot for a transactional publication.

           // 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

This example generates a standard snapshot for a merge publication.

// 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

This example overloads the HOST_NAME function to generate a filtered data snapshot for a subscription to a merge publication that has a parameterized filter.

           // 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

스레드 보안

이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.