In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Under the 1.mysql view instance, the size of each database select TABLE_SCHEMA, concat (truncate (sum (data_length) / 1024comp1024sum 2), 'MB') as data_size,concat (truncate (sum (index_length) / 1024Universe 1024MB' 2),' MB') as index_sizefrom information_schema.tablesgroup by TABLE_SCHEMAorder by data_length desc;2.mysql view the size of a table in a specific library. Select concat (round (sum (DATA_LENGTH/1024/1024), 2),'M') from tables where table_schema=\ "${db}\" AND table_name=\ "${table}\" 3. Check the size of each table under all libraries under the mysql instance. #! / bin/bash > allsize.txtfor n in `cat mysqlbackuplist.txt`do echo = ${n} = > > allsize.txtfor db in `qlbackuplist.txt`do show databases;' | awk'NR > 1 {print $1}'| egrep-v 'schema | tmp | sys | innodb | mysql | tigasedb' `do > ${db} size.txt echo = ${db} = echo = ${db} = > allsize.txtfor table in `mysql-uroot-ppassword-hongn-e "use ${db}" Show tables "`do selectsql=" select concat (round (sum (DATA_LENGTH/1024/1024), 2),'M') from tables where table_schema=\ "${db}\" AND table_name=\ "${table}\"; "mysql-uroot-ppassword-hobby n-e" use information_schema $selectsql "| awk-v table=$table'NR > 1 {print table"$1}'> > ${db} size.txt done cat ${db} size.txt | sort-k 2-rn > > allsize.txt done done
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.