這篇文章將為大家詳細(xì)講解有關(guān)MySQL中InnoDB崩潰恢復(fù)過(guò)程的示例分析,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
創(chuàng)新互聯(lián)建站主營(yíng)合山網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,重慶APP開(kāi)發(fā),合山h5小程序定制開(kāi)發(fā)搭建,合山網(wǎng)站營(yíng)銷(xiāo)推廣歡迎合山等地區(qū)企業(yè)咨詢(xún)
1、redo log操作:保證已提交事務(wù)影響的最新數(shù)據(jù)刷到數(shù)據(jù)頁(yè)里。
2、undo log操作:保證未提交事務(wù)影響的數(shù)據(jù)頁(yè)回滾。
3、寫(xiě)緩沖(change buffer)合并。
4、purge操作。
InnoDB的一種垃圾收集機(jī)制,使用單獨(dú)的后臺(tái)線(xiàn)程周期性處理索引中標(biāo)記刪除的數(shù)據(jù)。
實(shí)例
/* Look for MLOG_CHECKPOINT. */ recv_group_scan_log_recs(group, &contiguous_lsn, false); /* The first scan should not have stored or applied any records. */ ut_ad(recv_sys->n_addrs == 0); ut_ad(!recv_sys->found_corrupt_fs); if (recv_sys->found_corrupt_log && !srv_force_recovery) { log_mutex_exit(); return(DB_ERROR); } if (recv_sys->mlog_checkpoint_lsn == 0) { if (!srv_read_only_mode && group->scanned_lsn != checkpoint_lsn) { ib::error() << "Ignoring the redo log due to missing" " MLOG_CHECKPOINT between the checkpoint " << checkpoint_lsn << " and the end " << group->scanned_lsn << "."; if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { log_mutex_exit(); return(DB_ERROR); } } group->scanned_lsn = checkpoint_lsn; rescan = false; } else { contiguous_lsn = checkpoint_lsn; rescan = recv_group_scan_log_recs( group, &contiguous_lsn, false); if ((recv_sys->found_corrupt_log && !srv_force_recovery) || recv_sys->found_corrupt_fs) { log_mutex_exit(); return(DB_ERROR); } } /* NOTE: we always do a 'recovery' at startup, but only if there is something wrong we will print a message to the user about recovery: */ if (checkpoint_lsn != flush_lsn) { if (checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT < flush_lsn) { ib::warn() << " Are you sure you are using the" " right ib_logfiles to start up the database?" " Log sequence number in the ib_logfiles is " << checkpoint_lsn << ", less than the" " log sequence number in the first system" " tablespace file header, " << flush_lsn << "."; } if (!recv_needed_recovery) { ib::info() << "The log sequence number " << flush_lsn << " in the system tablespace does not match" " the log sequence number " << checkpoint_lsn << " in the ib_logfiles!"; if (srv_read_only_mode) { ib::error() << "Can't initiate database" " recovery, running in read-only-mode."; log_mutex_exit(); return(DB_READ_ONLY); } recv_init_crash_recovery(); } } log_sys->lsn = recv_sys->recovered_lsn; if (recv_needed_recovery) { err = recv_init_crash_recovery_spaces(); if (err != DB_SUCCESS) { log_mutex_exit(); return(err); } if (rescan) { contiguous_lsn = checkpoint_lsn; recv_group_scan_log_recs(group, &contiguous_lsn, true); if ((recv_sys->found_corrupt_log && !srv_force_recovery) || recv_sys->found_corrupt_fs) { log_mutex_exit(); return(DB_ERROR); } } } else { ut_ad(!rescan || recv_sys->n_addrs == 0); }
關(guān)于“mysql中InnoDB崩潰恢復(fù)過(guò)程的示例分析”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。
當(dāng)前文章:mysql中InnoDB崩潰恢復(fù)過(guò)程的示例分析
本文網(wǎng)址:http://jinyejixie.com/article44/posphe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供電子商務(wù)、網(wǎng)站維護(hù)、服務(wù)器托管、ChatGPT、商城網(wǎng)站、網(wǎng)站設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)