[quoted text, click to view] On Apr 11, 1:31 pm, narasimha...@gmail.com wrote:
> Hi,
> I have the following setup Merge replication with Web Synchronization:
> Server: SQL Server 2005
> Subscriber: SQL Server Express edition
>
> The system uses parametrized filters based on HOST_NAME and I have
> selected 'Automatically define a partition and generate a snapshot
> when a new subscriber tries to synchronize'
>
> To reduce the size of the initial snapshot I have selected to
> 'compress' the snapshot files.
>
> It works fine in most of the cases but sometimes when I initialize a
> new subscriber, replication process fails with the error:
>
> Message
> Replication-Replication Merge Subsystem: agent 25BCC8D2-968E-4CEE-
> B408-2DEF3210F682 failed. The Merge Agent failed to retrieve the
> snapshot schema script file '\\db101\BQ_REPL_SHARE\unc
> \DB101_BQDB_QA_BQ_WEB_REPL\20070411090593\dynsnapvalidation.tok'. Run
> the Snapshot Agent to regenerate the snapshot files for this
> publication.
>
> If I regenerate the snapshot for the subscriber, and then replicate
> again it works fine. This is turning out to be an issue as I have to
> compress the snapshot files as they are huge.
>
> And I cannot use 'Initializing a subscription without snapshot' due to
> this error: <
http://forums.microsoft.com/msdn/ShowPost.aspx? > postid=1458147&siteid=1>
>
> Help me
>
> PS: (Applied SP2 Patch, but the problem still persists)
>
> Reply back to:
> narasimha (DOT) gm (AT) gmail (DOT) com
For reference here is the t-sql subscription code, and the vb.net that
initiates replication:
use [BQ_DEV_CLIENT]
exec sp_addmergepullsubscription
@publisher = N'DB101-EQA-SCL',
@publication = N'BQ_PUB',
@publisher_db = N'BQDB',
@subscriber_type = N'Anonymous',
@subscription_priority = 0,
@description = N'',
@sync_type = N'Automatic'
GO
exec sp_addmergepullsubscription_agent
@publisher = N'DB101-EQA-SCL',
@publisher_db = N'BQDB',
@publication = N'BQ_PUB',
@distributor = N'DB101-EQA-SCL',
@distributor_security_mode = 1,
@distributor_login = N'user',
@distributor_password = N'user',
@enabled_for_syncmgr = N'False',
@alt_snapshot_folder = N'',
@working_directory = N'',
@use_ftp = N'False',
-- @job_login = null,
-- @job_password = null,
@publisher_security_mode = 1,
@publisher_login = N'user',
@publisher_password = N'user',
@use_interactive_resolver = N'False',
@dynamic_snapshot_location = N'',
@use_web_sync = 1,
@internet_url = N'https://company/BQREPL/replisapi.dll',
@internet_login = N'USIRU01',
@internet_password = N'pass',
@internet_security_mode = 0,
@internet_timeout = 1800,
@hostname = 'MY_MACHINE'
GO
VB.net code:
Dim subSqlCon As SqlConnection = New SqlConnection(m_subSqlConStr)
Dim pubSqlCon As SqlConnection = New SqlConnection(m_pubSqlConStr)
Dim subscriberConn As ServerConnection = New
ServerConnection(subSqlCon)
Dim publisherConn As ServerConnection = New
ServerConnection(pubSqlCon)
subscriberConn.Connect()
Dim subscription As MergePullSubscription = New
MergePullSubscription(m_subscriberDBName, m_publisherMachineName,
m_publisherDBName, m_publicationName, subscriberConn)
If subscription.LoadProperties() Then
If Not subscription.PublisherSecurity Is Nothing
Then
Dim agent As MergeSynchronizationAgent =
subscription.SynchronizationAgent
agent.DistributorSecurityMode =
SecurityMode.Standard
agent.DistributorPassword = m_distributorPassword
agent.DistributorLogin = m_distributorUserName
agent.PublisherSecurityMode =
SecurityMode.Standard
agent.PublisherPassword = m_publisherPassword
agent.PublisherLogin =
m_publisherUserName
'Set the event handler to capture output
messages
AddHandler agent.Status, New
AgentCore.StatusEventHandler(AddressOf Me.agent_Status)
agent.Synchronize()
End if