Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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: Monday, August 24, 2015 1:36 PM
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
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: Wednesday, August 27, 2014 10:20 AM
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.
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: Today @ 8:13 AM
Points: 1,333, Visits: 15,311
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: Monday, August 24, 2015 1:36 PM
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
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: Today @ 8:13 AM
Points: 1,333, Visits: 15,311
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
Posted Thursday, February 11, 2016 9:39 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, April 29, 2016 6:44 AM
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
Post #1760503
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse