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)

[ComVisibleAttribute(true)]
[GuidAttribute("80016755-0016-4129-A778-1461AD058C86")]
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
public sealed class SnapshotGenerationAgent : AgentCore, 
	ISnapshotGenerationAgent

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

  이름설명
공용 메서드SnapshotGenerationAgentCreates an instance of the SnapshotGenerationAgent class.
맨 위로 이동

  이름설명
공용 속성AbortPolicyGets or sets how running replication agent threads are terminated when an unanticipated shutdown occurs. (AgentCore에서 상속됨)
공용 속성BcpBatchSizeGets or set the number of rows to send to the Distributor in a bulk copy operation.
공용 속성ComErrorCollectionGets information on errors that occur during agent execution. (AgentCore에서 상속됨)
공용 속성DistributorGets or sets the name of the instance of SQL Server acting as the Distributor for the publication.
공용 속성DistributorDeadlockPriorityGets or sets the priority of the Snapshot Agent connection to the Distributor when a deadlock occurs.
공용 속성DistributorEncryptedPassword인프라입니다. Gets or sets the encrypted password for the distributor.
공용 속성DistributorEncryptionLevelGets of sets the level of Secure Sockets Layer (SSL) encryption used by the Snapshot Agent when connecting to the Distributor.
공용 속성DistributorLoginGets or sets the login name used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성DistributorNetworkLibrary인프라입니다. Gets or sets the Network library used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성DistributorPasswordSets the password used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성DistributorSecurityModeGets or sets the security mode used when connecting locally to the Distributor.
공용 속성DynamicFilterHostNameGets or sets the value supplied to the HOST_NAME function used in a parameterized row filter.
공용 속성DynamicFilterLoginGets or sets the value supplied to the SUSER_SNAME function used in a parameterized row filter.
공용 속성DynamicSnapshotLocationGets or sets the location of the partitioned snapshot for a subscription to a merge publication that is defined based-on a parameterized row filter.
공용 속성FieldDelimiterGets or sets the character or character sequence that marks the end of a field in the SQL Server bulk-copy data file.
공용 속성FlatExceptionCollection인프라입니다. Gets the collection of exception objects accessed using the IEnumerable interface. (AgentCore에서 상속됨)
공용 속성HistoryVerboseLevelGets or sets the amount of history logged during agent execution. (AgentCore에서 상속됨)
공용 속성HRBcpBlocks인프라입니다. Gets or sets the HR bulk copy program blocks.
공용 속성HRBcpBlockSize인프라입니다. Gets or sets the HR bulk copy program block size.
공용 속성HRBcpDynamicBlocks인프라입니다. Gets or sets the HR bulk copy program dynamic blocks.
공용 속성LoginTimeoutGet or sets the number of seconds before the login times out for connections made by the agent. (AgentCore에서 상속됨)
공용 속성MaxBcpThreadsGets or sets the number of bulk copy operations that can be performed in parallel.
공용 속성MaxNetworkOptimizationGets or sets whether out-of-partition deletes are sent to the Subscriber.
공용 속성OnetimeDynamicSnapshot인프라입니다. Gets or sets the one time dynamic snapshot.
공용 속성OutputGets or sets the name and path of the agent output file. (AgentCore에서 상속됨)
공용 속성OutputVerboseLevelGets or sets the level of detail of information written to the agent output file. (AgentCore에서 상속됨)
공용 속성PacketSize인프라입니다. Gets or sets the packet size associated with the agent. (AgentCore에서 상속됨)
공용 속성ProfileNameGets or sets an agent profile to use when running the agent. (AgentCore에서 상속됨)
공용 속성PublicationGets or sets the name of the publication.
공용 속성PublisherGets or sets the name of the instance of SQL Server that is the Publisher.
공용 속성PublisherDatabaseGets or sets the name of the publication database.
공용 속성PublisherDeadlockPriorityGets or sets the priority of the Snapshot Agent connection to the Publisher when a deadlock occurs.
공용 속성PublisherEncryptedPassword인프라입니다. Gets or sets the encrypted password for the publisher.
공용 속성PublisherEncryptionLevelGets of sets the level of Secure Sockets Layer (SSL) encryption used by the Snapshot Agent when connecting to the Distributor.
공용 속성PublisherFailoverPartnerGets or sets the failover partner instance of SQL Server participating in a database mirroring session with the publication database. (AgentCore에서 상속됨)
공용 속성PublisherLoginGets or sets the login name used when connecting to the Publisher using SQL Server Authentication.
공용 속성PublisherNetworkLibrary인프라입니다. Gets or sets the Network library used when connecting locally to the Publisher using SQL Server Authentication.
공용 속성PublisherPasswordSets the password used when connecting to the Publisher using SQL Server Authentication.
공용 속성PublisherSecurityModeGets or sets the security mode used when connecting to the Publisher.
공용 속성QueryTimeoutGets or sets the number of seconds before a query times out. (AgentCore에서 상속됨)
공용 속성ReplicationTypeGets or sets the type of publication.
공용 속성RowDelimiterGets or sets the character or character sequence that marks the end of a row in the SQL Server bulk-copy data file.
공용 속성SecureDistributorEncryptedPassword인프라입니다. Sets the encrypted password used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성SecureDistributorPasswordSets the password (as a SecureString object) used when connecting locally to the Distributor using SQL Server Authentication.
공용 속성SecurePublisherEncryptedPassword인프라입니다. Sets the encrypted password used when connecting to the Publisher using SQL Server Authentication.
공용 속성SecurePublisherPasswordSets the password (as a SecureString object) used when connecting to the Publisher using SQL Server Authentication.
공용 속성StartQueueTimeoutGets 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.
공용 속성Supports70SubscribersGets or sets whether the generated snapshot supports SQL Server 7.0 Subscribers.
맨 위로 이동

  이름설명
공용 메서드AbortAborts the process of the current instance. (AgentCore에서 상속됨)
공용 메서드CreateObjRef보안에 중요합니다. (MarshalByRefObject에서 상속됨)
공용 메서드Equals (Object에서 상속됨)
공용 메서드GenerateSnapshotStarts the Snapshot Agent to generate the snapshot.
공용 메서드GetHashCode (Object에서 상속됨)
공용 메서드GetLifetimeService보안에 중요합니다. (MarshalByRefObject에서 상속됨)
공용 메서드GetType (Object에서 상속됨)
공용 메서드InitializeLifetimeService보안에 중요합니다. (MarshalByRefObject에서 상속됨)
공용 메서드ResetParametersToDefaultResets the value of the parameters to default. (AgentCore에서 상속됨)
공용 메서드ToString (Object에서 상속됨)
맨 위로 이동

  이름설명
공용 이벤트ComStatus인프라입니다. Occurs when a running agent returns synchronization Com status information. (AgentCore에서 상속됨)
공용 이벤트StatusOccurs when a running agent returns status information. (AgentCore에서 상속됨)
맨 위로 이동

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 = "AdventureWorks2012";
			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 = "AdventureWorks2012"
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 = "AdventureWorks2012";
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 = "AdventureWorks2012"
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 = "AdventureWorks2012";
			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 = "AdventureWorks2012"
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) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.

커뮤니티 추가 항목

추가
표시: