Warning:警告
其中innodb_undo_directory参数要在数据库初始化时就需要写入my.cnf,否则会报如下错误:
Expected to open 4 undo tablespaces but was able to find only 0 undo tablespaces. Set the innodb_undo_tablespaces parameter to the correct value and retry. Suggested value is 0
②注意undolog的日志大小
[root@HE3 undolog]# ls -lshrt
total 412M
128M -rw-r----- 1 mysql mysql 128M Sep 26 16:56 undo004
76M -rw-r----- 1 mysql mysql 76M Sep 26 16:56 undo003
136M -rw-r----- 1 mysql mysql 136M Sep 26 16:56 undo001
72M -rw-r----- 1 mysql mysql 72M Sep 26 16:56 undo002
③error.log日志
2016-09-26T23:51:06.062828Z 0 [Note] InnoDB: Truncating UNDO tablespace with space identifier 1
2016-09-26T23:51:06.159077Z 0 [Note] InnoDB: Completed truncate of UNDO 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空间得以释放