解決mysql innodb page corrupt一例
在一臺訂單slave上遇到以下報錯
InnoDB: Apply batch completed
InnoDB: In a MySQL replication slave the last master binlog file
InnoDB: position 0 1133, file name deal_mysql-bin.000301
InnoDB: Starting in background the rollback of uncommitted transactions
090521 17:21:34 InnoDB: Rolling back trx with id 0 128093134, 1 rows to undo
090521 17:21:34 InnoDB: Started; log sequence number 48 925399944
InnoDB: !!! innodb_force_recovery is set to 1 !!!
InnoDB: Rolling back of trx id 0 128093134 completed
090521 17:21:35 InnoDB: Rollback of non-prepared transactions completed
090521 17:21:35 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.0.45-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 2096241.
InnoDB: You may have to recover from a backup.
090521 18:58:30 InnoDB: Page dump in ascii and hex (16384 bytes):
len 16384; hex e3d3ad2
後面是page dump。。。。
InnoDB: End of page dump
090521 18:58:30 InnoDB: Page checksum 1674816815, prior-to-4.0.14-form. checksum 3310524232
InnoDB: stored checksum 3822300463, prior-to-4.0.14-form. stored checksum 3310524232
InnoDB: Page lsn 48 796923670, low 4 bytes of lsn at page end 796923670
InnoDB: Page number (if stored to page already) 2096241,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be an index page where index id is 0 31945
InnoDB: (index PRIMARY of table c2cdb/t_deal_info_ref_buyer_677)
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 2096241.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: about forcing recovery.
隨後mysqld無法啟動--每次啟動時,在前滾,回滾完成之後,準備接受外部連線時丟擲上面的錯誤.
根據錯誤提示,先是重啟機器,以排除filesystem cache corrupt的可能
重啟後發現錯誤依舊, 於是根據連結提示,設定innodb_force_recovery=1後,強制啟動mysqld
1 (SRV_FORCE_IGNORE_CORRUPT)
Let the server run even if it detects a corrupt page. Try to make SELECT * FROM tbl_name jump over corrupt index records and pages, which helps in dumping tables.
**表示即使mysqld發現有頁損壞,也會啟動
線上執行check table,發現所有表都提示 status ok
錯誤日誌中顯示,是某個主鍵索引頁壞了,於是將該表的資料匯出來後將表drop掉,再匯入表資料
mysql> alter table t_deal_info_ref_buyer_677 drop primary key;
ERROR 1030 (HY000): Got error -1 from storage engine
mysql> create table t_deal_info_ref_buyer_677_dmp as select * from t_deal_info_ref_buyer_677;
ERROR 1030 (HY000): Got error -1 from storage engine
mysql> select * from t_deal_info_ref_buyer_677 into outfile '/tmp/t_deal_info_ref_buyer_677.txt';
Query OK, 12813 rows affected (0.16 sec)
mysql> drop table t_deal_info_ref_buyer_677;
Query OK, 0 rows affected
作了上述操作後,將my.cnf中的innodb_force_recovery註釋掉,重新啟動mysqld成功
上述解決過程有個疑問
直接drop index 會讀索引頁,所以失敗
奇怪的是ctas也失敗 ,而select into outfile成功
同樣是select,ctas會失敗.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-604185/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL5.7 InnoDB Page CompressionMySql
- MySQL:Innodb page clean 執行緒 (二) 解析MySql執行緒
- MySQL:Innodb page clean 執行緒 (一) 基礎MySql執行緒
- InnoDB: Error: space id and page n:o stored in the page?Error
- innodb_lock_monitor解決mysql死鎖MySql
- MySQL:5.6 大事務show engine innodb status故障一例MySql
- innblock 工具| InnoDB page觀察利器BloC
- mysql 匯入中文亂碼解決一例MySql
- MySQL原理 - InnoDB引擎 - 行記錄儲存 - Off-page 列MySql
- MySQL主從複製問題解決一例MySql
- InnoDB從內分析之Page(二)
- InnoDB:Failingassertion:page_get_n_recs(page)>1AI
- MySQL 5.6 GTID常見錯誤解決一例MySql
- 關於MYSQL INNODB index page header學習和實驗總結MySqlIndexHeader
- MySQL 8.0 Reference Manual(讀書筆記78節-- InnoDB Table and Page Compression (1))MySql筆記
- MySQL 8.0 Reference Manual(讀書筆記79節-- InnoDB Table and Page Compression (2))MySql筆記
- 【MySQL】崩潰恢復問題解決:Forcing InnoDB RecoveryMySql
- MySQL innodb_table_stats表不存在的解決方法MySql
- MySQL data pageMySql
- 遭遇 bug InnoDB: Failing assertion: page_get_n_recs(page) > 1AI
- Git 錯誤:fatel: loose object ... is corrupt 解決辦法GitObject
- MySQL show engine innodb status 詳解MySql
- MySQL的InnoDB索引原理詳解MySql索引
- 【Mysql】show engine innodb status詳解MySql
- mysql之InnoDB基礎瞭解MySql
- phpstudy自帶MySQL不支援innodb解決辦法 和 更換MySQL版本PHPMySql
- mysql 5.1.28 無法載入innodb解決方法(轉自網路)MySql
- MySQL:Innodb purge執行緒略解MySql執行緒
- MySQL InnoDB常見引數詳解MySql
- innodb page重組空間壓縮函式(btr_page_reorganize_low)註釋函式
- Rownum分頁故障解決一例
- oracle 死鎖解決方法一例Oracle
- ORA-00959 解決一例
- MySQL的root密碼忘記或丟失的解決方法一例MySql密碼
- MySQL InnoDB 索引MySql索引
- 詳解 MySql InnoDB 中意向鎖的作用MySql
- mysql 連線時通時不通解決一例MySql
- DRM引起的問題解決一例