background image
4
5
6
7
8
tablespace with space identifier 1
2016-09-26T23:51:06.159101Z 0 [Note] InnoDB: Truncating UNDO tablespace
with space identifier 2
2016-09-26T23:51:06.242355Z 0 [Note] InnoDB: Completed truncate of UNDO
tablespace with space identifier 2
2016-09-26T23:51:06.242378Z 0 [Note] InnoDB: Truncating UNDO tablespace
with space identifier 3
2016-09-26T23:51:06.313036Z 0 [Note] InnoDB: Completed truncate of UNDO
tablespace with space identifier 3
2016-09-26T23:51:06.313060Z 0 [Note] InnoDB: Truncating UNDO tablespace
with space identifier 4
2016-09-26T23:51:06.403003Z 0 [Note] InnoDB: Completed truncate of UNDO
tablespace with space identifier 4
观察物理文件
[root@HE3 undolog]# ls -lshrt
total 168M
76M -rw-r----- 1 mysql mysql 76M Sep 26 16:56 undo003
10M -rw-r----- 1 mysql mysql 10M Sep 26 16:56 undo001
10M -rw-r----- 1 mysql mysql 10M Sep 26 16:56 undo004
72M -rw-r----- 1 mysql mysql 72M Sep 26 16:56 undo002
可以看到超过 100M 设定值的 undo 日志已经回收,默认为 10M,undo log 空间得以释放
Part3:意义
该功能降低了磁盘的使用率,并且可以提高诸如 Xtrabackup 这类物理备份软件的备份速度。
——
总结
——
MySQL5.7 的 undo log 在线回收功能,相比 MySQL5.6 更加灵活和实用,DBA 们再也不必因
为 ibdata1 文件越来越大,导致磁盘空间被占、物理备份越来越慢而头疼了。
由于笔者的
水平有限,编写时间也很仓促,文中难免会出现一些错误或者不准确的地方,不妥之处恳
请读者批评指正。