SQL 2008 R2 서버가 있습니다. 나는 괜찮아 보이는 마법사를 사용하여 발행물을 만들었습니다. '시스템 데이터베이스'섹션에 많이없는 '배포'데이터베이스가 있습니다. (이것이 이미 있는지 또는 "게시 마법사"가 작성했는지 여부는 확실하지 않습니다.) 웹 동기화를 설정하고 IIS7 및 자체 서명 인증서를 통해 relisapi.dll에 액세스 할 수 있습니다.SQL Server 2008 웹을 통한 SQL Express 2005 로의 복제
내 ASP.NET 웹 사이트에 대한 내 설치 프로그램이 SQL Express 2005를 설치합니다. 구독 및 초기 동기화를 테스트하기 위해 약간의 사이트를 작성했습니다. 첫 번째 동기화가 서버에서 모든 데이터를 가져 오는 것으로 가정 할 때 "초기 데이터베이스"를 만들지 않습니다.
다음 코드 비트는 SQL 2008 서버의 SQL Express &에 구독이 만들어 졌기 때문에 작동하는 것 같습니다. 그런 다음
' Define the pull subscription.
subscription = New MergePullSubscription()
subscription.ConnectionContext = subscriberConn
subscription.PublisherName = publisherName
subscription.PublicationName = publicationName
subscription.PublicationDBName = publicationDbName
subscription.DatabaseName = subscriptionDbName
subscription.HostName = hostname
subscription.CreateSyncAgentByDefault = True
' Specify the Windows login credentials for the Merge Agent job.
subscription.SynchronizationAgentProcessSecurity.Login = winLogin
subscription.SynchronizationAgentProcessSecurity.Password = winPassword
' Enable Web synchronization.
subscription.UseWebSynchronization = True
subscription.InternetUrl = webSyncUrl
' Specify the same Windows credentials to use when connecting to the
' Web server using HTTPS Basic Authentication.
subscription.InternetSecurityMode = AuthenticationMethod.BasicAuthentication
subscription.InternetLogin = winLogin
subscription.InternetPassword = winPassword
If Not subscription.LoadProperties() Then
' Create the pull subscription at the Subscriber.
subscription.Create()
나는 코드의이 비트 실행
If Not subscription.PublisherSecurity Is Nothing Or _
subscription.DistributorSecurity Is Nothing Then
'0: Only error messages are logged.
'1: All progress report messages are logged.
'2: All progress report messages and error messages are logged.
subscription.SynchronizationAgent.OutputVerboseLevel = 2
subscription.SynchronizationAgent.Output = "c:\createmerge.txt"
' Synchronously start the Merge Agent for the subscription.
subscription.SynchronizationAgent.Synchronize()
을하지만 syncronize 오류 발생 : 서버에서
The subscription to publication 'My publication' could not be verified. Ensure that all Merge Agent command line parameters are specified correctly and that the subscription is correctly configured. If the Publisher no longer has information about this subscription, drop and recreate the subscription.
, 내 구독을 보여주고있다 "복제 모니터"를 사용하여 "Unitialized"로.
하나의 문제는 내 subscription.HostName이 잘못되었다고 생각합니다. MSDN의 Microsoft 예제
"adventure-works\garrett1"
말을하지만 모험 작품은 서버, 인스턴스 또는 데이터베이스이며, garrett1 (로그인 또는 뭔가 다른) 사람인지는 명확하지 않다. 그렇다면이게 실제로 무엇일까?
복제에 대해 전혀 알지 못하기 때문에 MSDN과 일부 책을 따라 왔으므로 다음에 어디로 가야하는지에 대해 몇 가지 조언을 전합니다.
죄송합니다. 너무 오래되었습니다.