본문 바로가기
IT/SQL

Mysql(Mariadb) DB 용량 확인, volume check

by Jang HyunWoong 2019. 4. 17.

DB 별 용량 확인하는 쿼리 (volume by db name)

 

SELECT table_schema "DB Name", ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "MB"

FROM information_schema.tables

GROUP BY table_schema;

 

 

만약 전체 용량을 확인하고 싶다면 (Total volume)

 

SELECT SUM(data_length+index_length)/1024/1024 "USED_MB", SUM(data_free)/1024/1024 "FREE_MB"

FROM information_schema.tables;

반응형