[root@sztech setup]# cat -v mysql.sql #!/bin/bash^M$ ipaddress=`ip a|grep "global"|awk '{print $2}' |awk -F/ '{print $1}'`^M$ file_output='mysql.html'^M$ td_str=''^M$ th_str=''^M$ myuser="root"^M$ mypasswd="Wangjia"^M$ myip="192.168.133.151"^M$ myport="3306"^M$ mysql_cmd="mysql -u${myuser} -p${mypasswd} -h${myip} -P${myport} --protocol=tcp --silent"^M$ #yum -y install bc sysstat net-tools^M$ #================================================SQL Segments========================================================================^M$ TOP_SCHEMA_SQL="select table_schema,^M$ ROUND(SUM(TABLE_ROWS),2) as ALLSIZE_ROWS,^M$ ROUND(SUM(DATA_LENGTH+INDEX_LENGTH+DATA_FREE)/1024/1024,2) as ALLSIZE_MB,^M$ ROUND(SUM(DATA_LENGTH)/1024/1024,2) AS DATASIZE_MB,^M$ ROUND(SUM(INDEX_LENGTH)/1024/1024,2) AS INDEXSIZE_MB^M$ from information_schema.TABLES^M$ GROUP BY table_schema^M$ order by ALLSIZE_ROWS desc^M$ limit 10;^M$ "^M$ |
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) | Powered by Discuz! X3.2 |