开发者

binary log files analysis

I had used a tool to open and analyze the binary files. The output used to be

insert into table1
update table4开发者_运维知识库
insert into some_other_table

It used to show how many insert or update statements where there in the binary file. It was useful to know if the server is inserting/ deleting records or if there are heavy updates happening.

I do not remember the name of the utility. any hint?


Finally got the tool I was looking for.

http://forge.mysql.com/tools/tool.php?id=273

Since the link is not working, here is the code...

mysqlbinlog filename | grep -i -e "^update" -e "^insert" -e "^delete" -e "^replace" -e "^alter" | cut -c1-100 | tr '[A-Z]' '[a-z]' | sed -e "s/\t/ /g;s/\`//g;s/(.*$//;s/ set .*$//;s/ as .*$//" | sed -e "s/ where .*$//" | sort | uniq -c | sort -nr | head -50
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜