메뉴 건너뛰기

GREATUSER

tech

DB mysql 데이터베이스 용량 확인하기

위대한유저 2013.08.22 00:54 조회 수 : 16276

mysql-5.0 부터 지원되는 information_schema 를 이용하면 데이터베이스별 용량확인이 가능합니다.




mysql>SELECT table_schema "Database Name", sum( data_length + index_length ) / 1024 / 1024 "Database Size in MB" FROM information_schema.TABLES GROUP BY table_schema;


+----------------------------+-----------------------------+

| Database Name         | Database Size in MB |

+----------------------------+-----------------------------+

| database_01               |               32.69550228 |

| database_01               |               11.23450233 |

| database_01               |               32.69550228 |

| database_04               |               27.84058285 |

| database_05               |               59.73828030 |

| information_schema |                 0.00878906 |

+----------------------------+-----------------------------+

위로