撤消日志表空间文件损坏后,MySQL恢复

时间:2019-06-21 06:13:28

标签: mysql

撤消日志分为6个表空间:

innodb_undo_tablespaces = 6

有人知道其中一种文件之后(例如undo004已损坏,现在是0字节的文件)后如何恢复吗? 还有一个名为undo_4_trunc.log的文件,但它也是0字节:

-rw-r-----  1 mysql mysql 1103101952 Jun 19 22:52 undo001
-rw-r-----  1 mysql mysql  964689920 Jun 19 22:52 undo002
-rw-r-----  1 mysql mysql  155004928 Jun 19 22:52 undo003
-rw-r-----  1 mysql mysql          0 Jun 19 22:52 undo004
-rw-r-----  1 mysql mysql 1006632960 Jun 19 22:52 undo005
-rw-r-----  1 mysql mysql  960495616 Jun 19 22:52 undo006
-rw-r-----  1 mysql mysql          0 Jun 19 22:52 undo_4_trunc.log

错误消息不是很有用,因为缺少文件名,但是在strace之后,我发现应该读取的文件为undo_4_trunc.log,如果移动了该文件,则为mysql尝试读取undo004。 error.log看起来像:

2019-06-21T06:08:10.014993Z 0 [Note] InnoDB: Recovering partial pages from the parallel doublewrite buffer at /mnt/data1/mysql-data/xb_doublewrite
2019-06-21T06:08:10.079377Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079428Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079433Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079437Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079462Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079466Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079470Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079473Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079477Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079480Z 0 [Warning] InnoDB: 16384 bytes should have been read. Only 0 bytes read. Retrying for the remaining bytes.
2019-06-21T06:08:10.079483Z 0 [Warning] InnoDB: Retry attempts for reading partial data failed.
2019-06-21T06:08:10.079487Z 0 [ERROR] InnoDB: Tried to read 16384 bytes at offset 0, but was only able to read 0
2019-06-21T06:08:10.079495Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2019-06-21T06:08:10.079498Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2019-06-21T06:08:10.079513Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-06-21T06:08:10.079518Z 0 [ERROR] InnoDB: File (unknown): 'read' returned OS error 71. Cannot continue operation
2019-06-21T06:08:10.079521Z 0 [ERROR] InnoDB: Cannot continue operation.

0 个答案:

没有答案