DBのバックアップを採取するときって基本的にメンテナンスにするので
「どのくらい時間が掛かるか...」を知りたい。
そこで「dumpファイルサイズって大体どのくらいになるかな...」と悩む。
ザックリと算出する方法の1つとして以下のselect文にて可能らしい。
んー、実際のdumpファイルサイズとズレはあるけど...。
■MBで算出する場合
mysql> select sum(data_length)/1024/1024 as totab_db_data_in_MB from information_sche
ma.tables where table_schema = 'データベース名';
+---------------------+
| totab_db_data_in_MB |
+---------------------+
| 12.345678901234 |
+---------------------+
1 row in set (0.23 sec)
■GBで算出する場合
mysql> select sum(data_length)/1024/1024/1024 as totab_db_data_in_GB from information_sche
ma.tables where table_schema = 'データベース名';
+---------------------+
| totab_db_data_in_GB |
+---------------------+
| 12.345678901234 |
+---------------------+
1 row in set (0.23 sec)
----とみお
「どのくらい時間が掛かるか...」を知りたい。
そこで「dumpファイルサイズって大体どのくらいになるかな...」と悩む。
ザックリと算出する方法の1つとして以下のselect文にて可能らしい。
んー、実際のdumpファイルサイズとズレはあるけど...。
■MBで算出する場合
mysql> select sum(data_length)/1024/1024 as totab_db_data_in_MB from information_sche
ma.tables where table_schema = 'データベース名';
+---------------------+
| totab_db_data_in_MB |
+---------------------+
| 12.345678901234 |
+---------------------+
1 row in set (0.23 sec)
■GBで算出する場合
mysql> select sum(data_length)/1024/1024/1024 as totab_db_data_in_GB from information_sche
ma.tables where table_schema = 'データベース名';
+---------------------+
| totab_db_data_in_GB |
+---------------------+
| 12.345678901234 |
+---------------------+
1 row in set (0.23 sec)
----とみお