Bir sonraki çözüm, örneğinizin altındaki belirli veritabanları için MB’de geçici toplam, temiz ve kirli sayfalar gösteriyor (internette bulundu ve biraz değiştirildi):
SELECT
(CASE WHEN ([database_id] = 32767) THEN 'Resource Database' ELSE DB_NAME (database_id) END) AS 'Database Name',
COUNT(*) *8/1024 AS [TotalPages in MB],
SUM(CASE WHEN ([is_modified] = 1) THEN 0 ELSE 1 END) *8/1024 AS [CleanPages in MB],
SUM(CASE WHEN ([is_modified] = 1) THEN 1 ELSE 0 END) *8/1024 AS [DirtyPages in MB]
FROM sys.dm_os_buffer_descriptors
GROUP BY database_id
ORDER BY DB_NAME(database_id)
veya
select value [DBid],attribute, last_execution_time ,text
from
sys.dm_exec_query_stats
cross apply
sys.dm_exec_plan_attributes(plan_handle)
cross apply
sys.dm_exec_sql_text(plan_handle)
where attribute = 'dbid'
order by last_execution_time desc
veya
select value [DBid],attribute, last_execution_time ,text
from
sys.dm_exec_query_stats
cross apply
sys.dm_exec_plan_attributes(plan_handle)
cross apply
sys.dm_exec_sql_text(plan_handle)
--where dbid=8
where
text like '%idAdministrator%' and
attribute = 'dbid'
and value>= 5 -- dbid >=5 for user databases but include resource database which
--you can exclude by its numer I don't remember at the moment
order by last_execution_time desc