SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Recovery
Recovery System
n   Failure classification
n   Log based recovery
n   Redo recovery
n   Rollback recovery
n   Immediate update scheme
n   Deferred update scheme
n   Checkpoints
n   Shadow paging
n   Backups                   2
Failure Classification



n   occurs 10-100 times in a minute
n   recovery required in transaction
    execution time


                                       3
Failure Classification



n   occurs several times a week
n   recovery required in a few
    minutes


                                  4
Failure Classification




 n   occurs intermittently
 n   recovery time depends on the nature
     of failure

                                       5
Failure Classification




n   occurs once or twice a year
n   recovery required in a few hours



                                       6
ACID Properties

             Atomicity     is atomic; its effect on the database
                           is either TOTAL or NONE.
                         takes the database from a consistent
        Consistency      state to another consistent state.

                  The intermediate updates should not be
    Isolation     visible to other concurrent transactions
                  until it is COMMITTED.

Durability      The changes to the database COMMITTED by it
                should not be lost through any subsequent
                failure.
                                                             7
How do I get the database
    Transaction                      to its final consistent
    States                          state?

                                  partially       committed
                                 committed
Start
Read Ram’s account      active
Debit Rs. 5000
Update Ram’s account
Read Sita’s account
                                       failed      aborted
Credit Rs. 5000
Update Sita’s account               How do I get the database
End                                 back to its consistent
                                    state?
                                                        8
The Problem: Buffering!
                          in      on
R: 15000   S: 45000     memory   disk
Start
Read Ram’s account      15000    15000

Debit Rs. 5000          10000    15000
Update Ram’s account    10000    15000?
Read Sita’s account     45000    45000
Credit Rs. 5000         50000    45000
Update Sita’s account   50000    45000?
End
R: 10000   S: 50000                       9
Log-based Recovery
n   maintain a log of incremental updates
n   update log before updating the database
    record
n   use synchronous write on log; this may be
    expensive - so, most DBMS‘s use special
    techniques to block log records
n   log can easily get voluminous; periodic
    purging or cyclic reuse resorted to
n   each record minimally contains trans id, data
    id, old value, new value, timestamp
                                               10
Redo Recovery


old
consistent
version

             roll-forward
             using
             after-images
                            new
                            consistent
                            version 11
Rollback Recovery
             rollback
             using           current
             before-images   corrupt
                             verion




old
consistent
verion
                                       12
The Immediate Update Scheme

n   undo the last partial transaction using
    the before entries
n   redo all the past committed transactions
    in the forward direction using the after
    entries
n   undo and redo are idempotent; this is
    important to recover from failure during
    the recovery process

                                         13
The Deferred Update Scheme

n   redo all the past committed transactions in
    the forward direction using the after entries
n   potentially heavy I/O at Commit: reads from
    log file and updates on database file
n   undo and redo are idempotent; this is
    important to recover from failure during the
    recovery process



                                               14
Checkpoints



 n   log keeps growing with the age of the session
 n   recovery gets very time-consuming
 n   most of the efforts are really wasteful since
     the updates are already on the disk, but
     cannot be avoided since there is no way of
     knowing where to start

                                               15
Checkpoints

 n   Stop accepting new transactions
 n   Suspend execution of transactions
     temporarily
 n   flush out all log records onto log file
 n   flush out buffer blocks to database
 n   flush out <checkpoint> log entry onto log file
 n   redefine the last checkpoint as the start of
     the recovery process

                                                16
Shadow Paging Scheme

  fixed
  pointer

                       current
                       page map




            shadow
            page map
                             17
Shadow Paging Scheme
n    To commit a transaction :
    1. Flush all modified pages in main memory
     to disk
    2. Output current page table to disk
    3. Make the current page table the new
     shadow page table, as follows:
     n   keep a pointer to the shadow page table at a fixed
         (known) location on disk.
     n   to make the current page table the new shadow
         page table, simply update the pointer to point to
         current page table on disk
                                                       18
n   Once pointer to shadow page table has
    been written, transaction is committed.
n   No recovery is needed after a crash —
    new transactions can start right away,
    using the shadow page table.
n   Pages not pointed to from
    current/shadow page table should be
    freed (garbage collected).

                                         19
On-line Backups
n   set database to offline mode
n   flush out all log records onto log file
n   flush out <start backup> onto log file
n   maintain backup log version
n   flush out buffer blocks to database
n   copy database to backup file
n   set database to online mode and update
    database using backup log
n   flush out <end backup> onto log file

                                              20
Off-line Backup (Dumps)
n   Media Failure
n   Restore from earlier backup by DBA
    n   Backup utilities available
    n   BACKUP DATABASE
         n   Complete vs Differential
n   Replication Server


                                         21

Weitere ähnliche Inhalte

Ähnlich wie 9

Create guaranteed restore point
Create guaranteed restore pointCreate guaranteed restore point
Create guaranteed restore pointViaggio Italia
 
Introduction to Akka Streams
Introduction to Akka StreamsIntroduction to Akka Streams
Introduction to Akka StreamsKnoldus Inc.
 
version controlling in software development
version controlling in software developmentversion controlling in software development
version controlling in software developmentAnushka Perera
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
TransactionsmanagementSanjeev Gupta
 
The Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup ExperiencesThe Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup Experiencesglbsolutions
 
Preparing Your Kafka Streams Application For Production and Beyond
Preparing Your Kafka Streams Application For Production and BeyondPreparing Your Kafka Streams Application For Production and Beyond
Preparing Your Kafka Streams Application For Production and BeyondHostedbyConfluent
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptAdemeCheklie
 
How We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and FasterHow We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and FasterScyllaDB
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and RecoveryMaham Huda
 
When Streaming Needs Batch With Konstantin Knauf | Current 2022
When Streaming Needs Batch With Konstantin Knauf | Current 2022When Streaming Needs Batch With Konstantin Knauf | Current 2022
When Streaming Needs Batch With Konstantin Knauf | Current 2022HostedbyConfluent
 
Disaster recovery in sql server
Disaster recovery in  sql serverDisaster recovery in  sql server
Disaster recovery in sql serverRajib Kundu
 
State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...
State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...
State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...Paris Carbone
 
Deployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna MitchellDeployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna Mitchelldpc
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in ReactTalentica Software
 

Ähnlich wie 9 (20)

Create guaranteed restore point
Create guaranteed restore pointCreate guaranteed restore point
Create guaranteed restore point
 
Introduction to Akka Streams
Introduction to Akka StreamsIntroduction to Akka Streams
Introduction to Akka Streams
 
version controlling in software development
version controlling in software developmentversion controlling in software development
version controlling in software development
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
Transactionsmanagement
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
 
The Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup ExperiencesThe Pensions Trust - VM Backup Experiences
The Pensions Trust - VM Backup Experiences
 
Nova states summit
Nova states summitNova states summit
Nova states summit
 
Preparing Your Kafka Streams Application For Production and Beyond
Preparing Your Kafka Streams Application For Production and BeyondPreparing Your Kafka Streams Application For Production and Beyond
Preparing Your Kafka Streams Application For Production and Beyond
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
 
How We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and FasterHow We Made Scylla Maintenance Easier, Safer and Faster
How We Made Scylla Maintenance Easier, Safer and Faster
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and Recovery
 
When Streaming Needs Batch With Konstantin Knauf | Current 2022
When Streaming Needs Batch With Konstantin Knauf | Current 2022When Streaming Needs Batch With Konstantin Knauf | Current 2022
When Streaming Needs Batch With Konstantin Knauf | Current 2022
 
Disaster recovery in sql server
Disaster recovery in  sql serverDisaster recovery in  sql server
Disaster recovery in sql server
 
3 transaction
3 transaction3 transaction
3 transaction
 
Chapter19
Chapter19Chapter19
Chapter19
 
State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...
State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...
State Management in Apache Flink : Consistent Stateful Distributed Stream Pro...
 
Deployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna MitchellDeployment With Subversion - Lorna Mitchell
Deployment With Subversion - Lorna Mitchell
 
4 db recovery
4 db recovery4 db recovery
4 db recovery
 
Web Performance & Latest in React
Web Performance & Latest in ReactWeb Performance & Latest in React
Web Performance & Latest in React
 
2 recovery
2 recovery2 recovery
2 recovery
 

Kürzlich hochgeladen

On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 

Kürzlich hochgeladen (20)

On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

9

  • 2. Recovery System n Failure classification n Log based recovery n Redo recovery n Rollback recovery n Immediate update scheme n Deferred update scheme n Checkpoints n Shadow paging n Backups 2
  • 3. Failure Classification n occurs 10-100 times in a minute n recovery required in transaction execution time 3
  • 4. Failure Classification n occurs several times a week n recovery required in a few minutes 4
  • 5. Failure Classification n occurs intermittently n recovery time depends on the nature of failure 5
  • 6. Failure Classification n occurs once or twice a year n recovery required in a few hours 6
  • 7. ACID Properties Atomicity is atomic; its effect on the database is either TOTAL or NONE. takes the database from a consistent Consistency state to another consistent state. The intermediate updates should not be Isolation visible to other concurrent transactions until it is COMMITTED. Durability The changes to the database COMMITTED by it should not be lost through any subsequent failure. 7
  • 8. How do I get the database Transaction to its final consistent States state? partially committed committed Start Read Ram’s account active Debit Rs. 5000 Update Ram’s account Read Sita’s account failed aborted Credit Rs. 5000 Update Sita’s account How do I get the database End back to its consistent state? 8
  • 9. The Problem: Buffering! in on R: 15000 S: 45000 memory disk Start Read Ram’s account 15000 15000 Debit Rs. 5000 10000 15000 Update Ram’s account 10000 15000? Read Sita’s account 45000 45000 Credit Rs. 5000 50000 45000 Update Sita’s account 50000 45000? End R: 10000 S: 50000 9
  • 10. Log-based Recovery n maintain a log of incremental updates n update log before updating the database record n use synchronous write on log; this may be expensive - so, most DBMS‘s use special techniques to block log records n log can easily get voluminous; periodic purging or cyclic reuse resorted to n each record minimally contains trans id, data id, old value, new value, timestamp 10
  • 11. Redo Recovery old consistent version roll-forward using after-images new consistent version 11
  • 12. Rollback Recovery rollback using current before-images corrupt verion old consistent verion 12
  • 13. The Immediate Update Scheme n undo the last partial transaction using the before entries n redo all the past committed transactions in the forward direction using the after entries n undo and redo are idempotent; this is important to recover from failure during the recovery process 13
  • 14. The Deferred Update Scheme n redo all the past committed transactions in the forward direction using the after entries n potentially heavy I/O at Commit: reads from log file and updates on database file n undo and redo are idempotent; this is important to recover from failure during the recovery process 14
  • 15. Checkpoints n log keeps growing with the age of the session n recovery gets very time-consuming n most of the efforts are really wasteful since the updates are already on the disk, but cannot be avoided since there is no way of knowing where to start 15
  • 16. Checkpoints n Stop accepting new transactions n Suspend execution of transactions temporarily n flush out all log records onto log file n flush out buffer blocks to database n flush out <checkpoint> log entry onto log file n redefine the last checkpoint as the start of the recovery process 16
  • 17. Shadow Paging Scheme fixed pointer current page map shadow page map 17
  • 18. Shadow Paging Scheme n To commit a transaction : 1. Flush all modified pages in main memory to disk 2. Output current page table to disk 3. Make the current page table the new shadow page table, as follows: n keep a pointer to the shadow page table at a fixed (known) location on disk. n to make the current page table the new shadow page table, simply update the pointer to point to current page table on disk 18
  • 19. n Once pointer to shadow page table has been written, transaction is committed. n No recovery is needed after a crash — new transactions can start right away, using the shadow page table. n Pages not pointed to from current/shadow page table should be freed (garbage collected). 19
  • 20. On-line Backups n set database to offline mode n flush out all log records onto log file n flush out <start backup> onto log file n maintain backup log version n flush out buffer blocks to database n copy database to backup file n set database to online mode and update database using backup log n flush out <end backup> onto log file 20
  • 21. Off-line Backup (Dumps) n Media Failure n Restore from earlier backup by DBA n Backup utilities available n BACKUP DATABASE n Complete vs Differential n Replication Server 21