This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Lock Release and Undo Operations”.
1. Which lock should be obtained to prevent a concurrent transaction from executing a conflicting read, insert or delete operation on the same key value.
a) Higher-level lock
b) Lower-level lock
c) Read only lock
d) Read write
View Answer
Explanation: Operations acquire lower-level locks while they execute, but release them when they complete; the corresponding transaction must however retain a higher-level lock in a two-phase manner to prevent concurrent transactions from executing conflicting actions.
2. Once the lower-level lock is released, the operation cannot be undone by using the old values of updated data items, and must instead be undone by executing a compensating operation; such an operation is called
a) Logical operation
b) Redo operation
c) Logical undo operation
d) Undo operation
View Answer
Explanation: It is important that the lower-level locks acquired during an operation are sufficient to perform a subsequent logical undo of the operation.
3. Which of the following is used for undo operations alone?
a) Logical logging
b) Physical logging
c) Physical log records
d) Physical logging and Physical log records
View Answer
Explanation: If the operation inserted an entry in a B+-tree, the undo information U would indicate that a deletion operation is to be performed, and would identify the B+-tree and what entry to delete from the tree. Such logging of information about operations is called logical logging.
4. Redo operations are performed exclusively using
a) Logical logging
b) Physical logging
c) Physical log records
d) Both Physical logging and Physical log records
View Answer
Explanation: Logging of old-value and new-value information is called physical logging.
5. To perform logical redo or undo, the database state on disk must be operation ___________ that is, it should not have partial effects of any operation.
a) Persistent
b) Resistant
c) Consistent
d) None of the mentioned
View Answer
Explanation: Data structures such as B+-trees would not be in a consistent state, and neither logical redo nor logical undo operations can be performed on an inconsistent data structure.
6. An operation is said to be __________ if executing it several times in a row gives the same result as executing it once.
a) Idempotent
b) Changed
c) Repetitive
d) All of the above
View Answer
Explanation: Operations such as inserting an entry into a B+-tree may not be idempotent, and the recovery algorithm must therefore make sure that an operation that has already been performed is not performed again.
7. Immediate database modification technique uses
a) Both undo and redo
b) Undo but no redo
c) Redo but no undo
d) Neither undo nor redo
View Answer
Explanation: Undo erases all the changes and redo makes the deleted changes.
8. Shadow paging has
a) no redo
b) no undo
c) redo but no undo
d) neither redo nor undo
View Answer
Explanation: Undo erases all the changes and redo makes the deleted changes.
9. For correct behaviour during recovery, undo and redo operation must be
a) Commutative
b) Associative
c) Idempotent
d) Distributive
View Answer
Explanation: Undo erases all the changes and redo makes the deleted changes.
10. If ___________ are not obtained in undo operation it will cause problem in undo-phase.
a) Higher-level lock
b) Lower-level lock
c) Read only lock
d) Read write
View Answer
Explanation: Operations acquire lower-level locks while they execute, but release them when they complete; the corresponding transaction must however retain a higher-level lock in a two-phase manner to prevent concurrent transactions from executing conflicting actions.
Sanfoundry Global Education & Learning Series – Database Management System.
- Practice RDBMS MCQ
- Check Programming Books
- Check Computer Science Books
- Practice Computer Science MCQs
- Apply for Computer Science Internship