Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Wednesday, March 28, 2012

merge replication with pull subscriber(compress snapshot)

Hi
I am trying to implement merge publication with compress snapshot, copy it
to the subscriber,
create a pull subscriber with the alternate folder(where the snapshot was
copied to)
and then run the agent for synchronization (first time).
i get error that the table in the publication does not exist in the
subscriber database.
It seems that the agent ignores the snapshot and it tries to just merge the
changes between publisher and subscriber.
when i create the table manually at the subscriber with the rowguid column,
it does not fail but it stills does not aplly the snapshot.
if i update/insert new row and run the agent it does merge the changes.
am i missing a crucial step in the process that causes that problem?
Thanks in advance
Daniel
daniel
Please can you post up the error message in its entirety. I suspect that it
is related to a script missing. Also, please try not using the CAB file
method. If you need to compress the snapshot, zip it up and unzip on the
subscriber (I only say this because I've never tested using an alternative
folder with a CAB file).
Paul Ibison
|||Hi and thank u for the replying.
When i start the agent for the first time i get the following error:
"Table 't3' does not exist in the Subscriber database."
At the log i can see that he does try to get the snapshot from alternate
folder:
" Snapshot will be applied from the alternate folder ..."
thanks in advance
Daniel
daniel
"Paul Ibison" wrote:

> Please can you post up the error message in its entirety. I suspect that it
> is related to a script missing. Also, please try not using the CAB file
> method. If you need to compress the snapshot, zip it up and unzip on the
> subscriber (I only say this because I've never tested using an alternative
> folder with a CAB file).
> Paul Ibison
|||Interesting - if you enable full logging is there more info? Also, are you
using the uncompressed snapshot files (if not please try this way also)? In
the snapshot files do you see the table creation script for t3?
(the alternative to this investigation if you like is to do a nosync
initialization).
Paul Ibison
|||Hi Paul
Yes there is a script for table creation.
I tried to use the uncompressed and i got the same error.
How do i do the no sync initialization?
daniel
"Paul Ibison" wrote:

> Interesting - if you enable full logging is there more info? Also, are you
> using the uncompressed snapshot files (if not please try this way also)? In
> the snapshot files do you see the table creation script for t3?
> (the alternative to this investigation if you like is to do a nosync
> initialization).
> Paul Ibison
|||Please have a look here. It largely applies to transactional, but mostly the
same info applies: http://www.replicationanswers.com/NoSyncInitializations.asp
HTH,
Paul Ibison

Monday, March 26, 2012

Merge Replication using Web Sync - Proxy Auto config problem

Hi

I am trying to setup merge replication using web sync. I keep on getting the message: The Proxy Auto-configuration URL was not found. Yes I have read all the postings telling me to check my internet explorer settings concerning proxy server and auto-detection - I am not using a proxy - auto detection is unchecked.

Does anyone have another clue?

Thanks

Alex

2006-08-16 15:31:09.375 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.437 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.453 The upload message to be sent to Publisher 'CRAW' is being generated
2006-08-16 15:31:09.453 The merge process is using Exchange ID '20E2BF4F-8812-431F-8BF8-94A44B80C16E' for this web synchronization session.
2006-08-16 15:31:09.500 The Proxy Auto-configuration URL was not found.

After having no clue where to go on I decided to try it again setting it up using RMO.

Worked without even mentioning the proxy auto config

Imports Microsoft.SqlServer.Replication

Imports Microsoft.SqlServer.Management.Common

Public Class Replication

Private subscriberName As String

Private publisherName As String

Private windowsLogin As String

Private windowsPWD As String

Private publicationName As String

Private publicationDbName As String

Private subscriptionDbName As String

Private Hostname As String

Sub New(ByVal EntityID As Guid, ByVal SubscriberHost As String, ByVal PublisherHost As String, ByVal Login As String, ByVal PWD As String, ByVal Publication As String, ByVal PublicationDB As String, ByVal SubscriptionDB As String)

subscriberName = SubscriberHost

publisherName = PublisherHost

'the guid of the entity is passed as hostname to be used for filtering

Hostname = EntityID.ToString.ToUpper

windowsLogin = Login

windowsPWD = PWD

publicationName = Publication

subscriptionDbName = SubscriptionDB

publicationDbName = PublicationDB

End Sub

Sub SetupWebPull()

Dim webSyncUrl As String = "https://myhost/websync/replisapi.dll"

'Create connections to the Publisher and Subscriber.

Dim subscriberConn As ServerConnection = New ServerConnection(subscriberName)

Dim publisherConn As ServerConnection = New ServerConnection(publisherName)

' Create the objects that we need.

Dim publication As MergePublication

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

subscriberConn.Connect()

' Ensure that the publication exists and that

' it supports pull subscriptions and Web synchronization.

publication = New MergePublication()

publication.Name = publicationName

publication.DatabaseName = publicationDbName

publication.ConnectionContext = publisherConn

If publication.LoadProperties() Then

If (publication.Attributes And PublicationAttributes.AllowPull) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowPull

End If

If (publication.Attributes And PublicationAttributes.AllowWebSynchronization) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowWebSynchronization

End If

' 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 = windowsLogin

subscription.SynchronizationAgentProcessSecurity.Password = windowsPWD

' 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 = windowsLogin

subscription.InternetPassword = windowsPWD

' Create the pull subscription at the Subscriber.

subscription.Create()

Dim registered As Boolean = False

' Verify that the subscription is not already registered.

For Each existing As MergeSubscription In publication.EnumSubscriptions()

If existing.SubscriberName = subscriberName Then

registered = True

End If

Next

If Not registered Then

' Register the local subscription with the Publisher.

publication.MakePullSubscriptionWellKnown(subscriberName, subscriptionDbName, SubscriptionSyncType.Automatic, MergeSubscriberType.Local, 0)

End If

Else

' Do something here if the publication does not exist.

Throw New ApplicationException(String.Format("The publication '{0}' does not exist on {1}.", publicationName, publisherName))

End If

Catch ex As Exception

' Implement the appropriate error handling here.

Throw New ApplicationException(String.Format("The subscription to {0} could not be created.", publicationName), ex)

Finally

subscriberConn.Disconnect()

publisherConn.Disconnect()

End Try

End Sub

Sub PullMergeReplication()

' Create a connection to the Subscriber.

Dim conn As ServerConnection = New ServerConnection(subscriberName)

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

conn.Connect()

' Define subscription properties.

subscription = New MergePullSubscription()

subscription.ConnectionContext = conn

subscription.DatabaseName = subscriptionDbName

subscription.PublisherName = publisherName

subscription.PublicationDBName = publicationDbName

subscription.PublicationName = publicationName

' If the pull subscription and the job exists, start the agent job.

If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then

subscription.SynchronizeWithJob()

Else

' Do something here if the subscription does not exist.

Throw New ApplicationException(String.Format("A subscription to '{0}' does not exists on {1}", publicationName, subscriberName))

End If

Catch ex As Exception

' Do appropriate error handling here.

Throw New ApplicationException("The subscription could not be synchronized.", ex)

Finally

conn.Disconnect()

End Try

End Sub

End Class

|||?

I ran into a similar problem. It could be related to certificates. How did you generate your certificate?


--
Hilary Cotter

|||it is a problem with CA certificate;
on subscriber:
1. log on as user from which you try to run sync application
(if it is a windows service log on as service account)
2. install CA certificate ("Automatically select certificate store...")
3. test web page in IE (https://site_location/replisapi.dll)
4. In "Internet Options" -> "Connections" -> "Lan Settings" uncheck "Automatically detect settings"
5. run sync app.
6. enjoysql

Merge Replication using Web Sync - Proxy Auto config problem

Hi

I am trying to setup merge replication using web sync. I keep on getting the message: The Proxy Auto-configuration URL was not found. Yes I have read all the postings telling me to check my internet explorer settings concerning proxy server and auto-detection - I am not using a proxy - auto detection is unchecked.

Does anyone have another clue?

Thanks

Alex

2006-08-16 15:31:09.375 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.437 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.453 The upload message to be sent to Publisher 'CRAW' is being generated
2006-08-16 15:31:09.453 The merge process is using Exchange ID '20E2BF4F-8812-431F-8BF8-94A44B80C16E' for this web synchronization session.
2006-08-16 15:31:09.500 The Proxy Auto-configuration URL was not found.

After having no clue where to go on I decided to try it again setting it up using RMO.

Worked without even mentioning the proxy auto config

Imports Microsoft.SqlServer.Replication

Imports Microsoft.SqlServer.Management.Common

Public Class Replication

Private subscriberName As String

Private publisherName As String

Private windowsLogin As String

Private windowsPWD As String

Private publicationName As String

Private publicationDbName As String

Private subscriptionDbName As String

Private Hostname As String

Sub New(ByVal EntityID As Guid, ByVal SubscriberHost As String, ByVal PublisherHost As String, ByVal Login As String, ByVal PWD As String, ByVal Publication As String, ByVal PublicationDB As String, ByVal SubscriptionDB As String)

subscriberName = SubscriberHost

publisherName = PublisherHost

'the guid of the entity is passed as hostname to be used for filtering

Hostname = EntityID.ToString.ToUpper

windowsLogin = Login

windowsPWD = PWD

publicationName = Publication

subscriptionDbName = SubscriptionDB

publicationDbName = PublicationDB

End Sub

Sub SetupWebPull()

Dim webSyncUrl As String = "https://myhost/websync/replisapi.dll"

'Create connections to the Publisher and Subscriber.

Dim subscriberConn As ServerConnection = New ServerConnection(subscriberName)

Dim publisherConn As ServerConnection = New ServerConnection(publisherName)

' Create the objects that we need.

Dim publication As MergePublication

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

subscriberConn.Connect()

' Ensure that the publication exists and that

' it supports pull subscriptions and Web synchronization.

publication = New MergePublication()

publication.Name = publicationName

publication.DatabaseName = publicationDbName

publication.ConnectionContext = publisherConn

If publication.LoadProperties() Then

If (publication.Attributes And PublicationAttributes.AllowPull) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowPull

End If

If (publication.Attributes And PublicationAttributes.AllowWebSynchronization) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowWebSynchronization

End If

' 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 = windowsLogin

subscription.SynchronizationAgentProcessSecurity.Password = windowsPWD

' 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 = windowsLogin

subscription.InternetPassword = windowsPWD

' Create the pull subscription at the Subscriber.

subscription.Create()

Dim registered As Boolean = False

' Verify that the subscription is not already registered.

For Each existing As MergeSubscription In publication.EnumSubscriptions()

If existing.SubscriberName = subscriberName Then

registered = True

End If

Next

If Not registered Then

' Register the local subscription with the Publisher.

publication.MakePullSubscriptionWellKnown(subscriberName, subscriptionDbName, SubscriptionSyncType.Automatic, MergeSubscriberType.Local, 0)

End If

Else

' Do something here if the publication does not exist.

Throw New ApplicationException(String.Format("The publication '{0}' does not exist on {1}.", publicationName, publisherName))

End If

Catch ex As Exception

' Implement the appropriate error handling here.

Throw New ApplicationException(String.Format("The subscription to {0} could not be created.", publicationName), ex)

Finally

subscriberConn.Disconnect()

publisherConn.Disconnect()

End Try

End Sub

Sub PullMergeReplication()

' Create a connection to the Subscriber.

Dim conn As ServerConnection = New ServerConnection(subscriberName)

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

conn.Connect()

' Define subscription properties.

subscription = New MergePullSubscription()

subscription.ConnectionContext = conn

subscription.DatabaseName = subscriptionDbName

subscription.PublisherName = publisherName

subscription.PublicationDBName = publicationDbName

subscription.PublicationName = publicationName

' If the pull subscription and the job exists, start the agent job.

If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then

subscription.SynchronizeWithJob()

Else

' Do something here if the subscription does not exist.

Throw New ApplicationException(String.Format("A subscription to '{0}' does not exists on {1}", publicationName, subscriberName))

End If

Catch ex As Exception

' Do appropriate error handling here.

Throw New ApplicationException("The subscription could not be synchronized.", ex)

Finally

conn.Disconnect()

End Try

End Sub

End Class

|||?

I ran into a similar problem. It could be related to certificates. How did you generate your certificate?


--
Hilary Cotter

|||it is a problem with CA certificate;
on subscriber:
1. log on as user from which you try to run sync application
(if it is a windows service log on as service account)
2. install CA certificate ("Automatically select certificate store...")
3. test web page in IE (https://site_location/replisapi.dll)
4. In "Internet Options" -> "Connections" -> "Lan Settings" uncheck "Automatically detect settings"
5. run sync app.
6. enjoy

Monday, March 19, 2012

Merge replication Option

Hi
I am looking for a way to avoid the option of 'Yes initialize the Schema and
the data' (which I suspect is the source of some problems) when I create a
new subscription
Thank you,
Samuel
Its no problem to do this with named subscriptions in merge replication.
Anonymous requires a snapshot.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Samuel Shulman" <samuel.shulman@.ntlworld.com> wrote in message
news:%23768oty4GHA.1460@.TK2MSFTNGP05.phx.gbl...
> Hi
> I am looking for a way to avoid the option of 'Yes initialize the Schema
> and the data' (which I suspect is the source of some problems) when I
> create a new subscription
> Thank you,
> Samuel
>
>
|||How can I cheese a Named Subscription?
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%23owZLBz4GHA.3600@.TK2MSFTNGP03.phx.gbl...
> Its no problem to do this with named subscriptions in merge replication.
> Anonymous requires a snapshot.
> --
> Hilary Cotter
> Director of Text Mining and Database Strategy
> RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
> This posting is my own and doesn't necessarily represent RelevantNoise's
> positions, strategies or opinions.
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Samuel Shulman" <samuel.shulman@.ntlworld.com> wrote in message
> news:%23768oty4GHA.1460@.TK2MSFTNGP05.phx.gbl...
>
|||What you are referring to is a nosync initialization. I have a couple of
articles on this that will hopefully help a bit:
http://www.replicationanswers.com/No...alizations.asp
http://www.replicationanswers.com/NoSyncOn2005.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Wednesday, March 7, 2012

merge replication error - could not find stored procedure ''.

Hi
I have a client which has a merge subscription - anonymous ftp
When synchronising we see the following error message at the publisher:
Error Message:
The merge process could not retrieve column information for table
'dbo.Transfer'.
(Source: Merge Replication Provider (Agent); Error number: -2147201016)
------
Could not find stored procedure ''.
(Source: LOUISEPC (Data source); Error number: 2812)
------
What does this mean ?
Thanks
Bruce
does this help?
http://support.microsoft.com/default...b;en-us;308743
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Bruce Baker" <bruceb@.ardex.com.au> wrote in message
news:%23DHMBbVrFHA.1168@.TK2MSFTNGP10.phx.gbl...
> Hi
> I have a client which has a merge subscription - anonymous ftp
> When synchronising we see the following error message at the publisher:
> Error Message:
> The merge process could not retrieve column information for table
> 'dbo.Transfer'.
> (Source: Merge Replication Provider (Agent); Error number: -2147201016)
> ----
--
> Could not find stored procedure ''.
> (Source: LOUISEPC (Data source); Error number: 2812)
> ----
--
>
> What does this mean ?
> Thanks
> Bruce
>
>
|||Not really - it was working - for some reason the procs for the table are
missing from the sysmergearticles table.
Any bright ideas on repopulating that table ? Wonder what else is bung....
Thanks
Bruce
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:%233tiAZprFHA.1252@.TK2MSFTNGP09.phx.gbl...
> does this help?
> http://support.microsoft.com/default...b;en-us;308743
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Bruce Baker" <bruceb@.ardex.com.au> wrote in message
> news:%23DHMBbVrFHA.1168@.TK2MSFTNGP10.phx.gbl...
> --
> --
>
|||You can manually populate these tables with the correct procs. It will be
somewhat difficult to figure out what these procs names should be. You will
have to open these procs to find out which underlying tables they populate
and go from there.
You are best in the long run to drop the subscribers, and then re deploy
them.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Bruce Baker" <bruceb@.newsgroups.nospam> wrote in message
news:OiBu4NurFHA.1252@.TK2MSFTNGP09.phx.gbl...
> Not really - it was working - for some reason the procs for the table are
> missing from the sysmergearticles table.
> Any bright ideas on repopulating that table ? Wonder what else is
bung....[vbcol=seagreen]
> Thanks
> Bruce
>
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:%233tiAZprFHA.1252@.TK2MSFTNGP09.phx.gbl...
-[vbcol=seagreen]
-
>

Saturday, February 25, 2012

Merge Replication Could not connect

Hi!
I have problem with Merge Replication between two SqlServers connected via
internet.
After i configured publication and subscriber, when i trying to synhronize
i'm obtaining The process could not access to the Subscriber"
thanks in advance

pozdrawiam
Jakub Gluszkiewicz
k.gluszkiewicz@.citysoftware.com.pl
www.citysoftware.com.pl
tel. (22) 869-51-76
869-51-77
kom. 503-680-864
Are you using FTP? You should be using FTP. Also can the subscriber ping the
publisher and vice versa.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Kuba" <k.gluszkiewicz@.citysoftware.com.pl> wrote in message
news:OrnZerPjEHA.1656@.TK2MSFTNGP09.phx.gbl...
> Hi!
> I have problem with Merge Replication between two SqlServers connected via
> internet.
> After i configured publication and subscriber, when i trying to synhronize
> i'm obtaining The process could not access to the Subscriber"
> thanks in advance
>
> --
> pozdrawiam
> Jakub Gluszkiewicz
> k.gluszkiewicz@.citysoftware.com.pl
> www.citysoftware.com.pl
> tel. (22) 869-51-76
> 869-51-77
> kom. 503-680-864
>
>
|||Hi Hilary!
thanks for your response. I already solved this problem, i needed to add
aliases in SqlServer,
thanks again
pozdrawiam
Jakub Gluszkiewicz
k.gluszkiewicz@.citysoftware.com.pl
www.citysoftware.com.pl
tel. (22) 869-51-76
869-51-77
kom. 503-680-864
Uytkownik "Hilary Cotter" <hilary.cotter@.gmail.com> napisa w wiadomoci
news:uStcj8RjEHA.396@.TK2MSFTNGP12.phx.gbl...
> Are you using FTP? You should be using FTP. Also can the subscriber ping
the[vbcol=seagreen]
> publisher and vice versa.
>
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Kuba" <k.gluszkiewicz@.citysoftware.com.pl> wrote in message
> news:OrnZerPjEHA.1656@.TK2MSFTNGP09.phx.gbl...
via[vbcol=seagreen]
synhronize
>

Merge replication and synchronization

Hi!
i have big problem, i had to remove my merge replication (between Sql2000
MSDE, one way replication only from Publisher to Subsciber). After
recreating this replication, merge agent do not wan't to merge any data, i'm
obtaining NO DATA NEED TO BE MERGED.
i can update all values (by SQL Updatte) in replication tables and merge
will see this data, but what about deletes?
my question is, is it possible to make FULL synchronization between
subscriber and publicator?
thanks
Kuba
It sure is. Let me see if I understand you. You had a working publication
subscriber. You removed the publication. You recreated it, and now the data
does not flow from the publisher to the subscriber, or only updates flow?
How did you recreate the subscriber? At this point it is probably best if
you drop the publication and recreate it, and redeploy the snapshot. Do not
use the no sync option.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Kuba" <k.gluszkiewicz@.citysoftware.com.pl> wrote in message
news:u%23YxQFymEHA.1904@.TK2MSFTNGP09.phx.gbl...
> Hi!
> i have big problem, i had to remove my merge replication (between Sql2000
> MSDE, one way replication only from Publisher to Subsciber). After
> recreating this replication, merge agent do not wan't to merge any data,
i'm
> obtaining NO DATA NEED TO BE MERGED.
> i can update all values (by SQL Updatte) in replication tables and merge
> will see this data, but what about deletes?
> my question is, is it possible to make FULL synchronization between
> subscriber and publicator?
> thanks
> Kuba
>
|||Hi Hilary!
i had a merge replication which works fine
someday i had to remove this replication, i removed subscibers (after that i
used on subscribers sp_mergesubscription_cleanup stored procdure) and next
i removed publication.
after that user whose working on publication machine made a lot of data
changes
after few days i created replication process again (publisher and
subscibers),
now merge agent do not see which records was deleted in publisher database
when my replication was removed, my subscribers inlcudes too many records,
which should be deleted
sorry Hilary for my english, i tried to explain it clearly, i hope you will
understand me
tanks in advance
Kuba
Uytkownik "Hilary Cotter" <hilary.cotter@.gmail.com> napisa w wiadomoci
news:%23nMEWt%23mEHA.3820@.TK2MSFTNGP09.phx.gbl...
> It sure is. Let me see if I understand you. You had a working publication
> subscriber. You removed the publication. You recreated it, and now the
data
> does not flow from the publisher to the subscriber, or only updates flow?
> How did you recreate the subscriber? At this point it is probably best if
> you drop the publication and recreate it, and redeploy the snapshot. Do
not[vbcol=seagreen]
> use the no sync option.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
> "Kuba" <k.gluszkiewicz@.citysoftware.com.pl> wrote in message
> news:u%23YxQFymEHA.1904@.TK2MSFTNGP09.phx.gbl...
Sql2000
> i'm
>
|||Sounds like you didn't re-apply the snapshot at the subscriber...
"Kuba" wrote:

> Hi Hilary!
> i had a merge replication which works fine
> someday i had to remove this replication, i removed subscibers (after that i
> used on subscribers sp_mergesubscription_cleanup stored procdure) and next
> i removed publication.
> after that user whose working on publication machine made a lot of data
> changes
> after few days i created replication process again (publisher and
> subscibers),
> now merge agent do not see which records was deleted in publisher database
> when my replication was removed, my subscribers inlcudes too many records,
> which should be deleted
> sorry Hilary for my english, i tried to explain it clearly, i hope you will
> understand me
> tanks in advance
> Kuba
> U?ytkownik "Hilary Cotter" <hilary.cotter@.gmail.com> napisa3 w wiadomo?ci
> news:%23nMEWt%23mEHA.3820@.TK2MSFTNGP09.phx.gbl...
> data
> not
> Sql2000
>
>
|||dzien dobry.
Your English is better than my Polish
Right click on your merge publication and select view conflicts. This may
explain why some of your data is inconsistent.
I'm still unsure if you did a no sync subscription (the subscriber already
has the schema and data) or not. If you did a no sync, the best way to get
everything in a consistent state is to redeploy your subscription again. If
you did not do a no sync, right click on your publication and reinitialize.
Then start up your snapshot agent, and when it shuts itself down, start up
your merge agent.
if you did a no sync, you should drop your subscription and then either
1) backup your publication database and restore it on your subsciber and
then do another no sync subscription or
2) do a sync subscription (the subscriber does not have the schema and
data).
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Kuba" <k.gluszkiewicz@.citysoftware.com.pl> wrote in message
news:O9P1Uc$mEHA.3896@.TK2MSFTNGP15.phx.gbl...
> Hi Hilary!
> i had a merge replication which works fine
> someday i had to remove this replication, i removed subscibers (after that
i
> used on subscribers sp_mergesubscription_cleanup stored procdure) and
next
> i removed publication.
> after that user whose working on publication machine made a lot of data
> changes
> after few days i created replication process again (publisher and
> subscibers),
> now merge agent do not see which records was deleted in publisher database
> when my replication was removed, my subscribers inlcudes too many records,
> which should be deleted
> sorry Hilary for my english, i tried to explain it clearly, i hope you
will[vbcol=seagreen]
> understand me
> tanks in advance
> Kuba
> Uytkownik "Hilary Cotter" <hilary.cotter@.gmail.com> napisa w wiadomoci
> news:%23nMEWt%23mEHA.3820@.TK2MSFTNGP09.phx.gbl...
publication[vbcol=seagreen]
> data
flow?[vbcol=seagreen]
if[vbcol=seagreen]
> not
> Sql2000
data,[vbcol=seagreen]
merge
>

Monday, February 20, 2012

Merge replication and dynamic filters question

Hi!
I have a schema that looks like this, on my main server:
tableFiles:
FileID (PK)
FileName
table FileProperties
PropertyID
FileID (FK Files.FileID) (PK)
PropertyName (PK)
PropertyValue
table Hosts_Files
HostName (PK)
FileID (PK)
Now what I want to achieve is this:
There are many clients that use this database. Sometimes they go
offline and take some of the files with them to work offline.
When this occurs, I want to replicate the entire table Files, and only
the rows from FileProperties that have to do with the files they
downloaded to their computer (marked so in Hosts_Files).
Can I make this work with merge replication? I tried but the dynamic
filters I can write are either JOIN or WHERE (or am I wrong?) so I
couldn't manage to do a join between FileProperties and Hosts_Files
only where Hosts_Files.HostName = host_name().
Thanks in advance for answering,
Zzzbla
You could join these tables in the merge publication. Filtering in this case
is a bit tricky as it looks as though you want to change the filter
effectively dynamically. I'm assuming that there is a typo somewhere, as
this doesn't seem to make logical sense: "I want to replicate the entire
table Files, and only the rows from FileProperties that have to do with the
files they downloaded to their computer" - this would seem to imply all
FileProperties. The way I read your requirements are that you want users to
select certain files and have just associated details downloaded? If this is
the case, you can have a further table which relates fileids to hostnames.
Selecting to download a file will cause an insert of a record in this new
table. All tables would be joined on fileid, and the dynamic filter would be
solely to the new table.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Hi Paul,
I forgot to mention that the rows in the files table correlate to
physical files. So what I wanted is to have some *physical* files
downloaded to the client's computer, all of the rows in the files table
(the client may have to see or use data about files that he didn't
download) and only the rows in the fileproperties table that are
related to the few rows in files table that are related to the physical
files the user downloaded.
I know I can join the tables - FileProperties and the table that
associates the fileid to the hostname - but when I also need to use
WHERE Hosts_Files.HostName = host_name(). I tried to do it but the
replication wizard doesn't let me.
If you could provide me with a script or an example solution (or is it
just a view that I have to write in order to combine JOIN and WHERE
filters?), I'll be grateful.
Thanks in advance,
Zzzbla
Paul Ibison wrote:

> You could join these tables in the merge publication. Filtering in
> this case is a bit tricky as it looks as though you want to change
the
> filter effectively dynamically. I'm assuming that there is a typo
> somewhere, as this doesn't seem to make logical sense: "I want to
> replicate the entire table Files, and only the rows from
> fileProperties that have to do with the files they downloaded to
their
> computer" - this would seem to imply all FileProperties. The way I
> read your requirements are that you want users to select certain
files
> and have just associated details downloaded? If this is the case,
you
> can have a further table which relates fileids to hostnames.
Selecting
> to download a file will cause an insert of a record in this new
table.
> All tables would be joined on fileid, and the dynamic filter would be
> solely to the new table.
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
|||Some additions:
The real problem I'm facing is that the table I want to filter by
(Hosts_Files) is only related to the table I want to filter
(FileProperties) via the table Files - which I want to leave unfiltered.
If I let it filter the files table, I get the FileProperties I wanted,
but I also get only the selected rows from files and not the whole
table as required.
I wouldn't want to create a Hosts_FileProperties unless there's no
better solution...
|||Please post up the schema of hte tables involved and I'll have a look. A
(denormalized) linking table will work (maintained by triggers) but there
might be an alternative.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Hi,
I attached a script to create tables and relationships.
Thank you for your time and effort!
begin 444 replication test.sql
M__YI`&8`(`!E`'@.`:0!S`'0`<P`@.`"@.`<P!E`&P`90!C`'0`( ``J`"``9@.!R
M`&\`;0`@.`&0`8@.!O`"X`<P!Y`',`;P!B`&H`90!C`'0`<P`@.` '<`:`!E`'(`
M90`@.`&D`9``@.`#T`(`!O`&(`:@.!E`&,`=`!?`&D`9``H`$X`) P!;`&0`8@.!O
M`%T`+@.!;`$8`2P!?`$8`:0!L`&4`4`!R`&\`<`!E`'(`=`!I` &4`<P!?`$8`
M:0!L`&4`<P!=`"<`*0`@.`&$`;@.!D`"``3P!"`$H`10!#`%0`4 `!2`$\`4`!%
M`%(`5`!9`"@.`:0!D`"P`(`!.`"<`20!S`$8`;P!R`&4`:0!G` &X`2P!E`'D`
M)P`I`"``/0`@.`#$`*0`-``H`00!,`%0`10!2`"``5`!!`$(`3`!%`"``6P!D
M`&(`;P!=`"X`6P!&`&D`;`!E`%``<@.!O`'``90!R`'0`:0!E` ',`70`@.`$0`
M4@.!/`%``(`!#`$\`3@.!3`%0`4@.!!`$D`3@.!4`"``1@.!+`%\`1@.!I`& P`90!0
M`'(`;P!P`&4`<@.!T`&D`90!S`%\`1@.!I`&P`90!S``T`"@.!'` $\`#0`*``T`
M"@.!I`&8`(`!E`'@.`:0!S`'0`<P`@.`"@.`<P!E`&P`90!C`'0`( ``J`"``9@.!R
M`&\`;0`@.`&0`8@.!O`"X`<P!Y`',`;P!B`&H`90!C`'0`<P`@.` '<`:`!E`'(`
M90`@.`&D`9``@.`#T`(`!O`&(`:@.!E`&,`=`!?`&D`9``H`$X`) P!;`&0`8@.!O
M`%T`+@.!;`$8`2P!?`$@.`;P!S`'0`<P!?`$8`:0!L`&4`<P!?` $8`:0!L`&4`
M<P!=`"<`*0`@.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$P`5`!%`%(`(`!4` $$`0@.!,`$4`
M(`!;`&0`8@.!O`%T`+@.!;`$@.`;P!S`'0`<P!?`$8`:0!L`&4`< P!=`"``00!$
M`$0`(``-``H`"0!#`$\`3@.!3`%0`4@.!!`$D`3@.!4`"``6P!&`$L`7P!(`& \`
M<P!T`',`7P!&`&D`;`!E`',`7P!&`&D`;`!E`',`70`@.`$8`3 P!2`$4`20!'
M`$X`(`!+`$4`60`@.``T`"@.`)`"@.`#0`*``D`"0!;`$8`:0!L` &4`20!$`%T`
M#0`*``D`*0`@.`%(`10!&`$4`4@.!%`$X`0P!%`%,`(`!;`&0`8 @.!O`%T`+@.!;
M`$8`:0!L`&4`<P!=`"``*``-``H`"0`)`%L`1@.!I`&P`90!)`$0`70`-``H`
4"0`I``T`"@.!'`$\`#0`*``T`"@.``
end
|||As far as I can see, removing the Files properties out of the equation
satisfies these requirements:
Filter:
SELECT <published_columns> FROM [dbo].[Hosts_Files] WHERE
hostname = HOST_NAME()
Join:
SELECT <published_columns> FROM [dbo].[Hosts_Files] INNER JOIN
[dbo].[FileProperties] ON [FileProperties].[FileID] =
[FileProperties].[FileID]
(publication script attached).
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
begin 666 replication test.sql
M__XM`"T`( !!`&0`9 !I`&X`9P`@.`'0`: !E`" `;0!E`'(`9P!E`" `< !U
M`&(`; !I`&,`80!T`&D`;P!N``T`"@.!E`'@.`90!C`" `<P!P`%\`80!D`&0`
M;0!E`'(`9P!E`' `=0!B`&P`:0!C`&$`= !I`&\`;@.`@.`$ `< !U`&(`; !I
M`&,`80!T`&D`;P!N`" `/0`@.`$X`)P!8`%@.`6 !4`&4`<P!T`"<`+ `@.`$ `
M9 !E`',`8P!R`&D`< !T`&D`;P!N`" `/0`@.`$X`)P!-`&4`<@.!G`&4`( !P
M`'4`8@.!L`&D`8P!A`'0`:0!O`&X`( !O`&8`( !8`%@.`6 `@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`#T`( !.`"<`2 !O`',`= !S`%\`1@.!I`&P`90!S`"<`+ `@.
M`$ `:@.!O`&D`;@.!?`&8`:0!L`'0`90!R`&,`; !A`'4`<P!E`" `/0`@.`$X`
M)P!;`$8`:0!L`&4`4 !R`&\`< !E`'(`= !I`&4`<P!=`"X`6P!&`&D`; !E
M`$D`1 !=`" `/0`@.`%L`1@.!I`&P`90!0`'(`;P!P`&4`<@.!T`&D`90!S`%T`
M+@.!;`$8`:0!L`&4`20!$`%T`)P`L`" `0 !J`&\`:0!N`%\`=0!N`&D`<0!U
C`&4`7P!K`&4`>0`@.`#T`( `P``T`"@.!'`$\`#0`*``T`"@.``
`
end
|||Hi Paul,
Thank you. That's what I've been trying to do, but the enterprise
manager kept telling me that Hosts_Files and FileProperties are not
related...
I ran the script you attached but unfortunatly - it still doesn't work.
The subscriber still gets the whole FileProperties table and not only
the properties for the files in Hosts_Files.
Have you got any idea why this isn't working?
Thank you again.
Paul Ibison wrote:

> As far as I can see, removing the Files properties out of the
> equation satisfies these requirements:
> Filter:
> SELECT <published_columns> FROM [dbo].[Hosts_Files] WHERE
> hostname = HOST_NAME()
> Join:
> SELECT <published_columns> FROM [dbo].[Hosts_Files] INNER JOIN
> [dbo].[FileProperties] ON [FileProperties].[FileID] =
> [FileProperties].[FileID]
> (publication script attached).
> HTH,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
|||I don't know why you get this error message from EM but the script runs. As
far as the publication I posted up goes you're quite right - I just tested
this and only the table directly related to the host_name() function is
filtered. Interesting! The other option is to use the host_name function on
the file_properties table as well. I know that this isn't related to host
names, but we can make it related by using a UDF.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thank you for your fast and helpful replies.
Well, in this case now when the obvious fails, I'm left with two
options:
- FILTER FileProperties with a user defined function, or
- JOINing FileProperties with a new table that has hostname and
FilePropertyID.
The first one probably has a cost in querying, and the second one in
inserting. Which one in your opinion is better? Also, if I use a user
defined function, should I pass HOST_NAME() as a parameter to it in the
filter, or simply use HOST_NAME() in the function itself (i.e. not as a
parameter)?