Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
elijah_ng
Product and Topic Expert
Product and Topic Expert
22,671
Hi,

 

Here's a handy SQL that I often use to check what statements or procedures are currently running in HANA memory and how much memory each of them is consuming and how long they have been running ordered by the highest consuming first.


select
c.host, c.user_name, c.connection_status, c.transaction_id, s.last_executed_time,
round(s.allocated_memory_size/1024/1024/1024,2) as "Alloc Mem (GB)",
round(s.used_memory_size/1024/1024/1024,2) as "Used Mem (GB)", s.statement_string
from
m_connections c, m_prepared_statements s
where
s.connection_id = c.connection_id and c.connection_status != 'IDLE'
order by
s.allocated_memory_size desc
;


 

Hope this can be helpful to everyone.

 

-Elijah
3 Comments