Database Fundamentals — Question 114
You work as ExamTopics Database Administrator for a MySQL database server.
In an hour or so, you are able to bring a corrupted server online.
You execute the CHECK TABLE command and find that some of the InnoDB tables need to be repaired.
You restart the server and discover that auto-recover has failed.
Which of the following steps will you take to recover the corrupted InnoDB tables?
Answer options
- A. Run the ANALYZE TABLE command.
- B. Run the REPAIR TABLE command.
- C. Recover the tables from the last backup.
- D. Run the OPTIMIZE TABLE command.
- E. Restart the server with the innodb_force_recovery option.
Correct answer: D
Explanation
The correct answer is E, as using the innodb_force_recovery option allows you to start the server in a mode that can help recover data from corrupted InnoDB tables. The other options either do not address InnoDB corruption directly or are not applicable in this scenario, as ANALYZE TABLE and OPTIMIZE TABLE are used for performance optimization, and REPAIR TABLE is not effective for InnoDB tables, while restoring from backup may not always be feasible.