Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

binary log files analysis

Tags:

mysql

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?

like image 840
shantanuo Avatar asked Aug 12 '10 08:08

shantanuo


1 Answers

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
like image 169
shantanuo Avatar answered Nov 23 '22 00:11

shantanuo