mysql binlog 统计_GitHub - wubx/mysql-binlog-statistic: Help you find tables which was change by binlo...

#mysql-binlog-statistic#

#parsebinlog

Help you find tables which was change by binlog statistic

通过binlog的分析统计,帮助你了解MySQL tables的变化

#dependency

`binlog_format = mixed

/usr/local/mysql/bin/mysqlbinlog

perl`

#how-to use

cd bin

chmod +x pasrebinlog

./parsebinlog /u1/mysql/logs/mysql-bin.000345

#format

output like :

`Table XX_db.XXinfo:

Type INSERT opt: 6

Type UPDATE opt: 601

10 col : 7

12 col : 14

13 col : 92

14 col : 61

16 col : 6

18 col : 97

19 col : 1

2 col : 39

3 col : 22

4 col : 3

5 col : 3

6 col : 144

8 col : 37

9 col : 75 `

cutlogbytime

##用于从慢日志用截取一个时间段的日志方便分析##

./cutlogbytime /path/slowlogfile starttime endtime

时间需要写时戳

mysql> select unix_timestamp('2013-04-05');

+------------------------------+

| unix_timestamp('2013-04-05') |

+------------------------------+

| 1365091200 |

+------------------------------+

1 row in set (0.00 sec)

mysql> select unix_timestamp('2013-04-06');

+------------------------------+

| unix_timestamp('2013-04-06') |

+------------------------------+

| 1365177600 |

+------------------------------+

1 row in set (0.00 sec)

./cutlogbytime /path/slowlogfile 1365091200 1365177600 > 20130405_slow.log

mysqlbinlog

支持flashback功能

./mysqlbinlog -B |mysql

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值