查詢SQL Server記憶體使用量狀況指令碼

來源:互聯網
上載者:User

SELECT type,--Clerk的類型    

sum(virtual_memory_reserved_kb)as vm_Reserved_kb,--保留的記憶體    

sum(virtual_memory_committed_kb)as vm_Committed_kb,--提交的記憶體    

sum(awe_allocated_kb)as awe_Allocated_kb,--開啟AWE後使用的記憶體    

sum(shared_memory_reserved_kb)as sm_Reserved_kb,--共用的保留記憶體    

sum(shared_memory_committed_kb)as sm_Committed_kb,--共用的提交記憶體    

sum(single_pages_kb)as SinlgePage_kb,-- Buffer Pool中的Stolen的記憶體    

sum(multi_pages_kb)as MultiPage_kb-- MemToLeave的記憶體

FROM sys.dm_os_memory_clerks  

GROUP BY
type  ORDER BYtype

 

--查詢Buffer Pool/Memory To Leave

SELECT

 sum(virtual_memory_reserved_kb)AS [Reserved],

 sum(virtual_memory_committed_kb)AS [Commit],

 sum(virtual_memory_reserved_kb)/sum(virtual_memory_committed_kb) AS[Reserved/Commit],

 sum(single_pages_kb)+sum(multi_pages_kb) AS
[Stolen],

 sum(virtual_memory_committed_kb)+sum(single_pages_kb)AS
[Buffer Pool],

 sum(multi_pages_kb) AS[MemToLeave],

 SUM(awe_allocated_kb)AS [AWEAllocated]

  FROM sys.dm_os_memory_clerks

 

--查詢SQLSERVER記憶體使用量

select *
from sys.dm_os_process_memory

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.