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

Problems with transactional replication to a reporting server Expand / Collapse
Author
Message
Posted Thursday, February 14, 2013 9:39 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 11:41 AM
Points: 114, Visits: 903
We are using transactional replication to our report server. There are a couple of problems that have developed over the past year. One is persistent blocking on the report server. Reports will block replication and vice versa; reports also block each other. It was suggested to turn on snapshot isolation level, will that help?

Thanks in advance for the help,
DK
Post #1420155
Posted Friday, February 15, 2013 1:58 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 4:17 AM
Points: 1,101, Visits: 5,279
Reports are supposed to be read (SELECT) operation. Have you investigated why they are causing blocking?

Have you created indexes on the report server?
Post #1420428
Posted Friday, February 15, 2013 12:15 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 11:41 AM
Points: 114, Visits: 903
Yes, we are only using selects in our reports, but the selects are complex with large predicates, mostly ad-hoc, with wide spread use of CTEs(With;) statements and unions. Yes, we have most all of the columns used in the reports covered with indexes. The blocking occurs through read locks on high volume tables, tables that are being inserted into frequently on the publisher side and are being read from frequently on the subscriber side.

Thanks,
DK
Post #1420725
Posted Monday, February 18, 2013 1:49 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:39 AM
Points: 5,149, Visits: 4,960
Do you need the reports to be real time, or can there be a delay in the information being shown to the users?

You could look at Snapshots if you have the right edition of SQL which will get around the issue.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1421081
Posted Monday, February 18, 2013 7:56 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:26 PM
Points: 2,926, Visits: 2,529
Snapshot isolation level may be able to help but it does require some changes - either the properties set for the connection need to be changed or the t-sql code needs to include "SET TRANSACTION ISOLATION LEVEL SNAPSHOT".

Have you done all you can to get the transactional replication side of things sorted ? There are some tuning options that you can use to improve things - e.g. if the application that is updating the source database uses sprocs, you could replicate the sproc call (e.g. EXEC dbo.MyStoredPrc @Myparm='123') instead of the resultant INSERT/UPDATE/DELETE statements (if a single sproc call causes multiple INSERT/UPDATE/DELETEs this could be useful).

You can also change the way that replication uses transasctions which, by default match the original transaction. This could be used to reduce the "size" of a transaction which may reduce blocking.



Post #1421409
Posted Thursday, February 21, 2013 2:50 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 11:41 AM
Points: 114, Visits: 903
Thanks for the responses.

Anthony.green, yes, the reports have to be as close to real time as possible at this point. We are going through the process of identifying reports that can use stale (data from the day before) vs. real time. A transition on that front is not in the near term. Snapshots do not fulfill the real time requirement at this point but it is something I am interested in pursuing once we can identify reports of which the data requirement fall into a day behind model.

Happycat59, I am interested in inserting "SET TRANSACTION ISOLATION LEVEL SNAPSHOT" into the t-sql of individual reports, but what would the practical pros and cons be for turning it on server wide, say less blocking but more pressure on tempdb? Any more advice has to how to change the way replication uses transactions?

Thanks again,
DK
Post #1422803
Posted Thursday, February 21, 2013 9:01 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 10:26 PM
Points: 2,926, Visits: 2,529
have a read of http://msdn.microsoft.com/en-us/library/tcbchxcb(v=VS.80).aspx - has info on the implications of "SET TRANSACTION ISOLATION LEVEL SNAPSHOT".

As for the way that replication handle transactions, launch Replication Monitor and change the profile associated with the distribution agent. The profile properties that you can set to change the way that replication uses transactions.



Post #1422859
Posted Friday, February 22, 2013 1:44 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 7:22 AM
Points: 1,327, Visits: 4,506
You may also want to take a look at your Distribution Agent Profile.

The default profile will try to apply 100 publisher transactions before issuing a commit at the subscriber. Therefore replication could be locking (or being blocked itself from locking) an awful lot of data at the subscriber before it commits.

EDIT.. Ignore me, I see happycat has mentioned that already!!



Post #1422908
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse