I quite like dbatools, so I gave Get-DbaDbMemoryUsage
(docs here) a try on my production SQL Server 2019 server. Specifically, I ran this
Get-DbaDbMemoryUsage -SqlInstance [MyProdServer] -IncludeSystemDbs |
Select Database, PageType, PercentUsed |
Where PercentUsed -ne 0 |
Format-Table
The idea of the command is that it shows what percentage of your server's RAM is being used by what type of pages in each of your databases.
After waiting a few minutes, I ran it again. Only one database returned the same result. The rest either returned completely different numbers or vanished from the result set.
Given this result, is there anything to be gained from monitoring RAM usage on a per-database level? Or is it too noisy to be useful?
Note: If this is a hint that my server has way, way, too little RAM, then let me know.