Created
August 13, 2012 10:38
-
-
Save d34dh0r53/3339258 to your computer and use it in GitHub Desktop.
One Liner for DML Ops on MySQL binary logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqlbinlog /path/to/mysql-bin.000999 | \ | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment