Q.1 What is the primary goal of database recovery techniques?
To improve query performance
To restore the database to a correct state after a failure
To optimize disk storage
To create database indexes
Explanation - Recovery techniques ensure that the database remains consistent and accurate after failures such as system crashes or power outages.
Correct answer is: To restore the database to a correct state after a failure
Q.2 Which of the following is a type of database failure?
Transaction failure
System crash
Media failure
All of the above
Explanation - Database failures can occur due to transaction errors, system crashes, or physical media failures like disk corruption.
Correct answer is: All of the above
Q.3 What is the purpose of a log in database recovery?
To store backup copies of the database
To record all changes made to the database
To maintain user access privileges
To speed up query execution
Explanation - The log records all changes so that in the event of a failure, operations can be redone or undone to maintain consistency.
Correct answer is: To record all changes made to the database
Q.4 Which recovery technique uses checkpoints to reduce recovery time?
Deferred update
Immediate update
Checkpointing
Shadow paging
Explanation - Checkpointing periodically saves the database state, reducing the number of actions needed to recover after a failure.
Correct answer is: Checkpointing
Q.5 In deferred update recovery, when are the database updates applied?
Immediately after each transaction starts
After the transaction successfully commits
During system startup
Never
Explanation - Deferred update applies changes only after the transaction is confirmed to commit, minimizing the need for rollback in case of failure.
Correct answer is: After the transaction successfully commits
Q.6 Which of the following recovery techniques writes updates directly to the database before transaction commits?
Deferred update
Immediate update
Checkpointing
Shadow paging
Explanation - Immediate update writes changes to the database as they occur but maintains logs to undo partial updates if the transaction fails.
Correct answer is: Immediate update
Q.7 What is the key idea behind shadow paging?
Maintaining an alternate copy of pages for recovery
Writing logs for each transaction
Delaying updates until commit
Using checkpoints to reduce recovery time
Explanation - Shadow paging keeps a shadow copy of database pages so the original remains unchanged until a transaction commits, simplifying recovery.
Correct answer is: Maintaining an alternate copy of pages for recovery
Q.8 What does 'undo' mean in database recovery?
Reapplying committed transactions
Reverting the effects of incomplete or failed transactions
Backing up the database
Optimizing queries
Explanation - Undo restores the database to a consistent state by rolling back the effects of transactions that did not commit.
Correct answer is: Reverting the effects of incomplete or failed transactions
Q.9 What does 'redo' mean in database recovery?
Rolling back committed transactions
Reapplying committed transactions from logs after a failure
Deleting incomplete transactions
Creating database backups
Explanation - Redo ensures that all committed transactions are reflected in the database even if the changes were not fully applied before a failure.
Correct answer is: Reapplying committed transactions from logs after a failure
Q.10 Which log-based recovery protocol ensures atomicity using undo and redo operations?
Deferred update
ARIES
Shadow paging
Checkpointing
Explanation - ARIES (Algorithms for Recovery and Isolation Exploiting Semantics) uses write-ahead logging, undo, and redo to ensure database consistency.
Correct answer is: ARIES
Q.11 Which of the following is true about checkpoints?
They slow down transactions significantly
They allow recovery to start from the last checkpoint instead of the beginning
They eliminate the need for logs
They automatically fix all database errors
Explanation - Checkpoints reduce recovery time by marking a point in the log from which recovery can begin rather than scanning the entire log.
Correct answer is: They allow recovery to start from the last checkpoint instead of the beginning
Q.12 Which failure type cannot be recovered using only transaction logs?
System crash
Media failure
Transaction failure
All can be recovered using logs
Explanation - Media failures require restoring from backups because logs alone cannot reconstruct lost or damaged storage devices.
Correct answer is: Media failure
Q.13 What is the purpose of write-ahead logging (WAL)?
To improve query performance
To ensure logs are written before database changes
To create backup copies automatically
To schedule transactions
Explanation - WAL guarantees that all changes are recorded in the log before being applied to the database, ensuring recoverability after failures.
Correct answer is: To ensure logs are written before database changes
Q.14 During recovery, which transactions need to be undone?
Transactions that committed successfully
Transactions that were incomplete at the time of failure
All transactions
Only read-only transactions
Explanation - Only incomplete or failed transactions need to be undone to maintain consistency and atomicity.
Correct answer is: Transactions that were incomplete at the time of failure
Q.15 During recovery, which transactions need to be redone?
Transactions that committed successfully
Transactions that were incomplete at the time of failure
All transactions
Only failed transactions
Explanation - Committed transactions may not have been fully applied before a failure and need to be redone to ensure durability.
Correct answer is: Transactions that committed successfully
Q.16 What does the 'analysis' phase in ARIES recovery do?
Determines which pages to undo
Scans the log to identify dirty pages and transactions to undo or redo
Applies all redo operations immediately
Creates database backups
Explanation - The analysis phase examines the log to determine which transactions were active and which pages may need redo or undo operations.
Correct answer is: Scans the log to identify dirty pages and transactions to undo or redo
Q.17 What is the main advantage of immediate update over deferred update?
Reduced disk I/O
Faster transaction commit
More accurate logs
No advantage
Explanation - Immediate update allows transactions to commit without waiting to apply all changes at the end, improving responsiveness.
Correct answer is: Faster transaction commit
Q.18 Which recovery method requires maintaining a complete copy of the database?
Shadow paging
Deferred update
Immediate update
ARIES
Explanation - Shadow paging maintains a shadow copy of database pages, ensuring that the original is unchanged until commit.
Correct answer is: Shadow paging
Q.19 What is the main drawback of shadow paging?
Increased logging overhead
Extra storage and complexity for shadow pages
Inability to recover from transaction failure
Requires checkpoints
Explanation - Shadow paging requires additional storage for shadow pages and complex page management, which can be expensive.
Correct answer is: Extra storage and complexity for shadow pages
Q.20 Which technique is generally combined with logs to recover from media failures?
Checkpoints
Database backups
Shadow paging
Deferred update
Explanation - Media failures destroy the database on disk, so backups along with logs are used to restore the database to a consistent state.
Correct answer is: Database backups
Q.21 Which of the following best describes a 'transaction failure'?
A failure due to power outage
A failure that occurs while executing a transaction, leaving it incomplete
A failure of the disk hardware
A failure caused by network issues
Explanation - Transaction failures occur when a transaction cannot complete successfully due to logical errors or system interruptions.
Correct answer is: A failure that occurs while executing a transaction, leaving it incomplete
Q.22 Which of the following statements is true about deferred update recovery?
Changes are applied to the database immediately
Changes are applied only after commit
No logs are maintained
It cannot handle transaction failures
Explanation - Deferred update ensures that database changes are applied only after a transaction commits, simplifying undo operations.
Correct answer is: Changes are applied only after commit
Q.23 Why is logging essential in database recovery?
It improves query performance
It provides a record to undo or redo transactions after failure
It reduces disk storage usage
It eliminates the need for checkpoints
Explanation - Logs are the primary source for determining which operations need to be undone or redone during recovery.
Correct answer is: It provides a record to undo or redo transactions after failure
Q.24 What is the role of a 'dirty page' in recovery?
A page that has not been read yet
A page that has been modified in memory but not yet written to disk
A page with a corrupted index
A page used for backup only
Explanation - Dirty pages must be carefully managed during recovery to ensure all committed updates are properly applied.
Correct answer is: A page that has been modified in memory but not yet written to disk
