--For MSSQL
select
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Maximum Workspace Memory (KB)%') as Maximum_Workspace_Memory_KB,
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Target Server Memory (KB)%') as Target_Server_Memory_KB,
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Maximum Workspace Memory (KB)%') * 100.0
/
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Target Server Memory (KB)%') as Ratio
-- Oracle
SELECT sum(bytes)/1024/1024
FROM v$sgastat;
Thank you
Nik
Post by hubert depesz lubaczewskiThank you Depesz!
But I have a naive question, why isn't a straight forword approach for
postgres, unlike Oracle or MSSQL?
No idea. And how do you get memory usage in Oracle or MSSQL?
Best regards,
depesz