--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
On Mon, Apr 8, 2013 at 3:18 AM, hubert depesz lubaczewski <depesz@xxxxxxxxxx> wrote:
On Sun, Apr 07, 2013 at 09:27:42PM -0700, Nik Tek wrote:No idea. And how do you get memory usage in Oracle or MSSQL?
> Thank you Depesz!
> But I have a naive question, why isn't a straight forword approach for
> postgres, unlike Oracle or MSSQL?
Best regards,
depesz