Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Stop and start Replication in SQL 2008r2 with the job agents, does it loose transactions? Expand / Collapse
Author
Message
Posted Tuesday, January 21, 2014 8:03 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 20, 2014 9:10 AM
Points: 25, Visits: 95
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
Post #1533102
Posted Tuesday, January 21, 2014 9:04 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 18, 2014 2:52 PM
Points: 251, Visits: 457
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.
Post #1533191
Posted Tuesday, January 21, 2014 9:41 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 3:04 AM
Points: 1,362, Visits: 15,269
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.
Post #1533238
Posted Tuesday, January 21, 2014 9:47 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 20, 2014 9:10 AM
Points: 25, Visits: 95
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
Post #1533246
Posted Tuesday, January 21, 2014 10:20 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 3:04 AM
Points: 1,362, Visits: 15,269
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.
Post #1533260
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse