-- user 테이블별 사이즈
select segment_type, segment_name, tablespace_name,
SUM(TRUNC(BYTES/(1024*1024), 2)) as "size in MB"
from dba_segments
where segment_type in ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
and owner in ('조회하고하는 유저 입력')
group by segment_type,
segment_name, tablespace_name;
--테이블별 사이즈
select owner, segment_type, segment_name, tablespace_name,
SUM(TRUNC(BYTES/(1024*1024), 2)) as "size in MB"
from dba_segments
where segment_type in ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
and segment_name in ('테이블명')
group by owner,segment_type,
segment_name, tablespace_name;
-- 파티션 테이블 용량 산출
select owner, segment_type, segment_name, tablespace_name,PARTITION_NAME,
SUM(TRUNC(BYTES/(1024*1024), 2)) as "size in MB"
from dba_segments
where segment_type in ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
and segment_name = '테이블명'
AND PARTITION_NAME BETWEEN 'P202111' AND 'P202204'
group by owner,segment_type,
segment_name, tablespace_name,PARTITION_NAME;
'DBMS > Oracle' 카테고리의 다른 글
datafile 관리 (0) | 2022.07.04 |
---|---|
table move 하는 방법 (0) | 2022.07.04 |
table shrink 권고사항 확인(테이블 데이터 0건인데 용량 차지 하고 있는 테이블 실행) (0) | 2022.07.04 |
Partition table shrink (0) | 2022.07.04 |
index unusable 확인(index 깨진거 확인 쿼리) (0) | 2022.07.04 |