码迷,mamicode.com
首页 > 数据库 > 详细

SqlServer内存占用查看

时间:2020-01-14 13:01:44      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:pre   nio   nbsp   page   count   sele   db_name   cas   clerk   

SELECT 
    ISNULL(DB_NAME(DATABASE_ID),RESOURCEDB) AS DATABASENAME,
    CAST(COUNT(ROW_COUNT) * 8.0 /(1024.0) AS DECIMAL(28,2)) AS SIZE(MB)
FROM SYS.dm_os_buffer_descriptors
GROUP BY database_id
ORDER BY DATABASENAME
SELECT SUM(single_pages_kb)+SUM(MULTI_PAGES_KB) FROM
(
    SELECT 
        SUM(single_pages_kb) AS single_pages_kb
        ,SUM(MULTI_PAGES_KB) AS MULTI_PAGES_KB        
    FROM SYS.dm_os_memory_clerks
    GROUP BY [TYPE]

    
) AS A 
UNION
SELECT COUNT(ROW_COUNT) * 8.0 FROM SYS.dm_os_buffer_descriptors

 

SqlServer内存占用查看

标签:pre   nio   nbsp   page   count   sele   db_name   cas   clerk   

原文地址:https://www.cnblogs.com/l9l99/p/12191406.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!