apt-get install -y percona-toolkit
# 检查重复索引
pt-duplicate-key-checker -host=’sohu.dev.chenpeng.info’
-port=’43307′ -databases=’grape’
# 运行状态监控
pt-mysql-summary -host=’sohu.dev.chenpeng.info’ -port=’43307′
-databases=’grape’
# 在线修改表结构
pt-online-schema-change -host=’sohu.dev.chenpeng.info’
-port=’3306′ -alter “ADD COLUMN c1 INT”
D=chenpeng_litchi,t=lc_operate_log -execute -print
pt-online-schema-change -host=’sohu.dev.chenpeng.info’
-port=’3306′ -alter “ENGINE=InnoDB”
D=chenpeng_litchi,t=lc_operate_log -execute -print
# 格式化explain结果
mysql -hsohu.dev.chenpeng.info -P43307 grape -e”explain SELECT
a.line_id,b.dnf_source FROM gp_report_advertiser_day a INNER JOIN
gp_line b ON a.line_id=b.id WHERE a.data_date=’2016-04-10′ LIMIT
100″ | pt-visual-explain
…
[获取更多]