Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to auto generate a snapshot for an existing subscriber

 
   Database Help (Home) -> Replication RSS
Next:  ldf file is corrupt or missing - how to restore  
Author Message
JDS

External


Since: Jan 31, 2008
Posts: 10



(Msg. 1) Posted: Thu Jan 31, 2008 1:26 pm
Post subject: How to auto generate a snapshot for an existing subscriber
Archived from groups: microsoft>public>sqlserver>replication (more info?)

Is it possible to set a merge publication to automatically generate a
snapshot for an existing subscriber if the subscription has expired
and the snapshot has become obsolete?

I have the retention period set to 14 days but it is highly likely
that a user may exceed this time, say if they are on vacation and
return to work. At the moment I am getting the error on the client
that the snapshot for the publication has become obsolete. I can
regenerate the snapshot on the server and then the client will
synchronise but this does not seem to be a satisfactory solution.

In Management Studio there is an option "Automatically define a
partition and generate a snapshot if needed when a new subscriber
tries to synchronise" but this just seems to refer to new subscribers
only. I presume in T-SQL the argument
"@allow_subscriber_initiated_snapshot" in sp_addmergepublication is
the same but the definition is not as precise and does not refer to
just new subscribers. In any case it is set to true and does not seem
to work for existing subscribers.

This may have been caused by the fact that I set the subscription for
reinitialisation at one point but I would still want to have this
possibility and the control at the client.

Am I missing a basic principle of replication here? To me it would
seem to be an important feature for the client to be able to
automatically trigger the regeneration of a new snapshot if necessary
without having to rely on intervention on the server.

Any help greatly appreciated.

 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
Hilary Cotter

External


Since: Jan 16, 2008
Posts: 143



(Msg. 2) Posted: Fri Feb 01, 2008 5:45 am
Post subject: Re: How to auto generate a snapshot for an existing subscriber [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

If a subscriber's retention period has expired and they have not
sync'd within the retention period, they will use the latest generated
snapshot. By default a merge snapshot is generated every 14 days which
is the default retention period.

The @allow_subscriber_initiated_snapshot option is only for dynamic
snapshots for filtered publications.

So you are missing nothing, its just the merge replication is
designed to create a single snapshot which all new subscribers will
use until there is a reinitialization or until they have not sync'd
within the retention period. In both of these later two cases they
will use the new snapshot.

New subscribers will use the snapshot that is generated and waiting
for them.

HTH

On Jan 31, 4:26 pm, JDS wrote:
> Is it possible to set a merge publication to automatically generate a
> snapshot for an existing subscriber if the subscription has expired
> and the snapshot has become obsolete?
>
> I have the retention period set to 14 days but it is highly likely
> that a user may exceed this time, say if they are on vacation and
> return to work. At the moment I am getting the error on the client
> that the snapshot for the publication has become obsolete. I can
> regenerate the snapshot on the server and then the client will
> synchronise but this does not seem to be a satisfactory solution.
>
> In Management Studio there is an option "Automatically define a
> partition and generate a snapshot if needed when a new subscriber
> tries to synchronise" but this just seems to refer to new subscribers
> only. I presume in T-SQL the argument
> "@allow_subscriber_initiated_snapshot" in sp_addmergepublication is
> the same but the definition is not as precise and does not refer to
> just new subscribers. In any case it is set to true and does not seem
> to work for existing subscribers.
>
> This may have been caused by the fact that I set the subscription for
> reinitialisation at one point but I would still want to have this
> possibility and the control at the client.
>
> Am I missing a basic principle of replication here? To me it would
> seem to be an important feature for the client to be able to
> automatically trigger the regeneration of a new snapshot if necessary
> without having to rely on intervention on the server.
>
> Any help greatly appreciated.

 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
JDS

External


Since: Jan 31, 2008
Posts: 10



(Msg. 3) Posted: Sat Feb 02, 2008 2:47 am
Post subject: Re: How to auto generate a snapshot for an existing subscriber [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the reply. Maybe I am looking at the wrong thing then.

As it was, when the client with an expired subscription tried to
synchronise (using RMO from my app) it got the message "Snapshot for
the publication has become obsolete" and the synchronisation attempt
stopped. This is obviously no good for the user of the client machine.
I need the synchronisation to automatically use the latest available
snapshot. (When I manually recreated a snapshot the synchronisation
worked fine).

However, rather than looking at the subscription/publication settings
maybe I need to be looking at the agent to make sure it is
automatically regenerating a snapshot. Any suggestions greatly
appreciated but I will see if I can fix it.
 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
Hilary Cotter

External


Since: Jan 16, 2008
Posts: 143



(Msg. 4) Posted: Mon Feb 04, 2008 5:36 am
Post subject: Re: How to auto generate a snapshot for an existing subscriber [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

This is a hard one to diagnose. Can you try to bump up the permissions
of the publisherlogin, distributorlogin and make sure that the
publisherlogin is in the dbo_role on the publisher and in the PAL.

It also needs rights to read the snapshot share, and needs permission
to read and list the files and folders on the directory underlying the
snapshot share and all subdirectories of it.

On Feb 2, 5:47 am, JDS wrote:
> Thanks for the reply. Maybe I am looking at the wrong thing then.
>
> As it was, when the client with an expired subscription tried to
> synchronise (using RMO from my app) it got the message "Snapshot for
> the publication has become obsolete" and the synchronisation attempt
> stopped. This is obviously no good for the user of the client machine.
> I need the synchronisation to automatically use the latest available
> snapshot. (When I manually recreated a snapshot the synchronisation
> worked fine).
>
> However, rather than looking at the subscription/publication settings
> maybe I need to be looking at the agent to make sure it is
> automatically regenerating a snapshot. Any suggestions greatly
> appreciated but I will see if I can fix it.
 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
Srikanth

External


Since: Feb 18, 2008
Posts: 3



(Msg. 5) Posted: Mon Feb 18, 2008 8:57 pm
Post subject: Re: How to auto generate a snapshot for an existing subscriber [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Make sure the master snapshot agent job is scheduled to run every 14 days and
for expired subscriptions, you need to re-initialize the subscriptions. for
this you need to right click on the subscription name.
 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
Marcel de Vries

External


Since: May 09, 2010
Posts: 2



(Msg. 6) Posted: Sun May 09, 2010 11:49 pm
Post subject: RE: Thanks for the reply. Maybe I am looking at the wrong thing then. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I'm having the same problem.
I have now changed the folling thing.
When you create a publicication in RMO, you can set the schedule for a snapshot.

publication.SnapshotSchedule.FrequencyType = ScheduleFrequencyType.Continuously;

I've set the frequencytype to Continuously. This way the snapshot is taken when sqlserver starts.
In our case this was a solution because we don't have a really large database, so maybe it also working for you.

Good luck!



JDS wrote:

Thanks for the reply. Maybe I am looking at the wrong thing then.
05-Feb-08

Thanks for the reply. Maybe I am looking at the wrong thing then.

As it was, when the client with an expired subscription tried to
synchronise (using RMO from my app) it got the message "Snapshot for
the publication has become obsolete" and the synchronisation attempt
stopped. This is obviously no good for the user of the client machine.
I need the synchronisation to automatically use the latest available
snapshot. (When I manually recreated a snapshot the synchronisation
worked fine).

However, rather than looking at the subscription/publication settings
maybe I need to be looking at the agent to make sure it is
automatically regenerating a snapshot. Any suggestions greatly
appreciated but I will see if I can fix it.

Previous Posts In This Thread:

On Tuesday, February 05, 2008 12:28 AM
JDS wrote:

How to auto generate a snapshot for an existing subscriber
Is it possible to set a merge publication to automatically generate a
snapshot for an existing subscriber if the subscription has expired
and the snapshot has become obsolete?

I have the retention period set to 14 days but it is highly likely
that a user may exceed this time, say if they are on vacation and
return to work. At the moment I am getting the error on the client
that the snapshot for the publication has become obsolete. I can
regenerate the snapshot on the server and then the client will
synchronise but this does not seem to be a satisfactory solution.

In Management Studio there is an option "Automatically define a
partition and generate a snapshot if needed when a new subscriber
tries to synchronise" but this just seems to refer to new subscribers
only. I presume in T-SQL the argument
"@allow_subscriber_initiated_snapshot" in sp_addmergepublication is
the same but the definition is not as precise and does not refer to
just new subscribers. In any case it is set to true and does not seem
to work for existing subscribers.

This may have been caused by the fact that I set the subscription for
reinitialisation at one point but I would still want to have this
possibility and the control at the client.

Am I missing a basic principle of replication here? To me it would
seem to be an important feature for the client to be able to
automatically trigger the regeneration of a new snapshot if necessary
without having to rely on intervention on the server.

Any help greatly appreciated.

On Tuesday, February 05, 2008 12:28 AM
Hilary Cotter wrote:

If a subscriber's retention period has expired and they have notsync'd within
If a subscriber's retention period has expired and they have not
sync'd within the retention period, they will use the latest generated
snapshot. By default a merge snapshot is generated every 14 days which
is the default retention period.

The @allow_subscriber_initiated_snapshot option is only for dynamic
snapshots for filtered publications.

So you are missing nothing, its just the merge replication is
designed to create a single snapshot which all new subscribers will
use until there is a reinitialization or until they have not sync'd
within the retention period. In both of these later two cases they
will use the new snapshot.

New subscribers will use the snapshot that is generated and waiting
for them.

HTH

On Jan 31, 4:26=A0pm, JDS wrote:

On Tuesday, February 05, 2008 12:28 AM
JDS wrote:

Thanks for the reply. Maybe I am looking at the wrong thing then.
Thanks for the reply. Maybe I am looking at the wrong thing then.

As it was, when the client with an expired subscription tried to
synchronise (using RMO from my app) it got the message "Snapshot for
the publication has become obsolete" and the synchronisation attempt
stopped. This is obviously no good for the user of the client machine.
I need the synchronisation to automatically use the latest available
snapshot. (When I manually recreated a snapshot the synchronisation
worked fine).

However, rather than looking at the subscription/publication settings
maybe I need to be looking at the agent to make sure it is
automatically regenerating a snapshot. Any suggestions greatly
appreciated but I will see if I can fix it.

On Tuesday, February 05, 2008 12:28 AM
Hilary Cotter wrote:

This is a hard one to diagnose.
This is a hard one to diagnose. Can you try to bump up the permissions
of the publisherlogin, distributorlogin and make sure that the
publisherlogin is in the dbo_role on the publisher and in the PAL.

It also needs rights to read the snapshot share, and needs permission
to read and list the files and folders on the directory underlying the
snapshot share and all subdirectories of it.

On Feb 2, 5:47=A0am, JDS wrote:

On Monday, February 18, 2008 11:57 PM
srikant wrote:

Make sure the master snapshot agent job is scheduled to run every 14 days and
Make sure the master snapshot agent job is scheduled to run every 14 days and
for expired subscriptions, you need to re-initialize the subscriptions. for
this you need to right click on the subscription name.


Submitted via EggHeadCafe - Software Developer Portal of Choice
Free Online Courses Available for Eggheadcafe.com Users
http://www.eggheadcafe.com/tutorials/aspnet/5261083e-6e03-4b25-8728-fc...6855293
 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
Marcel de Vries

External


Since: May 09, 2010
Posts: 2



(Msg. 7) Posted: Sun May 09, 2010 11:57 pm
Post subject: Thanks for the reply. Maybe I am looking at the wrong thing then. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Forgot to mention, we run SQLServer on a machine PC, not on a server. For server purposes this wouldn't work unless you restart the SQLServer regularly.



Marcel de Vries wrote:

RE: Thanks for the reply. Maybe I am looking at the wrong thing then.
10-May-10

I'm having the same problem.
I have now changed the folling thing.
When you create a publicication in RMO, you can set the schedule for a snapshot.

publication.SnapshotSchedule.FrequencyType = ScheduleFrequencyType.Continuously;

I've set the frequencytype to Continuously. This way the snapshot is taken when sqlserver starts.
In our case this was a solution because we don't have a really large database, so maybe it also working for you.

Good luck!

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Entity Framework 4.0 and the AJAX Autocomplete Extender.
http://www.eggheadcafe.com/tutorials/aspnet/77429274-e89f-49c2-a93a-b2...013f649
 >> Stay informed about: How to auto generate a snapshot for an existing subscriber 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Problem applying the snapshot to push subscriber - I just setup a Transational publication that contains both tables and stored procedures as articles. I added a subscriber and successfully generated the snapshot. But when I start the agent to sync the subscriber I get the error shown below, any..

adding new subscriber to existing replication - We have replication setup already (bi-directional). How can I add JUST a "subscriber" to the replication? I want to do this with T-SQL. There does not seem to be any documentation that says "here are the steps to just add a subscriber i...

Add Article and Snapshot Just That One Article to Subscriber - I'm new to replication and am having troubles getting a new article to SNAPSHOT from the publication to the subscription. Below are the scripts I've used. I have added a new article (first code snippet) and run the SQLAgent "Snapshot Job" ...

Row not found at Subscriber - When we inserted a row at the Publisher -- this is error we got: The row was not found at the Subscriber when applying the replicated command. Since this was a new row, why would I get this error. Unrelated question: we do not proprogate changes from...

MySQL Subscriber - Hi, SQL Server 2005 sp2 The problem I face is that I try to set up a Transactional Replication between sql as a Publsher and MySQL as a Subscriber. When I use sp_browsereplcmds to see the cmd that is generated by the LogReader I see the bellow..
   Database Help (Home) -> Replication All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]