In this post, I am sharing a useful DBA script to find largest databases on MySQL Server.
This kind of handy script always useful while DBA requires quick monitoring on the Database Server.
So, I am always finding this kind of script and sharing here for making DBA task easier.
So, I am always finding this kind of script and sharing here for making DBA task easier.
I prepared few calculated columns with the help of information_schema.TABLES.
1
2
3
4
5
6
7
8
9
10
11
|
SELECT
COUNT(*) AS TotalTableCount
,table_schema
,CONCAT(ROUND(SUM(table_rows)/1000000,2),'M') AS TotalRowCount
,CONCAT(ROUND(SUM(data_length)/(1024*1024*1024),2),'G') AS TotalTableSize
,CONCAT(ROUND(SUM(index_length)/(1024*1024*1024),2),'G') AS TotalTableIndex
,CONCAT(ROUND(SUM(data_length+index_length)/(1024*1024*1024),2),'G') TotalSize
FROM information_schema.TABLES
GROUP BY table_schema
ORDER BY SUM(data_length+index_length)
DESC LIMIT 10;
|
0 comments:
Post a Comment