データベースの障害回復に用いられ,データベースの更新に関する情報が格納されているファイルはどれか。
平成21年度 春期 ITパスポート試験 問88
This question's explanation and your answers so far.
問 88
Incorrectア
An index file is an index that associates the values of a particular column of a table with the storage locations of the corresponding rows; it is a mechanism for speeding up searches. Its contents are search keys and location information, not a history of updates, and it cannot serve as material for failure recovery. On the contrary, after a failure it is the kind of file that gets rebuilt from the main data. It satisfies neither of the two conditions in the question.
Incorrectイ
It is true that a backup file is used for failure recovery, which makes this choice confusing, but what it stores is a copy (a snapshot) of the database at a certain point in time, not information about updates, that is, the before and after values and the history of the update order. A backup alone can only restore the data up to the moment it was taken; advancing from there to the latest state additionally requires the log file. The question asks for the file that stores update information, so イ satisfies only half of the conditions.
- ウ
正解 The correct answer is ウ, the log file. A log file (also called a journal file) keeps recording, in chronological order, when each database update happened, which data was updated, what its value was before the update, and what it became after the update. That is exactly the information about database updates that the question refers to. When a failure occurs, recovery is possible precisely because this record exists. If a transaction ends abnormally partway through, the before-update values (the before-image log) are used to cancel the updates and return to the state before processing; this is rollback (backward recovery). If the database itself is damaged by a disk failure or similar, the backup is restored first, and then the after-update values recorded since the backup was taken (the after-image log) are applied in order to bring the data up to the latest state; this is rollforward (forward recovery). Both recovery methods take the log file as their input, and ウ is the only choice that satisfies both conditions in the question at the same time: storing update information and being used for failure recovery.
Incorrectエ
A load module file is a file that holds an executable program obtained by translating (compiling) a source program and then link-editing it into a form that can be loaded into main memory. It is a term from the field of program development (compiling and linking), not from the database field. It holds no history of data updates and cannot serve as input for failure recovery, so it is unrelated to the question.
- Log file (journal file) = a file that records the before-update and after-update values of the database in chronological order. It is the indispensable source of update history for failure recovery, and it is used by both rollback (backward recovery, undoing updates with the before-image log) and rollforward (forward recovery, advancing with the after-image log after the backup is restored).
- Distinguish the roles of the backup and the log: a backup is a copy at one point in time, while the log is the history of the updates made after that. Real recovery from a media failure is carried out in two stages, restoring the backup and then rolling forward with the log, so the side that holds the update information is always the log.