Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Stop and start Replication in SQL 2008r2 with the job agents, does it loose transactions?


Stop and start Replication in SQL 2008r2 with the job agents, does it loose transactions?

Author
Message
Pablo Campanini-336244
Pablo Campanini-336244
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 163
I have transactional replication set up, running good, we need to stop replication for 1 hour, extract data, then restart replication.
Questions:

1.- Do I need to stop only the subscription job?
2.- If I start that job again(Subscription) after 1 hour, does it loose transactions?.
3.- Do I need to run the snapshot agent everytime I stop/start the subscription job?

Appreciate your help as always.

Thanks
Oscar PAblo Campanini
Matt Crowley
Matt Crowley
SSC Veteran
SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)SSC Veteran (261 reputation)

Group: General Forum Members
Points: 261 Visits: 469
If you are looking to pause the flow of transactions from the distributor to the subscriber, then yes, all you would need to do is stop the subscriber job (distribution job or Synchronization job). The transactions will happily queue up in the distribution database for a default period of 72 hours. Once you restart the distribution job, the subscriber will catch up. it may not be entirely instant, if you have a large number of transactions to catch up on. Also, you should make sure the distribution database has room to grow, in case it needs to. I will bet that over the course of an hour it will not, but you should make sure.
MysteryJimbo
MysteryJimbo
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1348 Visits: 15327
Pablo Campanini-336244 (1/21/2014)

1.- Do I need to stop only the subscription job?


That's the easiest way. If you were to stop the log reader it would have the same effect but would potentially mean the transaction log would grow.

Pablo Campanini-336244 (1/21/2014)

2.- If I start that job again(Subscription) after 1 hour, does it loose transactions?.


No. All transactions marked for replication would be read and commited to the distribution database by the logreader

Pablo Campanini-336244 (1/21/2014)

3.- Do I need to run the snapshot agent everytime I stop/start the subscription job?


No. For the very reasons above (the distribution db exists for a reason!). If that was a requirement it would be unmanageable and mean every bit of maintenance would require re-initialisation.

Is there a reason why you need to stop replication? It could be more beneficial to leave it on if its for data changes.
Pablo Campanini-336244
Pablo Campanini-336244
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 163
Thank you for your help, it clarifies the process for me, now here a better questions:

Transactional replication is on....

1.- If I want to add a table that was not replicating before, what would be the best scenario?.
2.- Do I have to run the Snapshot to catch the new DDL for the new table?

Thanks
Oscar Pablo Campanini
MysteryJimbo
MysteryJimbo
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1348 Visits: 15327
You are safer adding it via TSQL. You need to run sp_addarticle and sp_addsubscription. Then you need to run the snapshot agent.

Sp_addarticle adds the table to the publication. At this point nothing happens as the subscribers aren't aware of it

Sp_addsubscription adds the new article to the subscribers. This can apply to all subscribers or you can be granular and run it for single articles and subscribers.

The snapshot agent will generate the schema script and bcp the data of ONLY the new article.
umairqamar
umairqamar
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 29
Hi,
I have a question, i am managing 2 SQL servers
1 is Master Server (Publisher + Distributor)
2 is Client Server (Subscriber)
client basically owned by a client who is buying data from us.
Both Servers are replicated with each other
Replication type is Transactional-replication
only selected Tables of a single DB are replicated from Master-Server to Client Server.
Now i am going to tell actual problem. Basically there are several problems i want to discus

Problem 1:
When i add or delete any data table and take snapshot of replication than all db vanishes from customer side and after that it rebuilds in 20-30 minutes (have limited access so don't get logs)

Problem 2:
When i reinitialize subscription than it takes lots of time to completing it and showing partially applied scripts of tables in monitoring.

Problem 3:
Publisher to Distributor showing high commands and transactions count but actually on distributor to subscriber commands and transaction counts are more than 100's of times lower as compare to publisher section.

Problem 4:
Latency is Very high between Publisher-Distributor (around 5+ minutes)(Server-1) and jumps to 7 minutes then automatically less and stay on some seconds but average is really very high. Distributor-Subscriber latency seems fine.

Problem 5:
Log Size of Master DB increases and occupying space around 3.5 GB (Normally 3 GB with 80-87% free space) whether Data File Size also increases and now it's 4 GB+ (Normally 3.3 - 3.5 GB)

Really Appreciate Your Suggestions and Guidelines.

Thanks in advance,
Hassan
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search