vault backup: 2024-03-08 10:55:57
This commit is contained in:
@@ -55,7 +55,7 @@ Definition: Checkpoints are points of sync between database and log file. All bu
|
||||
- Checkpoint record to log file which contains identities of transactions active at time of checkpoint
|
||||
2. Resume processing.
|
||||
|
||||

|
||||
- 
|
||||
|
||||
### Example 1 ( Immediate )
|
||||
|
||||
@@ -88,3 +88,55 @@ Definition: Checkpoints are points of sync between database and log file. All bu
|
||||
|
||||
## Example of Log Use ( Immediate )
|
||||

|
||||
|
||||
# Shadow Paging
|
||||
|
||||
Alternative technique for providing atomicity and durability.
|
||||
DBMS maintains two page tables during the life of a transaction.
|
||||
1. Current Page
|
||||
2. Shadow Page Table
|
||||
|
||||
**Transaction Start**: Two pages are the same
|
||||
- Shadow page table is never changed, only used to restore database.
|
||||
**Transaction Execution**: current page table records all updates to database
|
||||
**Transaction End**: Current page table becomes shadow page table and all modified pages from database buffers written to secondary storage.
|
||||
**Transaction Failure**: new pages ignored, shadow page table becomes current page table.
|
||||
|
||||
# Tutorial
|
||||
|
||||
1. State whether each of the following is true or false. If it is false then briefly explain why.
|
||||
1. True
|
||||
2. True
|
||||
3. True
|
||||
4. False: REDO / NO UNDO
|
||||
5. True
|
||||
2. The DBMS maintains a log file containing transaction records that identify the start and end of transactions and the before and after images of the write operations. Consider the log files shown in Tables 32.1 and 32.2. For each one, explain what the DBMS recovery system would do, and why, if there was a failure at the time shown below each table and the DBMS was using:
|
||||
1. Deferred update protocol
|
||||
1. 32.1 Fail @10:24
|
||||
- Redo T1 as commit before failure. Ignore T2 and 3, active at point of failure. T4 not active at point of failure, Ignore.
|
||||
2. 32.2 Fail @9.21
|
||||
- Redo T2 and 4, since no commit occurs. T3 commits after the checkpoint, and anything before has no effect.
|
||||
1. Immediate update protocol
|
||||
1. 32.1 Fail @10.24
|
||||
- Undo T2 and 3, since they are active, and do not commit. T1 must be redone, and T4 is ignored, as it never started.
|
||||
2. 32.2 Fail @9:21
|
||||
- Undo T2 and 4, since they are active and do not commit. Redo T3, as it is active after the checkpoint.
|
||||
|
||||
# Workshop
|
||||
|
||||
1. 
|
||||
2. 
|
||||
3. 
|
||||
```
|
||||
SELECT SUM([UnitPrice]) AS TotalPrice
|
||||
FROM [Products]
|
||||
WHERE [SupplierID] = (
|
||||
SELECT [SupplierID]
|
||||
FROM [Suppliers]
|
||||
WHERE [Country] = 'UK'
|
||||
);
|
||||
|
||||
```
|
||||
|
||||
4. 
|
||||
1.
|
Reference in New Issue
Block a user