Advanced Databases B – Exam Practice Questions & Answers
Recovery
1. Describe the mechanisms that can be employed in database recovery in a multi-user
environment. Show how these mechanisms can be used to recover from the different
types of failure. Mention the following in your answer: (25 Marks)
Commit and Rollback
Refers to the set of actions used to ensure that an application program either makes all
changes to the resources represented by a single unit recovery or recovery, or make no
changes at all.
The two phase commit protocol provides commit and roll back.
It verifies that either all changes or no changes are applied even if one of the elements
(like the application, system or resource manager) fails.
The protocol allows for restart and recovery processing to take place after system or
subsystem failure.
Transaction Log file
A transaction log is a history of actions executed by a database management system to
guarantee (ACID) properties over crashes or failures.
If, after a start, the database is found in an inconsistent state or not been shutdown
properly, the database management system reviews the database logs for uncommitted
transactions and rolls back the changes made by these transactions.
All transactions that are already committed but whose changes were not materialized in
the database are re-applied, to ensure atomicity and durability of transactions.
Before images and after images
When a transaction requires an update (change) to be carried out on the database,
Before images & After Images will be placed in transaction log file.
For example in the following salary increase takes place in an employee file:
The before image is a copy of a record as it exists in the database before it is updated, an
after image is the copy of the record taken immediately after it has been updated.
Checkpoints
A marker is placed in the transaction log at a point when any outstanding updates in
Chandni Karia Page 1 of 4
Recovery
1. Describe the mechanisms that can be employed in database recovery in a multi-user
environment. Show how these mechanisms can be used to recover from the different
types of failure. Mention the following in your answer: (25 Marks)
Commit and Rollback
Refers to the set of actions used to ensure that an application program either makes all
changes to the resources represented by a single unit recovery or recovery, or make no
changes at all.
The two phase commit protocol provides commit and roll back.
It verifies that either all changes or no changes are applied even if one of the elements
(like the application, system or resource manager) fails.
The protocol allows for restart and recovery processing to take place after system or
subsystem failure.
Transaction Log file
A transaction log is a history of actions executed by a database management system to
guarantee (ACID) properties over crashes or failures.
If, after a start, the database is found in an inconsistent state or not been shutdown
properly, the database management system reviews the database logs for uncommitted
transactions and rolls back the changes made by these transactions.
All transactions that are already committed but whose changes were not materialized in
the database are re-applied, to ensure atomicity and durability of transactions.
Before images and after images
When a transaction requires an update (change) to be carried out on the database,
Before images & After Images will be placed in transaction log file.
For example in the following salary increase takes place in an employee file:
The before image is a copy of a record as it exists in the database before it is updated, an
after image is the copy of the record taken immediately after it has been updated.
Checkpoints
A marker is placed in the transaction log at a point when any outstanding updates in
Chandni Karia Page 1 of 4