SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problems with transactional replication to a reporting server


Problems with transactional replication to a reporting server

Author
Message
DKlein
DKlein
SSC-Enthusiastic
SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)

Group: General Forum Members
Points: 181 Visits: 982
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
Suresh B.
Suresh B.
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1974 Visits: 5326
Reports are supposed to be read (SELECT) operation. Have you investigated why they are causing blocking?

Have you created indexes on the report server?
DKlein
DKlein
SSC-Enthusiastic
SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)

Group: General Forum Members
Points: 181 Visits: 982
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(WithWink 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
anthony.green
anthony.green
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10188 Visits: 6378
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
When a question, really isn't a question - Jeff Smith
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


happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4799 Visits: 3226
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.



DKlein
DKlein
SSC-Enthusiastic
SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)SSC-Enthusiastic (181 reputation)

Group: General Forum Members
Points: 181 Visits: 982
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
happycat59
happycat59
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4799 Visits: 3226
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.



Ian Scarlett
Ian Scarlett
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2259 Visits: 6894
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!!



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