반응형
데이터베이스 용량 확인
SELECT table_schema "DB명", SUM(data_length + index_length) / 1024 /1024 "size(MB)", SUM(data_free) / 1024 / 1024 "free(MB)" FROM information_schema.TABLES GROUP BY table_schema;
테이블 별 용량 확인
SELECT
concat(table_schema,'.',table_name),
concat(round(data_length/(1024*1024*1024),2),'G') DATA,
concat(round(index_length/(1024*1024*1024),2),'G') idx,
concat(round((data_length+index_length)/(1024*1024*1024),2),'G') total_size,
round(index_length/data_length,2) idxfrac
FROM information_schema.TABLES
WHERE table_rows is not null;
반응형
'LINUX > DB' 카테고리의 다른 글
[MSSQL] 원격지 백업하는 방법 (0) | 2021.12.06 |
---|---|
[MSSQL] Shrink (0) | 2021.10.29 |
[MSSQL] Logical Name 변경 (0) | 2021.10.29 |
Warning: Using a password on the command line interface can be insecure. (0) | 2020.10.16 |
MYSQL error - unauthenticated user (0) | 2019.06.03 |