开发者

binary log files analysis

开发者 https://www.devze.com 2023-01-11 10:24 出处:网络
I had used a tool to open and analyze the binary files. The output used to be insert into table1 update table4开发者_运维知识库

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

精彩评论

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

关注公众号