언어

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

설명

스레드 안전성

이 유형의 공용 정적(SharedMicrosoft Visual Basic) 멤버는 멀티스레드 연산에 안전합니다. 모든 인스턴스 멤버는 스레드로부터 안전하게 보호되지 않습니다.

생성자

Name Description
DistributionDatabase()

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

DistributionDatabase(String, ServerConnection)

지정된 데이터베이스 이름과 Distributor와의 연결을 가진 클래스의 DistributionDatabase 새로운 인스턴스를 생성합니다.

속성

Name Description
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

이 배포 데이터베이스에 대해 Queue Reader Agent 작업이 생성되었는지 여부를 획득하거나 설정합니다.

QueueReaderAgentName

이 배포 데이터베이스를 위해 생성된 큐 리더 에이전트 작업의 이름을 받거나 설정합니다.

QueueReaderAgentProcessSecurity

Queue Reader Agent 작업을 실행하기 위한 에이전트 프로세스 보안 컨텍스트를 얻습니다.

SqlServerName

이 객체가 연결된 Microsoft SQL Server 인스턴스의 이름을 얻습니다.

(다음에서 상속됨 ReplicationObject)
UserData

사용자가 자신의 데이터를 객체에 부착할 수 있도록 객체 속성을 얻거나 설정합니다.

(다음에서 상속됨 ReplicationObject)

메서드

Name Description
CheckValidCreation()

유효한 복제 생성을 확인합니다.

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

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

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

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

CommitPropertyChanges()

모든 캐시된 속성 변경 문장을 Microsoft SQL Server 인스턴스로 전송합니다.

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

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

CreateQueueReaderAgent()

배포 데이터베이스에서 Queue Reader Agent 작업을 생성합니다.

Decouple()

참조된 복제 객체를 서버와 분리합니다.

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

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

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

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

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

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

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

복제에서 내부 갱신을 시작합니다.

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

서버에서 기존 객체의 속성을 불러옵니다.

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

서버에서 기존 객체의 속성을 불러옵니다.

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

객체의 속성을 다시 불러옵니다.

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

Distributor에서 비즈니스 로직 핸들러 어셈블리를 등록합니다.

Remove()

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

Script(ScriptOptions)

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

UnregisterBusinessLogicHandler(BusinessLogicHandler)

Distributor에서 비즈니스 로직 핸들러의 등록을 제거합니다.

적용 대상

추가 정보