Back to: DATA PROCESSING SS 3
Welcome to class!
In today’s class, we will be talking about crash recovery. Enjoy the class!
Crash Recovery
Definition
Crash recovery is the process by which the database is moved back to a consistent and usable state. This is done by rolling back incomplete transactions and completing committed transactions that were still in memory when the crash occurred. When the database is in a consistent and usable state, it has attained what is known as a point of consistency. Following a transaction failure, the database must be recovered.
Conditions that can result in transaction failure
- A power failure on the machine causing the database manager and the database partitions on it to go down.
- A hardware failure such as memory corruption, or disk, CPU, or network failure.
- A serious operating system error that causes the DB to go down
Introduction to ARIES (Algorithms for Recovery and Isolation Exploiting Semantics)
ARIES is a recovery algorithm designed to work with no-force, steal database approach. It is used by IBM DB2, MS SQL Server and many other database systems.
The three main principles that lie behind the ARIES recovery algorithm
- Write ahead logging: Any change to an object is first recorded in the log, and then the log must be written to stable storage before changes to the object are written to a disk.
- Repeating history during Redo: On restart, after a crash, ARIES retraces the actions of a database before the crash and brings the system back to the exact state that it was in before the crash. The n it undoes the transaction still active at crash time.
- Logging changes during Undo: Change made to the database while undoing transactions are logged to ensure such an action isn’t repeated in the event of repeated restarts.
Recovery procedure after crash
The recovery works in three phases
- Analysis Phase: The first phase, analysis, compute all the necessary information from the log file.
- REDO Phase: The Redo phase restores the database to the exact state at the crash, including all the changes of uncommitted transactions that were running at that point time.
- UNDO Phase: The undo phase then undoes all uncommitted changes, leaving the database in a consistent state. After the redo phase, the database reflects the exact state at the crash. However, the changes of uncommitted transactions have to be undone to restore the database to a consistent state.
Evaluation
- Define crash recovery.
- Explain the term ARIES.
Other recovery related to the data structure
-
The write-ahead log protocol:
Write-ahead Logging (WAL) is a family of techniques for providing atomicity and durability (two of the ACID properties) in database systems. In a system using WAL, all modifications are written to a log before they are applied. Usually, both redo and undo information is stored in the log. WAL allows updates of a database to be done in one place.
-
Atomicity:
This is the property of transaction processing whereby either all the operations of transactions are executed or none of them is executed (all-or-nothing)
-
Durability:
This is the ACID property which guarantees that transactions that have committed will survive permanently.
-
Log:
A transaction log (also transaction journal, database log, binary log or audit trail) is a history of actions executed by a database management system to guarantee ACID properties over crashes or hardware failure. Physically, a log is a file of updates done to the database, stored in stable storage.
In our next class, we will be talking about Checkpointing and Media Recovery. We hope you enjoyed the class.
Should you have any further question, feel free to ask in the comment section below and trust us to respond as soon as possible.
School Owner? Looking for ready-made content and tools to save time and grow easily? Book a free demo session nowGet more class notes, videos, homework help, exam practice on Android [DOWNLOAD]
Get more class notes, videos, homework help, exam practice on iPhone [DOWNLOAD]