標籤:ssl dev set esc oracle 損壞 innodb 升級 file
昨天一早,開發人員反饋說一個測試環境報Tablespace is missing for table ‘db_rsk/XXX",周末剛升級過,特地讓開發回去查了下,說指令碼中肯定沒有drop table的操作。datadir下檢查了下,發現frm檔案在的ibd檔案沒有了,bing了下,沒發現類似異常。於是先回到mysql.err往回搜尋,半天后發現上周五下午mysql出現了一次異常宕機,說是磁碟空間不足了,看日誌該檔案被損壞了,如下:
2016-11-12 11:31:00 28443 [ERROR] Error writing file ‘/usr/local/Percona-Server-5.6.30-rel76.3-Linux.x86_64.ssl101/data/tmp-demo-slow.log‘ (errno: 1 - No space left on device)
2016-11-12 11:40:00 7fc9c995c700 InnoDB: Error: Write to file ./db_rsk/tb_rsk_compliancecalcservice.ibd failed at offset 0.
InnoDB: 65536 bytes should have been written, only 0 were written.
InnoDB: Operating system error number 28.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 28 means ‘No space left on device‘.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2016-11-12 11:40:00 28443 [ERROR] InnoDB: TRUNCATE TABLE db_rsk/tb_rsk_compliancecalcservice failed to create a new tablespace
2016-11-12 11:40:00 7fc9c995c700 InnoDB: cannot calculate statistics for table "db_rsk"."tb_rsk_compliancecalcservice" because the .ibd file is missing. For help, please refer to http://dev.mysql.com/doc/refma
n/5.6/en/innodb-troubleshooting.html
隨後後台就一直報 ibd file is missing。
找到問題了,解決就方便了,找個備份,把這張表重新匯入進去就可以了。
這說回來,mysql的容錯程度比oracle好多了,oracle異常後恢複的時候經常要resetlogs,有些時候連resetlogs也會失敗。
硬碟空間滿導致mysql ibd檔案被刪後提示Tablespace is missing for table 'db_rsk/XXX"