Showing posts with label merge. Show all posts
Showing posts with label merge. Show all posts

Thursday, March 29, 2012

Automating Replication

Hello everyone,
I need some pointers to do the following:
1. I set up a publisher
2. I Set up a distributer
--To have anonymous merge replication.
3. An installer installs MSDE on the client computer if it doesnt
exist.
I want to run something on a client computer thats not on the same
network (via internet), that will automatically setup a database, pull
a subscription from the above distributers and publishers and
synchronize with a given schedule. I want the schedule to be
configurable later. Moreover, the user of the program which uses this
replicated database should be able to click a button and say
Synchronize at any point of time.
What is the best way to achieve this?
1. I saw the MergeX object which is an activeX interface. It doesnt
allow me any interface to change the schedules on the merge agent. It
lets me synchronize though. Is there a hidden interface to access the
merge agent?
2. The SQL-DMO object seemed to allow me to change the schedule, but
it didnt reflect in the current merge agents schedule. The
SQLDMO.SQLServer.Jobs interface didnt show up the current active jobs
(Im assuming a MergeAgentsSchedule should show up here)
foreach(ReplicationDatabase rdb in
s.Replication.ReplicationDatabases)
foreach(MergePullSubscription mps in rdb.MergePullSubscriptions)
mps.MergeJobID
There is a pull subscription visible. But the job Id is
000000000000000 .
In enterprise manager the id is 8 or something like that.
Is SQL-DMO designed to do what im trying to do? or am i missing
something?
3. Is it better to just write an sql script? and call it in code
through a storedprocedure? How Can it be done?
Thanks in advance,
Hananiel
1) no, there is no way to change the scheduling of the merge agent using the
ActiveX controls. Even with plain old merge replication it still farms out
the scheduling to the SQL Server Agent schedule.
2) SQL DMO an ActiveX controls are very different objects. Think of ActiveX
controls as a lightweight SQL DMO. The jobs created through the ActiveX
controls are different and not designed to be managed by SQL DMO, EM (which
uses SQL DMO), or the replication stored procedures. Use another scheduling
agent to schedule your program/script which uses the ActiveX controls or
schedule the program or script using the SQL Server job scheduler.
3) Well you could, but it depends on what you are trying to do. The ActiveX
controls do not offer the functionality that SQL DMO does, and they are
designed in cases where you don't or can't enable the Subscribers through
EM, ie MDSE subscribers, or anonymous subscribers over the internet. The
ActiveX controls also don't support SQL Authentication (IIRC), so you will
have to enter a password each time they run.
HTH
"Hananiel" <hananiel@.yahoo.com> wrote in message
news:e338e321.0409201104.63408961@.posting.google.c om...
> Hello everyone,
> I need some pointers to do the following:
> 1. I set up a publisher
> 2. I Set up a distributer
> --To have anonymous merge replication.
> 3. An installer installs MSDE on the client computer if it doesnt
> exist.
> I want to run something on a client computer thats not on the same
> network (via internet), that will automatically setup a database, pull
> a subscription from the above distributers and publishers and
> synchronize with a given schedule. I want the schedule to be
> configurable later. Moreover, the user of the program which uses this
> replicated database should be able to click a button and say
> Synchronize at any point of time.
> What is the best way to achieve this?
> 1. I saw the MergeX object which is an activeX interface. It doesnt
> allow me any interface to change the schedules on the merge agent. It
> lets me synchronize though. Is there a hidden interface to access the
> merge agent?
> 2. The SQL-DMO object seemed to allow me to change the schedule, but
> it didnt reflect in the current merge agents schedule. The
> SQLDMO.SQLServer.Jobs interface didnt show up the current active jobs
> (Im assuming a MergeAgentsSchedule should show up here)
> foreach(ReplicationDatabase rdb in
> s.Replication.ReplicationDatabases)
> foreach(MergePullSubscription mps in rdb.MergePullSubscriptions)
> mps.MergeJobID
> There is a pull subscription visible. But the job Id is
> 000000000000000 .
> In enterprise manager the id is 8 or something like that.
> Is SQL-DMO designed to do what im trying to do? or am i missing
> something?
> 3. Is it better to just write an sql script? and call it in code
> through a storedprocedure? How Can it be done?
> Thanks in advance,
> Hananiel

Sunday, March 25, 2012

automatically restarting merge replication after time out

Hello,
every few days my merge replication fails due to a network problem and
subsequent time out. How can I trigger a replication restart automatically,
or at a certain time of day?
Bill,
you can change the workflow properties on your merge agent's job so that the
third step on completion goes to the first step.
Alternatively, you could avoid continuous replication and have the merge
agent run on a schedule.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Monday, March 19, 2012

Automatic Identity Range Handling warning message.

Ive implemented merge replication with SQL Server and an Access Database.
SQL Server is the publisher and Access database is the subscriber.
I have ONE table in the schema that can be updated in both the subscriber
side as well as the publisher side. I have an IDENTITY column in this table
and I have set the property "Automatic Identity Range Handling" ON for this
table.
Ive also created a script to create this publisher. Now, heres my problem.
When I create the publisher, I get a warning message thats stated below:
"Warning: only Subscribers running SQL Server 2000 can synchronize with
publication '<database>' because automatic identity ranges are being used."
OK, Ive done some resonable testing on this statement and it SEEMS that
synchronization with Automatic Identity Range Handing enabled DOES work for
Access databases as well even though the warning states otherwise! Im using
JET to connect to access and not the desktop engine. Once the threshold is
reached, and after the merge agent kicks in, the indentity seed is reset to
the appropriate values on both the access and the sql server side.
Appropriate check constraints are also placed.
I just want to make sure if this is correct - and this warning is just
bogus.
Thanks,
Girish
Hi Girish,
From your descriptions, I understood that you would like to know whether it
matters when warning is shown for "automatic identity ranges are being
used". Have I understood you? If there is anything I misunderstood, please
feel free to let me know.
Based on my scope, there are some known issues for us by using automatic
identity ranges. You could have a view on them
BUG: Unable to Change Identity Range of Publisher If You Use Auto Identity
Range
http://support.microsoft.com/default...b;en-us;310540
BUG: Identity Range Not Adjusted on Publisher When Merge Agent Runs
Continuously
http://support.microsoft.com/default...b;en-us;304706
Additionaly, there is a by design issue for automatic identity range based
on the descriptions in the following documents.
PRB: Automatic Identity Range Handling Is Not Correct If the Merge Agent
Runs an Insert Trigger
http://support.microsoft.com/default...b;en-us;324361
I am afraid the above all are why this warning is shown up.
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!
Sincerely yours,
Mingqing Cheng
Microsoft Developer Community Support
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!