Recovery Flashcards

1
Q

In the context of transaction durability, why is it mentioned that some failures are unavoidable?

A

Some failures are considered unavoidable in the context of transaction durability because they may result from unexpected and uncontrollable events, such as system crashes, power failures, hardware problems, or natural disasters. These events can interrupt the normal operation of a system, and ensuring durability involves handling such failures robustly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the significance of the failure of integrity constraints in the context of transactions?

A

The failure of integrity constraints poses a risk to the consistency and correctness of the database. If integrity constraints are violated, it may lead to data inconsistencies and affect the overall reliability of the database system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does a system crash impact the durability of transactions?

A

A system crash can impact the durability of transactions by interrupting the normal execution of the system. Transactions that were in progress at the time of the crash might not have completed and committed, potentially leading to data inconsistencies. Ensuring durability involves recovering from such system crashes without compromising the integrity of transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name some examples of failures that fall under the category of user mistakes in a database system.

A

Examples of user mistakes in a database system include accidental deletion of critical data, entering incorrect values, or executing transactions without proper authorization. User mistakes can lead to data loss or incorrect data, affecting the overall reliability of the system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does the concept of transaction durability help in mitigating the impact of failures like sabotage or natural disasters?

A

Transaction durability helps mitigate the impact of failures like sabotage or natural disasters by ensuring that committed transactions are stored permanently and can be recovered even in the face of intentional malicious actions or unforeseen natural events. Durability mechanisms, such as logging and backup strategies, contribute to the system’s ability to withstand various types of failures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What principle is emphasized by the statement “Prevention is better than a cure” in the context of recovery?

A

The principle “Prevention is better than a cure” emphasizes the importance of taking proactive measures to prevent failures or issues before they occur, rather than relying solely on recovery mechanisms after the fact.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In the context of recovery, how does a reliable Operating System (OS) contribute to preventing failures?

A

A reliable OS contributes to preventing failures by providing a stable and well-designed platform for running applications. It helps ensure that the system operates smoothly, reducing the likelihood of unexpected crashes or errors that may require recovery.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What role does security play in the prevention aspect of recovery?

A

Security measures contribute to prevention by safeguarding the system against unauthorized access, malicious activities, and potential attacks. A secure system is less prone to data breaches or intentional disruptions, reducing the need for recovery from security-related incidents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do Uninterruptible Power Supply (UPS) and surge protectors contribute to preventing data loss or system failures?

A

Uninterruptible Power Supply (UPS) and surge protectors contribute to prevention by safeguarding against power-related issues. UPS ensures a continuous power supply during outages, preventing sudden shutdowns, while surge protectors mitigate the impact of voltage spikes, reducing the risk of hardware damage and data loss.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the role of RAID arrays in preventing data loss and enhancing system resilience?

A

RAID (Redundant Array of Independent Disks) arrays contribute to prevention by providing redundancy and fault tolerance. By distributing data across multiple disks in a RAID configuration, the system can continue functioning even if one disk fails, reducing the risk of data loss and minimizing the need for recovery.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Despite preventive measures, why is system recovery still deemed necessary?

A

System recovery is deemed necessary because preventive measures cannot protect against every possible scenario, including unforeseen events such as natural disasters, hardware failures, or user mistakes. Recovery mechanisms become crucial for restoring the system to a consistent and operational state when preventive measures fall short.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the primary objective of recovery techniques in the context of database management?

A

The primary objective of recovery techniques in database management is to guarantee database consistency in the event of a failure. These techniques ensure that the database can be restored to a valid and consistent state even after unexpected incidents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the two main parts of the recovery algorithm, and what do they involve?

A

The recovery algorithm consists of two main parts:

Actions during Normal Transaction Processing: These actions involve preparing the necessary information for recovery as transactions are executed. This includes logging changes made by transactions and ensuring that sufficient information is recorded to recreate the database state.

Actions after a Failure: These actions are taken in response to a failure. They involve using the information collected during normal transaction processing (such as transaction logs) to restore the database to a consistent state. This may include rolling back uncommitted transactions, redoing committed transactions, or other steps to ensure data integrity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is it important to have actions during normal transaction processing to prepare for recovery?

A

Actions during normal transaction processing are essential to prepare for recovery by capturing the necessary information to reconstruct the database in the event of a failure. This typically involves logging changes made by transactions, ensuring that there is a record of all modifications to the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In the context of recovery, what is the significance of logging changes made by transactions?

A

Logging changes made by transactions is significant for recovery because it provides a record of the modifications performed on the database. In the event of a failure, the transaction log can be used to undo the effects of uncommitted transactions and redo the effects of committed transactions, restoring the database to a consistent state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do actions taken after a failure contribute to restoring the database content?

A

Actions taken after a failure, utilizing information collected during normal transaction processing, contribute to restoring the database content by systematically applying recovery procedures. This may involve rolling back incomplete transactions and redoing committed transactions, ensuring that the database returns to a valid and consistent state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What does it mean for a disk to be considered stable in the context of a recovery algorithm?

A

In the context of a recovery algorithm, a stable disk implies that the disk never loses any information under any circumstances. It remains reliable and retains data integrity even in the face of failures or unexpected events.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How is stable storage approximated in practice, and what is the typical approach?

A

In practice, stable storage is approximated by data duplication. This involves maintaining multiple copies of data on separate disks. By storing copies at remote sites, the risk of data loss is reduced, as data would only be lost if all copies are destroyed simultaneously—a rare occurrence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the significance of maintaining multiple copies of data on separate disks for achieving stable storage?

A

Maintaining multiple copies of data on separate disks is significant for achieving stable storage because it provides redundancy. In case one disk fails or data is compromised, the copies on other disks can be used for recovery, ensuring data integrity and minimizing the risk of permanent data loss.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How does the concept of data duplication contribute to the stability of storage in the context of recovery?

A

Data duplication contributes to the stability of storage by providing backup copies of data. If one copy becomes inaccessible or is lost due to a failure, the duplicated copies can be used to recover the data. This redundancy enhances the reliability of storage and reduces the impact of potential data loss events.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Under what circumstances would data loss occur when using stable storage with data duplication?

A

Data loss would occur in the scenario where all copies of the data are destroyed simultaneously. This is considered very rare, especially when copies are stored on separate disks or at remote sites. The redundancy provided by data duplication minimizes the likelihood of such simultaneous destruction, enhancing the overall stability of storage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the primary purpose of the transaction log in a database system?

A

The primary purpose of the transaction log in a database system is to record details of all transactions. This includes any changes that transactions make to the database, as well as information about when and how transactions complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What information is typically recorded in the transaction log?

A

The transaction log typically records details about the changes made by transactions to the database. This includes information about updates, inserts, and deletes performed by transactions, as well as the timing and completion status of transactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Where is the transaction log stored, and why is this storage location significant?

A

The transaction log is stored on disk, not in memory. Storing the log on disk is significant because it ensures that the log is preserved even if the system crashes. Disk storage provides durability to the log, allowing for recovery in case of failures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the “Write Ahead Log” rule, and why is it important in transaction processing?

A

The “Write Ahead Log” rule states that the entry in the log must be made before COMMIT processing can complete. This rule is important for ensuring durability and consistency. By writing log entries before confirming the completion of a transaction, the system guarantees that the log reflects the changes made by the transaction before they are applied to the actual database. This helps in recovery and maintaining data integrity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

In the event of a system crash, how does the transaction log contribute to the recovery process?

A

In the event of a system crash, the transaction log plays a crucial role in the recovery process. It contains a record of transactions, allowing the system to reconstruct the state of the database by applying committed changes from the log. The log provides a trail of modifications that can be used to undo the effects of uncommitted transactions and redo the effects of committed transactions, ensuring a consistent and recoverable state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is the purpose of the “<T>" log record in log-based recovery?</T>

A

The “<T>" log record is created before a transaction T starts, and its purpose is to mark the initiation or start of the transaction. This record provides a reference point in the transaction log, indicating when the specific transaction began its execution.</T>

28
Q

Why is a log record created before a transaction executes a write operation (e.g., write(X)) in log-based recovery?

A

A log record is created before a transaction executes a write operation to capture the changes made by that transaction to the database. This log entry, often containing information about the write operation, ensures that the changes are logged before they are applied to the actual database. In the event of a failure, this log entry assists in the recovery process.

29
Q

What information is typically included in the log record created before a write operation (e.g., write(X))?

A

The log record created before a write operation typically includes information such as the transaction ID, the data item being written (e.g., X), the old value (before the write), and the new value (after the write). This information is crucial for redo and undo operations during recovery.

30
Q

What is the significance of the “<T>" log record in the log-based recovery process?</T>

A

The “<T>" log record is created before a transaction T finishes, and its significance lies in marking the commitment point of the transaction. This record indicates that the transaction has completed its execution successfully and that its changes can be considered permanent. The presence of this log record is crucial for the recovery process to identify committed transactions.</T>

31
Q

How do these log records contribute to log-based recovery in the event of a system crash?

A

The log records (“<T>", write(X), "<T>") contribute to log-based recovery by providing a chronological record of the transaction's lifecycle. In the event of a system crash, these log entries assist in reconstructing the database state by allowing the system to redo committed changes and undo the effects of uncommitted or partially executed transactions, ensuring a consistent and recoverable state.</T></T>

32
Q

In the context of recovery with checkpoints, why is it necessary to undo any transaction that was running at the time of failure?

A

It is necessary to undo any transaction that was running at the time of failure to ensure that the changes made by those transactions, which might not have completed and committed, are rolled back. This helps maintain the consistency of the database after recovery.

33
Q

Why is it necessary to redo any transaction that committed since the last checkpoint in recovery with checkpoints?

A

Redoing any transaction that committed since the last checkpoint is necessary to reapply the changes made by those transactions. Transactions that have committed since the last checkpoint might not have their changes permanently stored on the disk due to buffering mechanisms. Redoing ensures that these committed changes are reapplied, bringing the database to a consistent state.

34
Q

How does the concept of a checkpoint aid in the recovery process?

A

A checkpoint provides a reference point in the transaction timeline, indicating a moment when the system considers the database state consistent. In the recovery process, transactions are either rolled back or redone based on their status in relation to the last checkpoint, helping to reconstruct the database to a consistent state after a failure.

35
Q

What log entry is typically used to log a checkpoint in the transaction log?

A

To log a checkpoint, the entry commonly used is the “<Checkpoint>" log record. This entry marks the point in the transaction log where the checkpoint occurred, providing a reference for recovery procedures.</Checkpoint>

36
Q

What information does the “<Checkpoint>" log entry typically include?</Checkpoint>

A

The “<Checkpoint>" log entry typically includes information such as the transaction ID of the checkpoint operation, the state of the database at the checkpoint, and any other relevant metadata indicating the point in the transaction timeline where the checkpoint was taken.</Checkpoint>

37
Q

In the context of transaction recovery, why is it necessary to initialize two lists of transactions: UNDO and REDO?

A

Initializing two lists of transactions, UNDO and REDO, is necessary to categorize transactions based on their status in relation to the last checkpoint. The UNDO list includes transactions running at the last checkpoint, which might need to be rolled back, while the REDO list is initially empty and will be used to track transactions that committed after the last checkpoint.

38
Q

What criteria are used to determine which transactions are added to the UNDO list during the recovery process?

A

Transactions are added to the UNDO list if their corresponding log entry indicates that the transaction started (“<start>" entry). This means that the transaction was running at the time of the last checkpoint and might need to be undone during recovery.</start>

39
Q

What criteria are used to determine which transactions are moved from the UNDO list to the REDO list during the recovery process?

A

Transactions are moved from the UNDO list to the REDO list if their corresponding log entry indicates that the transaction committed (“<commit>" entry). This means that the transaction, which was running at the time of the last checkpoint, has completed successfully and its changes need to be redone during recovery.</commit>

40
Q

Why is it important to process every entry in the log since the last checkpoint during the recovery process?

A

Processing every entry in the log since the last checkpoint is crucial for capturing the entire transaction history from the last consistent state to the point of failure. This ensures that all transactions and their corresponding actions are considered during recovery, allowing for a comprehensive reconstruction of the database.

41
Q

How does the information in the log entries (“<start>" and "<commit>") contribute to the identification of transactions for UNDO and REDO during the recovery process?</commit></start>

A

The log entries (“<start>" and "<commit>") provide information about the status of transactions. "<start>" entries help identify transactions running at the last checkpoint that might need to be undone, while "<commit>" entries indicate transactions that committed after the last checkpoint and need to be redone. This information guides the categorization of transactions into the UNDO and REDO lists during the recovery process.</commit></start></commit></start>

42
Q

In the context of recovery with a checkpoint, what is meant by “backwards recovery”?

A

“Backwards recovery” refers to the process of undoing transactions by working backward through the transaction log. This involves reversing the effects of transactions that were running at the time of the last checkpoint, as identified in the UNDO list. The goal is to roll back these transactions and return the database to a consistent state.

43
Q

What is the purpose of working backwards through the log and undoing every record by any transaction on the UNDO list during recovery?

A

The purpose of working backwards through the log and undoing every record by any transaction on the UNDO list is to reverse the changes made by these transactions. By systematically undoing the actions recorded in the log for each transaction on the UNDO list, the database is brought back to a state consistent with the last checkpoint.

44
Q

How does “forwards recovery” contribute to the recovery process in the context of checkpoint recovery?

A

“Forwards recovery” involves redoing transactions by working forward through the log and reapplying the changes made by transactions on the REDO list. This process brings the database up to date by reexecuting the committed transactions that occurred after the last checkpoint. Forwards recovery ensures that the effects of these transactions are applied, completing the recovery process.

45
Q

What is the key objective of redoing any record by a transaction on the REDO list during forwards recovery?

A

The key objective of redoing any record by a transaction on the REDO list during forwards recovery is to reapply the changes made by committed transactions that occurred after the last checkpoint. This ensures that the database is brought up to date, and the effects of these transactions are reflected in the final recovered state.

46
Q

How does the combination of backwards recovery and forwards recovery contribute to achieving a consistent and up-to-date database state after a failure?

A

The combination of backwards recovery and forwards recovery ensures a comprehensive approach to recovering the database after a failure. Backwards recovery undoes the effects of transactions running at the last checkpoint, while forwards recovery reapplies the effects of transactions committed after the last checkpoint. Together, these processes bring the database to a consistent and up-to-date state, ensuring data integrity and completeness.

47
Q

In the context of the simplified discussion on transaction recovery, what is the significance of the statement “Recalls data write to buffer”?

A

The statement “Recalls data write to buffer” indicates that the discussion might not consider the delay between when data is written to a buffer in memory and when it is eventually flushed to disk. This delay can impact the recovery process, especially if the system experiences a failure before the data in the buffer is persisted to stable storage (disk).

48
Q

How does the delay between data write to a buffer and its flushing to disk impact the recovery process in the context of the discussed recovery scheme?

A

The delay between data write to a buffer and its flushing to disk can impact the recovery process by introducing a window of vulnerability. If a failure occurs before the data in the buffer is flushed to disk, there is a risk of losing recent changes. This is a consideration that might not be addressed in the discussed recovery scheme.

49
Q

What does the term “immediate DB modification recovery scheme” mean in the context of the log scheme mentioned?

A

The term “immediate DB modification recovery scheme” suggests that the recovery scheme involves immediately modifying the database as transactions are executed. In this scheme, changes made by transactions are applied to the actual database in real-time, and the corresponding log entries are used to ensure durability and support recovery in case of failures.

50
Q

What is mentioned about the log scheme following the statement “Our log scheme follows the ‘immediate DB modification recovery scheme’”?

A

Following the statement about the log scheme following the “immediate DB modification recovery scheme,” it is mentioned that there are many other recovery schemes, such as the “Deferred DB modification” scheme. However, specific details about these alternative recovery schemes are not provided in the given information.

51
Q

Why is it noted that the information about the delay and the log scheme is “not required in syllabus”?

A

The note “not required in syllabus” suggests that the details about the delay in flushing data to disk and the specific log scheme used may not be part of the curriculum or syllabus for the course or educational program being discussed. It indicates that the additional complexities introduced by these factors might not be covered in the current learning material.

52
Q

In the context of recovery from system failures, why are these failures considered less severe than media failures?

A

System failures are considered less severe than media failures because, in the case of system failures, only the information since the last checkpoint is affected. The transaction log, which contains a record of transactions since the last checkpoint, can be used for recovery. In contrast, media failures, such as disk failures, can result in damage to the stored data and the transaction log itself, posing a more serious challenge.

53
Q

What is the key advantage of having a transaction log in the recovery process after system failures?

A

The key advantage of having a transaction log in the recovery process after system failures is that the log contains a record of transactions since the last checkpoint. This allows for the reconstruction of the database to a consistent state by undoing and redoing transactions based on the information in the log.

54
Q

Why are media failures, such as disk failures, considered more serious than system failures?

A

Media failures, such as disk failures, are considered more serious than system failures because they can result in physical damage to the stored data. In addition to the potential loss or corruption of data on the disk, the transaction log itself may be damaged, making it challenging to rely on the log for recovery. Media failures require more robust recovery mechanisms and may involve restoring data from backup copies.

55
Q

How does the concept of a checkpoint mitigate the impact of system failures in the recovery process?

A

The concept of a checkpoint mitigates the impact of system failures by providing a reference point in the transaction log. Since only the information since the last checkpoint is affected in a system failure, the recovery process can start from this consistent state. The transaction log is then used to undo and redo transactions, bringing the database back to a consistent state.

56
Q

In the case of media failures, why is the potential damage to the transaction log itself highlighted as a serious concern?

A

The potential damage to the transaction log in the case of media failures is highlighted as a serious concern because the transaction log is a critical component of the recovery process. If the log is damaged, it becomes challenging to rely on it for reconstructing the database state. Ensuring the integrity of the transaction log is crucial for successful recovery from media failures.

57
Q

Why are backups considered necessary in the context of recovery from media failure?

A

Backups are considered necessary in the context of recovery from media failure because they provide a copy of the transaction log and the entire database on secondary storage. In the event of a media failure, such as disk damage, backups can be used to restore the data and transaction log, facilitating the recovery process.

58
Q

What does it mean when it is mentioned that backups are “very time consuming” and “often requires downtime”?

A

The statement “very time consuming” suggests that creating backups involves a significant amount of time, as it requires copying the entire database and transaction log to secondary storage. The mention of “often requires downtime” indicates that, during the backup process, there may be a need to temporarily pause or limit access to the database to ensure data consistency.

59
Q

What is the primary purpose of determining the backup frequency?

A

The primary purpose of determining the backup frequency is to strike a balance between ensuring that little information is lost in the event of a failure and avoiding potential problems associated with too frequent backups. The goal is to find a compromise that minimizes data loss while not causing disruptions to normal system operations.

60
Q

What are the considerations mentioned in finding a common compromise for backup frequency?

A

The considerations for finding a common compromise for backup frequency include making backups frequent enough to minimize the loss of information in case of a failure. However, backups should not be so frequent as to cause operational problems or excessive resource utilization. A common compromise is to perform backups every night.

61
Q

Why is every night mentioned as a common compromise for backup frequency?

A

Every night is mentioned as a common compromise for backup frequency because performing backups on a nightly basis strikes a balance between minimizing data loss and avoiding excessive disruptions to system operations. This frequency allows for a relatively up-to-date copy of the database and transaction log without requiring backups to be performed too frequently, potentially impacting system performance.

62
Q

What is the initial step in the recovery process from media failure, as mentioned in the provided information?

A

The initial step in the recovery process from media failure is to restore the database from the last backup. This involves using a previously created backup copy of the database to replace the damaged or lost data due to the media failure.

63
Q

How is the transaction log utilized in the recovery process after restoring the database from the last backup?

A

After restoring the database from the last backup, the transaction log is used to redo any changes made since the last backup. The log contains a record of transactions that occurred after the backup was created, allowing the system to reapply these changes and bring the database up to date.

64
Q

What potential issue is highlighted if the transaction log is damaged during media failure recovery?

A

If the transaction log is damaged during media failure recovery, it becomes impossible to perform the redo step (Step 2). The transaction log is crucial for replaying the changes made since the last backup, and damage to the log can impede the recovery process.

65
Q

How does storing the transaction log on a separate physical device reduce the risk in the context of media failure recovery?

A

Storing the transaction log on a separate physical device from the database hard drive, such as a secondary server, reduces the risk of losing both the database and the transaction log together in the event of a media failure. By keeping them on separate devices, the chances of simultaneous damage or loss are minimized, enhancing the overall resilience of the recovery process.

66
Q

What is the rationale behind recommending the storage of the transaction log on a separate physical device?

A

The rationale behind recommending the storage of the transaction log on a separate physical device is to mitigate the risk of data loss in the event of a media failure. Separating the transaction log from the database hard drive reduces the likelihood of losing both critical components simultaneously, improving the chances of successful recovery and data restoration.