この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン | |||
database:mariadb:memo [2019/01/07 04:50] MIYAKO 削除 |
— (現在) | ||
---|---|---|---|
ライン 1: | ライン 1: | ||
- | **データベースの容量** | ||
- | |||
- | 各データベースでどのくらいの容量があるか知りたい場合のコマンド | ||
- | |||
- | Byteで算出する場合 | ||
- | |||
- | select table_schema, sum(data_length+index_length) as B from information_schema.tables group by table_schema order by sum(data_length+index_length) desc; | ||
- | |||
- | MegaByteで算出したい場合は1024で2回割ってやればOK | ||
- | |||
- | select table_schema, sum(data_length+index_length) /1024 /1024 as MB from information_schema.tables group by table_schema order by sum(data_length+index_length) desc; | ||
- | |||
- | |||
- | DBの容量でQuotaを掛けたい場合はこの値で計算すれば良いんじゃないかと思うが、そこまで巨大なデータベースを扱う事なんてないだろうなぁwww | ||
- | |||
- | |||