본문 바로가기

Database

[Altibase] 알티베이스 테이블별 메모리 사용량 조회

set linesize 2048;

set colsize 30;

SELECT a.user_name

,NVL(d.name,'SYS_TBS_MEMORY') AS 'TABLESPACE_NAME'

, b.table_name

, round((c.fixed_alloc_mem + c.var_alloc_mem)/(1024*1024),2) 'ALLOC(M)'

, round((c.fixed_used_mem + c.var_used_mem)/(1024*1024),2) 'USED(M)'

, round((c.fixed_used_mem + c.var_used_mem)/(c.fixed_alloc_mem + c.var_alloc_mem)*100,2) 'EFFICIENCY(%)'

FROM system_.sys_users_ a

, system_.sys_tables_ b

, v$memtbl_info c left outer join v$tablespaces d on c.tablespace_id = d.id

WHERE b.table_type = 'T'

and a.user_id = b.user_id

and b.table_oid = c.table_oid

order by 1,2,3, 4 desc ;

이건 전체 사용량

SELECT TRUNC(MEM_MAX_DB_SIZE/1024/1024, 2) Max,

TRUNC(MEM_ALLOC_PAGE_COUNT*32/1024, 2) Alloc,

TRUNC((MEM_ALLOC_PAGE_COUNT - MEM_FREE_PAGE_COUNT) * 32/1024, 2) Used,

TRUNC(MEM_FREE_PAGE_COUNT*32/1024, 2) Free

FROM V$DATABASE;