SQLServer通过DMV实现低影响的自动监控和历史场景追溯 (五)

2014-11-24 01:42:01 · 作者: · 浏览: 31
aster]
GO
--通过以下查询来分析信息
declare@batch_idint
select@batch_id=isnull(MAX(@batch_id),1) fromdc_info_SessionConn

select *from dc_info_SessionConn wherebatch_id=@batch_id
select *from dc_info_BlockedInfo wherebatch_id=@batch_id
select *from dc_block_info wherebatch_id=@batch_id
select *from dc_Blocked_Resource_Info wherebatch_id=@batch_id

有了这些阻塞、进程和资源的信息,我们就可以了解系统出问题时,数据库是否出现异常,以及数据库异常时都有些什么语句在系统中运行,它们是否造成了大量的阻塞或消耗了大量的资源;这样DBA就方便定位问题了。


作者“飞洋过海”