방법: 끌어오기 구독 동기화(Replication Programming)

끌어오기 구독은 명령 프롬프트에서 적합한 복제 에이전트 실행 파일을 호출하여 프로그래밍 방식으로 요청 시 동기화할 수 있습니다. 호출한 복제 에이전트 실행 파일은 끌어오기 구독이 속한 게시 유형에 따라 달라집니다.

[!참고] 복제 에이전트는 명령 프롬프트에서 에이전트를 시작한 사용자의 Windows 인증 자격 증명을 사용하여 로컬 서버에 연결합니다. 이러한 자격 증명은 Windows 통합 인증을 사용하여 원격 서버에 연결할 때도 사용됩니다.

명령 프롬프트 또는 배치 파일에서 배포 에이전트를 시작하려면

  1. 명령 프롬프트 또는 배치 파일에서 distrib.exe를 실행하여 복제 배포 에이전트를 시작하고 다음 명령줄 인수를 지정합니다.

    • -Publisher
    • -PublisherDB
    • -Distributor
    • -DistributorSecurityMode = 1
    • -Subscriber
    • -SubscriberDB
    • -SubscriberSecurityMode = 1
    • -SubscriptionType = 1

    SQL 인증을 사용하는 경우 다음 인수도 지정해야 합니다.

    • -DistributorLogin
    • -DistributorPassword
    • -DistributorSecurityMode = 0
    • -PublisherLogin
    • -PublisherPassword
    • -PublisherSecurityMode = 0
    • -SubscriberLogin
    • -SubscriberPassword
    • -SubscriberSecurityMode = 0

명령 프롬프트 또는 배치 파일에서 병합 에이전트를 시작하려면

  1. 명령 프롬프트 또는 배치 파일에서 replmerg.exe를 실행하여 복제 병합 에이전트를 시작하고 다음 명령줄 인수를 지정합니다.

    • -Publisher
    • -PublisherDB
    • -PublisherSecurityMode = 1
    • -Publication
    • -Distributor
    • -DistributorSecurityMode = 1
    • -Subscriber
    • -SubscriberSecurityMode = 1
    • -SubscriberDB
    • -SubscriptionType = 1

    SQL 인증을 사용하는 경우 다음 인수도 지정해야 합니다.

    • -DistributorLogin
    • -DistributorPassword
    • -DistributorSecurityMode = 0
    • -PublisherLogin
    • -PublisherPassword
    • -PublisherSecurityMode = 0
    • -SubscriberLogin
    • -SubscriberPassword
    • -SubscriberSecurityMode = 0

다음 예에서는 배포 에이전트를 시작하여 끌어오기 구독을 동기화합니다. 모든 연결은 Windows 인증을 사용하여 만듭니다.

REM -- Declare the variables.
SET Publisher=%instancename%
SET Subscriber=%instancename%
SET PublicationDB=AdventureWorks
SET SubscriptionDB=AdventureWorksReplica 
SET Publication=AdvWorksProductsTran

REM -- Start the Distribution Agent.
REM -- The following command must be supplied without line breaks.
"C:\Program Files\Microsoft SQL Server\90\COM\DISTRIB.EXE" -Subscriber %Subscriber% 
-SubscriberDB %SubscriptionDB% -SubscriberSecurityMode 1 -Publication %Publication% 
-Publisher %Publisher% -PublisherDB %PublicationDB% -Distributor %Publisher% 
-DistributorSecurityMode 1 -Continuous -SubscriptionType 1

다음 예에서는 병합 에이전트를 시작하여 끌어오기 구독을 동기화합니다. 모든 연결은 Windows 인증을 사용하여 만듭니다.

REM -- Declare the variables.
SET Publisher=%instancename%
SET Subscriber=%instancename%
SET PublicationDB=AdventureWorks
SET SubscriptionDB=AdventureWorksReplica 
SET Publication=AdvWorksSalesOrdersMerge

REM --Start the Merge Agent with concurrent upload and download processes.
REM -- The following command must be supplied without line breaks.
"C:\Program Files\Microsoft SQL Server\90\COM\REPLMERG.EXE" -Publication %Publication%  
-Publisher %Publisher%  -Subscriber  %Subscriber%  -Distributor %Publisher%  
-PublisherDB %PublicationDB%  -SubscriberDB %SubscriptionDB% -PublisherSecurityMode 1  
-OutputVerboseLevel 2  -SubscriberSecurityMode 1  -SubscriptionType 1 -DistributorSecurityMode 1  
-Validate 3  -ParallelUploadDownload 1 

참고 항목

작업

방법: 끌어오기 구독 동기화(RMO Programming)

관련 자료

방법: 끌어오기 구독 동기화(SQL Server Management Studio)
데이터 동기화

도움말 및 정보

SQL Server 2005 지원 받기