SELECT t1.session_id,
(t1.internal_objects_alloc_page_count + t1.user_objects_alloc_page_count + task_alloc) as [保留或配置的总数据页数],
(t1.internal_objects_dealloc_page_count + t1.user_objects_dealloc_page_count + task_dealloc) as
[取消配置的总数据页数]
from sys.dm_db_session_space_usage as t1,
(select session_id,
sum(internal_objects_alloc_page_count+user_objects_alloc_page_count)
as task_alloc,
sum (internal_objects_dealloc_page_count + user_objects_dealloc_page_count ) as
task_dealloc
from sys.dm_db_task_space_usage group by session_id) as t2
where t1.session_id = t2.session_id and t2.session_id >50 --and spid > 50
--代表使用者连接
order by [保留或配置的总数据页数] DESC
统计各连接对 tempdb 系统数据库的占用量
最新推荐文章于 2023-03-14 19:06:23 发布