+ 테이블 스페이스별 용량 확인 쿼리문(MB, GB단위)
select substr(a.tablespace_name, 1, 30) tablespace,
round(sum(a.total1)/1024/1024/1024, 1) "totalGb",
round(sum(a.total1)/1024/1024, 1) "totalMb",
round(sum(a.total1)/1024/1024, 1) - round(sum(a.sum1)/1024/1024, 1) "useMb",
round(sum(a.total1)/1024/1024/1024, 1) - round(sum(a.sum1)/1024/1024/1024, 1) "useGb",
round(sum(a.sum1)/1024/1024, 1) "freeMb",
round(sum(a.sum1)/1024/1024/1024, 1) "freeGb", -- 여유공간
round((round(sum(a.total1)/1024/1024, 1) - round(sum(a.sum1)/1024/1024, 1) )/round(sum(a.total1)/1024/1024, 1)*100, 2) "used%" -- 사용율
from
(select tablespace_name, 0 total1, sum(bytes) sum1, max(bytes) maxb, count(bytes) cnt
from dba_free_space
group by tablespace_name
union
select tablespace_name, sum(bytes) total1, 0,0,0
from dba_data_files
group by tablespace_name ) a
group by a.tablespace_name
order by tablespace
'Development > Database' 카테고리의 다른 글
[Oracle] 오라클 데이터 추출 조회쿼리 (0) | 2022.08.22 |
---|---|
[Oracle] order by 절에서 정렬순서 변경 (0) | 2022.06.29 |
[Oracle] 오라클 테이블 스페이스별 사용중인 용량 확인 쿼리문(GB, MB단위) (0) | 2022.06.29 |
[Oracle] 오라클 그룹함수 (0) | 2022.06.29 |
[오라클] 테이블스페이스 용량 확인 (0) | 2022.06.23 |