Created
December 11, 2014 10:18
-
-
Save zafergurel/adf4d2311ff6e7d389c8 to your computer and use it in GitHub Desktop.
Hangi Veritabanı Önbellekte Ne Kadar Yer Tutuyor? (MS SQL Server)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MS SQL Server'da hangi veritabanının ne kadar yer tuttuğunu gösteren aşağıdaki SQL'in çalışma süresi, | |
veritabanı büyüklüğüyle doğru orantılıdır. Birkaç dakika sürebilir. | |
*/ | |
SELECT CAST(COUNT(1) * 8 / 1024.0 AS NUMERIC(10, 2)) AS CachedDataMB, | |
CASE database_id WHEN 32767 THEN '* Resource DB' ELSE DB_NAME(database_id) END AS DatabaseName, database_id DatabaseID | |
FROM sys.dm_os_buffer_descriptors | |
GROUP BY DB_NAME(database_id) , database_id ORDER BY DB_NAME(database_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment