標籤:des blog http io os ar 資料 sp 2014
第一步:
每一類資源用了多少記憶體。
select
clerks.type,
sum(clerks.virtual_memory_reserved_kb) as Reserve,
sum(clerks.virtual_memory_committed_kb)as [Commit],
sum(clerks.awe_allocated_kb) as [AWE],
sum(clerks.shared_memory_reserved_kb) as [Sreserve],
sum(clerks.shared_memory_committed_kb) as [SCommit]
from sys.dm_os_memory_clerks as clerks
group by clerks.type;
go
第一步可以給我們一種大致上的把握、哪種對角用了、多少記憶體。
第二步:
sys.dm_os_buffer_descriptors 、返回有關 SQL Server 緩衝池中當前所有資料頁的資訊。
select dp.database_id,dp.page_type,sum(dp.row_count) as [RowCount]
from sys.dm_os_buffer_descriptors as dp
where dp.database_id=DB_ID(‘Studio‘)
group by dp.database_id,dp.page_type
order by dp.database_id;
go
第三步:
查看執行計畫緩衝
select plans.usecounts,plans.objtype,plans.size_in_bytes,stt.text
from sys.dm_exec_cached_plans as plans cross apply sys.dm_exec_sql_text(plans.plan_handle) as stt;
go
SQL Server 記憶體開銷分析