DistributionDatabase 클래스

정의

배포자에서 배포 데이터베이스를 나타냅니다.

public ref class DistributionDatabase sealed : Microsoft::SqlServer::Replication::ReplicationObject
public sealed class DistributionDatabase : Microsoft.SqlServer.Replication.ReplicationObject
type DistributionDatabase = class
    inherit ReplicationObject
Public NotInheritable Class DistributionDatabase
Inherits ReplicationObject
상속
DistributionDatabase

예제

// Set the server and database names
string distributionDbName = "distribution";
string publisherName = publisherInstance;
string publicationDbName = "AdventureWorks2012";

DistributionDatabase distributionDb;
ReplicationServer distributor;
DistributionPublisher publisher;
ReplicationDatabase publicationDb;

// Create a connection to the server using Windows Authentication.
ServerConnection conn = new ServerConnection(publisherName);

try
{
    // Connect to the server acting as the Distributor 
    // and local Publisher.
    conn.Connect();

    // Define the distribution database at the Distributor,
    // but do not create it now.
    distributionDb = new DistributionDatabase(distributionDbName, conn);
    distributionDb.MaxDistributionRetention = 96;
    distributionDb.HistoryRetention = 120;

    // Set the Distributor properties and install the Distributor.
    // This also creates the specified distribution database.
    distributor = new ReplicationServer(conn);
    distributor.InstallDistributor((string)null, distributionDb);

    // Set the Publisher properties and install the Publisher.
    publisher = new DistributionPublisher(publisherName, conn);
    publisher.DistributionDatabase = distributionDb.Name;
    publisher.WorkingDirectory = @"\\" + publisherName + @"\repldata";
    publisher.PublisherSecurity.WindowsAuthentication = true;
    publisher.Create();

    // Enable AdventureWorks2012 as a publication database.
    publicationDb = new ReplicationDatabase(publicationDbName, conn);

    publicationDb.EnabledTransPublishing = true;
    publicationDb.EnabledMergePublishing = true;
}
catch (Exception ex)
{
    // Implement appropriate error handling here.
    throw new ApplicationException("An error occured when installing distribution and publishing.", ex);
}
finally
{
    conn.Disconnect();
}
' Set the server and database names
Dim distributionDbName As String = "distribution"
Dim publisherName As String = publisherInstance
Dim publicationDbName As String = "AdventureWorks2012"

Dim distributionDb As DistributionDatabase
Dim distributor As ReplicationServer
Dim publisher As DistributionPublisher
Dim publicationDb As ReplicationDatabase

' Create a connection to the server using Windows Authentication.
Dim conn As ServerConnection = New ServerConnection(publisherName)

Try
    ' Connect to the server acting as the Distributor 
    ' and local Publisher.
    conn.Connect()

    ' Define the distribution database at the Distributor,
    ' but do not create it now.
    distributionDb = New DistributionDatabase(distributionDbName, conn)
    distributionDb.MaxDistributionRetention = 96
    distributionDb.HistoryRetention = 120

    ' Set the Distributor properties and install the Distributor.
    ' This also creates the specified distribution database.
    distributor = New ReplicationServer(conn)
    distributor.InstallDistributor((CType(Nothing, String)), distributionDb)

    ' Set the Publisher properties and install the Publisher.
    publisher = New DistributionPublisher(publisherName, conn)
    publisher.DistributionDatabase = distributionDb.Name
    publisher.WorkingDirectory = "\\" + publisherName + "\repldata"
    publisher.PublisherSecurity.WindowsAuthentication = True
    publisher.Create()

    ' Enable AdventureWorks2012 as a publication database.
    publicationDb = New ReplicationDatabase(publicationDbName, conn)

    publicationDb.EnabledTransPublishing = True
    publicationDb.EnabledMergePublishing = True

Catch ex As Exception
    ' Implement appropriate error handling here.
    Throw New ApplicationException("An error occured when installing distribution and publishing.", ex)

Finally
    conn.Disconnect()

End Try

설명

스레드 보안

이 유형의 모든 공용 정적(Shared Microsoft Visual Basic의 경우) 멤버는 다중 스레드 작업에 안전합니다. 인스턴스 구성원은 스레드로부터의 안전성이 보장되지 않습니다.

생성자

DistributionDatabase()

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

DistributionDatabase(String, ServerConnection)

지정된 데이터베이스 이름 및 배포자 연결을 사용하여 DistributionDatabase 클래스의 새 인스턴스를 만듭니다.

속성

CachePropertyChanges

복제 속성에 대한 변경 내용을 캐시할지 아니면 즉시 적용할지를 가져오거나 설정합니다.

(다음에서 상속됨 ReplicationObject)
ConnectionContext

Microsoft SQL Server 인스턴스에 대한 연결을 가져오거나 설정합니다.

(다음에서 상속됨 ReplicationObject)
DataFile

배포 데이터베이스에 대한 데이터 파일의 이름을 가져오거나 설정합니다.

DataFileSize

배포 데이터베이스에 대한 주 데이터베이스 파일의 크기를 가져오거나 설정합니다.

DataFolder

배포 데이터베이스에 대한 데이터 파일을 포함하는 디렉터리 경로를 가져오거나 설정합니다.

DistributionCleanupTaskName

배포에서 복제 테이블 정리를 담당하는 SQL Server 에이전트 작업의 이름을 가져옵니다.

DistributorSecurity

배포 데이터베이스를 만들기 위해 배포자에 연결하는 데 사용되는 보안 컨텍스트를 가져옵니다.

HistoryCleanupTaskName

복제 기록 테이블 정리를 담당하는 SQL Server 에이전트 작업의 이름을 가져옵니다.

HistoryRetention

복제 에이전트 기록 데이터가 보관되는 기간(시간)을 가져오거나 설정합니다.

IsExistingObject

서버에 개체가 있는지 여부를 가져옵니다.

(다음에서 상속됨 ReplicationObject)
LogFile

데이터베이스 트랜잭션 로그 레코드를 저장하는 파일의 이름을 가져오거나 설정합니다.

LogFileSize

데이터베이스 트랜잭션 로그 레코드를 저장하는 파일의 크기를 가져오거나 설정합니다.

LogFolder

데이터베이스 트랜잭션 로그 레코드를 저장하는 파일이 있는 디렉터리 경로를 가져오거나 설정합니다.

MaxDistributionRetention

배포 데이터베이스에서 트랜잭션을 삭제하기 전의 최대 보존 기간(시간)을 가져오거나 설정합니다.

MinDistributionRetention

배포 데이터베이스에서 트랜잭션을 삭제하기 전의 최소 보존 기간(시간)을 가져오거나 설정합니다.

Name

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

QueueReaderAgentExists

이 배포 데이터베이스에 대해 큐 판독기 에이전트 작업이 만들어졌는지 여부를 가져오거나 설정합니다.

QueueReaderAgentName

이 배포 데이터베이스에 대해 만들어진 큐 판독기 에이전트 작업의 이름을 가져오거나 설정합니다.

QueueReaderAgentProcessSecurity

큐 판독기 에이전트 작업을 실행하기 위한 에이전트 프로세스 보안 컨텍스트를 가져옵니다.

SqlServerName

이 개체가 연결된 Microsoft SQL Server 인스턴스의 이름을 가져옵니다.

(다음에서 상속됨 ReplicationObject)
UserData

사용자가 자신의 고유 데이터를 개체에 연결할 수 있도록 하는 개체 속성을 가져오거나 설정합니다.

(다음에서 상속됨 ReplicationObject)

메서드

CheckValidCreation()

유효한 복제 만들기를 확인합니다.

(다음에서 상속됨 ReplicationObject)
CheckValidDefinition(Boolean)

정의가 유효한지 여부를 나타냅니다.

(다음에서 상속됨 ReplicationObject)
CleanUpAnonymousSubscription(Int32, PublicationType)

배포자에서 익명 구독의 메타데이터를 제거합니다.

CommitPropertyChanges()

캐시된 모든 속성 변경 문을 Microsoft SQL Server 인스턴스로 보냅니다.

(다음에서 상속됨 ReplicationObject)
Create()

배포 데이터베이스를 만듭니다.

CreateQueueReaderAgent()

배포 데이터베이스에 큐 판독기 에이전트 작업을 만듭니다.

Decouple()

참조된 복제 개체를 서버에서 분리합니다.

(다음에서 상속됨 ReplicationObject)
GetChangeCommand(StringBuilder, String, String)

복제에서 변경 명령을 반환합니다.

(다음에서 상속됨 ReplicationObject)
GetCreateCommand(StringBuilder, Boolean, ScriptOptions)

복제에서 생성 명령을 반환합니다.

(다음에서 상속됨 ReplicationObject)
GetDropCommand(StringBuilder, Boolean)

복제에서 삭제 명령을 반환합니다.

(다음에서 상속됨 ReplicationObject)
InternalRefresh(Boolean)

복제에서 내부 새로 고침을 시작합니다.

(다음에서 상속됨 ReplicationObject)
Load()

서버에서 기존 개체의 속성을 로드합니다.

(다음에서 상속됨 ReplicationObject)
LoadProperties()

서버에서 기존 개체의 속성을 로드합니다.

(다음에서 상속됨 ReplicationObject)
Refresh()

개체의 속성을 다시 로드합니다.

(다음에서 상속됨 ReplicationObject)
RegisterBusinessLogicHandler(BusinessLogicHandler)

배포자에서 비즈니스 논리 처리기 어셈블리를 등록합니다.

Remove()

배포 데이터베이스를 삭제합니다.

Script(ScriptOptions)

개체가 나타내는 배포 데이터베이스를 만들거나 삭제하는 데 사용할 수 있는 Transact-SQL 스크립트를 생성합니다.

UnregisterBusinessLogicHandler(BusinessLogicHandler)

배포자에서 비즈니스 논리 처리기 등록을 제거합니다.

적용 대상

추가 정보