SSRS ReportServer Database 的Blocking问题
我们监控SQL SERVER数据库的阻塞情况时,老是收到在SSRS 里面出现SQL阻塞情况,刚开始由于事情多,没有太关注ReportServerTempDB里面的会话阻塞情况,但是老是出现这种频繁阻塞情况,不得不仔细研究一下SSRS的Blocking问题。
Blocking SQL Text
CREATE PROCEDURE [dbo].[Writelocksession] @SessionID AS VARCHAR(32),
@Persisted BIT,
@CheckLockVersion BIT = 0,
@LockVersion INT
AS
SET nocount OFF;
IF @Persisted = 1
BEGIN
IF @CheckLockVersion = 0
BEGIN
UPDATE [ReportServerTempDB].dbo.sessionlock WITH (rowlock)
SET sessionid = sessionid
WHERE sessionid = @SessionID;
END
ELSE
BEGIN
DECLARE @ActualLockVersion AS INT
UPDATE [ReportServerTempDB].dbo.sessionlock WITH (rowlock)
SET sessionid = sessionid,
lockversion = lockversion + 1
WHERE sessionid = @SessionID
AND lockversion = @LockVersion;
IF ( @@ROWCOUNT = 0 )
BEGIN
SELECT @ActualLockVersion = lockversion
FROM [ReportServerTempDB].dbo.sessionlock WITH (rowlock)
WHERE sessionid = @SessionID;
IF ( @ActualLockVersion <> @LockVersion )
RAISERROR ('Invalid version locked',16,1)
END
END
END
ELSE
BEGIN
INSERT INTO [ReportServerTempDB].dbo.sessionlock WITH (rowlock)
(sessionid)
VALUES (@SessionID)
END
Blocked SQL Text
CREATE PROCEDURE [dbo].[Checksessionlock] @SessionID AS VARCHAR(32),
@LockVersion INT output
AS
DECLARE @Selected NVARCHAR(32)
SELECT @Selected = sessionid,
@LockVersion = lockversion
FROM [ReportServerTempDB].dbo.sessionlock WITH (rowlock)
WHERE sessionid = @SessionID
如上所示,在存储过程WriteLockSession中更新[ReportServerTempDB].dbo.SessionLock的时候使用行锁WITH(ROWLOCK),它阻塞了存储过程[dbo].[CheckSessionLock]查询表[ReportServerTempDB].dbo.SessionLock,这个是因为SSRS通过SessionLock表来实现多线程机制,一旦没有线程访问这些报表时,锁才会移除。比较慢、耗时长的查询会导致这类blocking出现。
SSRS issues these locks to provide a multithreading mechanism.Once all threads running the report that YOU wrote, end, the lock is removed.So if you see these, normally, it is a slow query on a different server causing the problem.
Some issues may happen on heavy load (or so they say), and some report that collation issues prevent CleanExpiredSessions from running.
I have the same problem. MSDN says the locking/blocking is to ensure consistency, and is normal behavior. The only thing you can do is to reduce report data or run it at quiet time. I am sure MSDN understands why it was set this way originally. You are editing a blackbox at your own risk.
微软给出的解释是: SSRS 数据库的架构设计,在高负荷的时候导致blocking出现,你应该注意采纳一些 Reporting Services Performance Optimization的建议。减小报表的数据量等…
Thank you for filing this issue. The RS database architecture can lead to blocking under heavly load. Best practices for how to address this issue are documented here: http://sqlcat.com/search/searchresults.aspx?q=reporting+services&ctypes=blog We will consider this issue for a future version of Reporting Services.
参考资料
http://blogs.msdn.com/b/sqlcat/archive/2013/09/20/report-server-catalog-best-practices.aspx
SSRS ReportServer Database 的Blocking问题的更多相关文章
- SQL Sever 博客文章目录(2016-07-06更新)
SQL Server方面的博客文章也陆陆续续的写了不少了,顺便也将这些知识点整理.归纳一下下.方便自己和他人查看. MS SQL 数据类型 三大数据库对比研究系列--数据类型 MS SQL 表和视图 ...
- Report launcher to run SSRS report subscriptions on demand
http://www.mssqltips.com/sqlservertip/3078/report-launcher-to-run-ssrs-report-subscriptions-on-deman ...
- Enabling Remote Errors in SSRS
January 18, 2011 By default the remote errors property in SQL Server Reporting Services is set to fa ...
- SQL Server系统数据库备份最佳实践
原文:SQL Server系统数据库备份最佳实践 首先了解主要的系统数据库: 系统数据库 master 包含登录信息和其他数据库的核心信息 msdb 存储作业.操作员.警报.备份还原历史.数据库邮件信 ...
- vue中v-on支持的事件总结
资源事件 事件名称 何时触发 error 资源加载失败时. abort 正在加载资源已经被中止时. load 资源及其相关资源已完成加载. beforeunload window,document 及 ...
- SSRS ----环境配置,没有 ReportServer DB 怎么办?
今天项目进入报表开发阶段,按照习惯,打开报表管理器,发现提示下面的错误: 错误:报表服务器无法打开与报表服务器数据库的连接.所有请求和处理都要求与数据库建立连接. 这是怎么回事儿呢,经过排查,发现数据 ...
- Step by step Install a Local Report Server and Remote Report Server Database
原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 &g ...
- SQL Server 2012 The report server cannot open a connection to the report server database
案例环境: 操作系统版本: Windows Server 2012 R2 Standard 数据库版本 : SQL SERVER 2012 SP2 案例介绍: 今天进入一台新安装的SQL ...
- SSRS 2008 ReportServerTempDB增长异常分析
这两天收到一SQL 2008 R2数据库服务器的磁盘空间告警,在检查过程中发现ReportServerTempDB已经暴增到60多GB,其中数据文件接近60G,日志文件9G大小左右.如下截图所示 我们 ...
随机推荐
- C# 中使用Word文档对图像进行操作
C# 中使用Word文档对图像进行操作 Download Files: ImageOperationsInWord.zip 简介 在这篇文章中我们可以学到在C#程序中使用一个Word文档对图像的各种操 ...
- 图片每天换及纯css3手风琴特效
<a target="_blank" id="a"><img id="img" /></a> <s ...
- 局部打印插件 jquery.PrintArea.js
(function ($) { var printAreaCount = 0; $.fn.printArea = function () { var ele = $(this); var idPref ...
- 2.第一个Struts2程序-HelloWorld程序
1.新建Web Project项目:Study_Struts2 2.新建HelloWordAction.java类 3.复制struts.xml文件到src目录下,配置struts.xml文件内容如下 ...
- web前端学习随笔
为什么是随笔 好好算下来,学习web前端已有半个月了,这半个月来主要学习的是HTML和CSS部分,期间有困惑,也有解决困惑时的快感,所以想把这段时间感受到的一些东西记下来,因为内容比较杂,所以干脆叫随 ...
- Hibernate —— Session
一.概述 Session 是 Hibernate 向应用程序提供操纵数据的主要接口,它提供了基本的保存.更新.删除和加载 Java 对象的方法. 二.Session 缓存 1.简介 (1)Sessio ...
- WCF学习系列四--【WCF Interview Questions – Part 4 翻译系列】
WCF Interview Questions – Part 4 This WCF service tutorial is part-4 in series of WCF Interview Qu ...
- [转]9个offer,12家公司,35场面试,从微软到谷歌,应届计算机毕业生的2012求职之路
1,简介 毕业答辩搞定,总算可以闲一段时间,把这段求职经历写出来,也作为之前三个半月的求职的回顾. 首先说说我拿到的offer情况: 微软,3面->终面,搞定 百度,3面->终面,口头of ...
- ASP.NET Core开发-获取所有注入(DI)服务
获取ASP.NET Core中所有注入(DI)服务,在ASP.NET Core中加入了Dependency Injection依赖注入. 我们在Controller,或者在ASP.NET Core程序 ...
- deployment与Web应用程序部署
定义用于支持 Web 应用程序部署的配置设置. <deployment retail="true|false" /> retail属性:设置一个值,该值指定是否以发布模 ...
