Problems with transactional replication to a reporting server

  • 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

  • Reports are supposed to be read (SELECT) operation. Have you investigated why they are causing blocking?

    Have you created indexes on the report server?

  • 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

  • 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.

  • 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.

  • 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

  • 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.

  • 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!!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply