TransSynchronizationAgent 클래스

정의

복제 배포 에이전트의 기능을 제공합니다.

public ref class TransSynchronizationAgent : MarshalByRefObject, IDisposable, Microsoft::SqlServer::Replication::ITransSynchronizationAgent
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComSourceInterfaces(typeof(Microsoft.SqlServer.Replication.IComStatusEvent))]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.Guid("adeda98a-bdfc-4029-b6fb-991d6b468395")]
public class TransSynchronizationAgent : MarshalByRefObject, IDisposable, Microsoft.SqlServer.Replication.ITransSynchronizationAgent
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComSourceInterfaces(typeof(Microsoft.SqlServer.Replication.IComStatusEvent))>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Runtime.InteropServices.Guid("adeda98a-bdfc-4029-b6fb-991d6b468395")>]
type TransSynchronizationAgent = class
    inherit MarshalByRefObject
    interface IDisposable
    interface ITransSynchronizationAgent
Public Class TransSynchronizationAgent
Inherits MarshalByRefObject
Implements IDisposable, ITransSynchronizationAgent
상속
TransSynchronizationAgent
특성
구현

예제

다음 예제 Synchronize 에서는 푸시 구독을 동기화하기 위해 속성에서 액세스하는 클래스의 TransSynchronizationAgent 인스턴스에서 SynchronizationAgent 메서드를 호출합니다.

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

설명

클래스는 TransSynchronizationAgent 트랜잭션 또는 스냅샷 게시에 대한 구독을 프로그래밍 방식으로 동기화하는 기능을 지원합니다.

생성자

TransSynchronizationAgent()

TransSynchronizationAgent 클래스의 인스턴스를 만듭니다.

속성

AltSnapshotFolder

구독의 대체 스냅샷 폴더를 가져오거나 설정합니다.

ComErrorCollection

복제 에이전트가 생성한 오류의 컬렉션을 가져옵니다.

Distributor

구독의 배포자 역할을 하는 Microsoft SQL Server 인스턴스의 이름을 가져오거나 설정합니다.

DistributorAddress

DistributorNetwork 속성이 지정된 경우 배포자에 연결하는 데 사용되는 네트워크 주소를 가져오거나 설정합니다.

DistributorEncryptedPassword

SQL Server 인증을 사용하여 배포자에 연결할 때 사용되는 암호화된 암호를 가져오거나 설정합니다.

DistributorLogin

SQL Server 인증을 사용하여 배포자에 연결할 때 사용되는 로그인 이름을 가져오거나 설정합니다.

DistributorNetwork

배포자에 연결할 때 사용되는 클라이언트 Net-Library를 가져오거나 설정합니다.

DistributorPassword

SQL Server 인증을 사용하여 배포자에 연결할 때 사용되는 암호를 가져오거나 설정합니다.

DistributorSecurityMode

배포자에 연결할 때 사용되는 보안 모드를 가져오거나 설정합니다.

DtsPackageFileName

구독자에 적용되기 전에 명령 행 집합을 변환하는 데 사용되는 Microsoft SQL Server 2000 DTS(데이터 변환 서비스) 패키지의 이름과 경로를 가져오거나 설정합니다.

DtsPackagePassword

속성에서 지정한 Microsoft SQL Server 2000 DTS(데이터 변환 서비스) 패키지에 DtsPackageFileName 액세스하는 데 사용되는 소유자 암호를 가져오거나 설정합니다.

FileTransferType

초기 스냅샷 파일이 구독자에 전송되는 방법을 가져오거나 설정합니다.

HostName

사용된 호스트 이름을 가져오거나 설정합니다.

LastUpdatedTime

복제 에이전트가 마지막으로 구독을 동기화한 시간을 나타내는 타임스탬프를 가져옵니다.

LoginTimeout

연결이 설정될 때까지 대기하는 최대 시간(초)을 가져오거나 설정합니다.

MaxDeliveredTransactions

단일 에이전트 실행 중에 구독자에 적용되는 최대 트랜잭션 수를 가져오거나 설정합니다.

Output

에이전트 출력 파일의 이름과 경로를 가져오거나 설정합니다.

OutputVerboseLevel

배포 에이전트가 에이전트 출력 파일에 기록하는 정보의 크기를 가져오거나 설정합니다.

ProfileName

에이전트가 사용하는 프로필의 이름을 가져오거나 설정합니다.

Publication

게시의 이름을 가져오거나 설정합니다.

Publisher

구독의 게시자인 Microsoft SQL Server 인스턴스의 이름을 가져오거나 설정합니다.

PublisherDatabase

게시 데이터베이스의 이름을 가져오거나 설정합니다.

QueryTimeout

내부 쿼리 완료에 허용되는 시간(초)을 가져오거나 설정합니다.

SecureDistributorEncryptedPassword

배포자의 암호화된 보안 암호를 가져오거나 설정합니다.

SecureSubscriberEncryptedPassword

구독자의 암호화된 보안 암호를 가져오거나 설정합니다.

SkipErrors

이 에이전트가 건너뛸 오류 번호의 콜론으로 구분된 목록을 가져오거나 설정합니다.

Subscriber

구독자인 Microsoft SQL Server 인스턴스의 이름을 가져오거나 설정합니다.

SubscriberDatabase

구독 데이터베이스의 이름을 가져오거나 설정합니다.

SubscriberDatabasePath

구독자의 데이터베이스 경로를 가져오거나 설정합니다.

SubscriberDataSourceType

구독자로 사용되는 데이터 원본의 유형을 가져오거나 설정합니다.

SubscriberEncryptedPassword

구독자의 암호화된 암호를 가져오거나 설정합니다.

SubscriberLogin

SQL Server 인증을 사용하여 구독자에 연결할 때 사용되는 로그인 이름을 가져오거나 설정합니다.

SubscriberPassword

SQL Server 인증을 사용하여 구독자에 연결할 때 사용되는 암호를 가져오거나 설정합니다.

SubscriberSecurityMode

게시자에 연결할 때 사용되는 보안 모드를 가져오거나 설정합니다.

SubscriptionType

구독이 밀어넣기 구독인지 아니면 끌어오기 구독인지를 가져오거나 설정합니다.

UndeliveredCommands

배달되지 않은 명령 개수를 가져옵니다.

UndeliveredTransactions

배달되지 않은 트랜잭션 개수를 가져옵니다.

UseInProcLoader

구독자에서 스냅샷 파일을 적용할 때 BULK INSERT 명령을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다.

WorkingDirectory

FTP(파일 전송 프로토콜)가 사용될 때 스냅샷 파일이 액세스되는 작업 디렉터리를 가져오거나 설정합니다.

메서드

Abort()

TransSynchronizationAgent 작업을 중단합니다.

Dispose()

TransSynchronizationAgent 클래스의 현재 인스턴스에서 사용하는 모든 리소스를 해제합니다.

Dispose(Boolean)

TransSynchronizationAgent 클래스에서 사용하는 모든 리소스를 해제합니다.

Finalize()

TransSynchronizationAgent를 종료합니다.

IsSnapshotRequired()

배포자와 구독자에 연결하여 새 스냅샷이 다음 에이전트 동기화 중에 적용될지 여부를 확인합니다.

Synchronize()

배포 에이전트를 시작하여 구독을 동기화합니다.

이벤트

ComStatus

배포 에이전트가 동기화 Com 상태 정보를 반환하면 발생합니다.

Status

배포 에이전트가 동기화 상태 정보를 반환하면 발생합니다.

적용 대상

스레드 보안

이 클래스는 TransSynchronizationAgent 다중 스레드 아파트를 지원하지 않습니다. 애플리케이션의 기본 진입점인 메서드에 특성을 선언하여 [STAThread] 단일 스레드 아파트를 지정할 수 있습니다. 이는 Microsoft Visual Studio를 사용하여 만든 Microsoft Windows 기반 애플리케이션의 기본값입니다.