Hey guys,<br><br>Since yesterday some of you were wondering how much space the DBs were using, i searched the query that our DBAs use, for that information.<br>See if this is useful for anyone: <br><br>(this requires MySQL5)
<br><br>SELECT<br>s.schema_name AS &#39;Schema&#39;,<br>IFNULL(ROUND((SUM(t.data_length)+SUM(t.index_length)) /1024/1024,2),0.00) AS &#39;Total Mb&#39;,<br>IFNULL(ROUND(((SUM(t.data_length)+SUM(t.index_length))-SUM(t.data_free
))/1024/1024,2),0.00) AS &#39;Mb Used&#39;,<br>IFNULL(ROUND(SUM(data_free)/1024/1024,2),0.00) AS &#39;Mb Free&#39;,<br>IFNULL(ROUND((((SUM(t.data_length)+SUM(t.index_length))-SUM(t.data_free)) /((SUM(t.data_length)+SUM(t.index_length
)))*100),2),0)<br>AS &#39;Pct Used&#39;,<br>COUNT(table_name) AS Tables<br>FROM INFORMATION_SCHEMA.SCHEMATA s<br>LEFT JOIN INFORMATION_SCHEMA.TABLES t ON s.schema_name = t.table_schema<br>GROUP BY s.schema_name;<br><br>I also have one for oracle, much more complete...
<br><br><br>Thanks,<br>Paulo<br>