SlideShare a Scribd company logo
1 of 18
Download to read offline
DATABASE RECOVERY
TECHNIQUES
Group – 06   Computer Science and Technology
Introduction

    Database recovery is the process of restoring the
    database to the most recent consistent state that
    existed just before the failure.

   Three states of database recovery:
     Pre-condition: At any given point in time the database is in
       a consistent state.
     Condition: Occurs some kind of system failure.
     Post-condition: Restore the database to the consistent state
       that existed before the failure
Types of failures
  1.   Transaction failures.
          Erroneous parameter values
          Logical programming errors
          System errors like integer overflow, division by zero
          Local errors like “data not found”
          User interruption.
          Concurrency control enforcement
  2.   Malicious transactions.
  3.   System crash.
          A hardware, software, or network error (also called
           media failure)
  4.   Disk crash.
Before step into recovery.


Commit point:
Every transaction has a commit point.
This is the point at which it is finished, and all of the
database modifications are made a permanent part
of the database.
Recovery approaches

   Steal approach-cache page updated by a transaction can be
    written to disk before the transaction commits.
   No-steal approach -cache page updated by a transaction cannot
    be written to disk before the transaction commits.
   Force approach- when a transaction commits, all pages updated
    by the transaction are immediately written to disk.
   No-force approach-when a transaction commits, all pages updated
    by the transaction are not immediately written to disk.
Basic Update Strategies

   Update strategies may be placed into two basic categories.
   Most practical strategies are a combination of these two:




         Deferred Update               Immediate Update
Cont.
1.   Deferred Update (No -Undo/Redo Algorithm)

        These techniques do not physically update the DB on disk
         until a transaction reaches its commit point.

        These techniques need only to redo the committed
         transaction and no-undo is needed in case of failure.
Cont.

While a transaction runs:
  Changes made by that transaction are not recorded in the
   database.
On a commit:
  The new data is recorded in a log file and flushed to disk
  The new data is then recorded in the database itself.
  On an abort, do nothing (the database has not been
   changed).
  On a system restart after a failure, REDO the log.
Cont.
2.   Immediate Update (Undo/Redo Algorithm)

        The DB may be updated by some operations of a
         transaction before the transaction reaches it’s commit
         point.

        The updates are recorded in the log must contain the old
         values and new values.

        These techniques need to undo the operations of the
         uncommitted transactions and redo the operations of the
         committed transactions .
Cont.
While a transaction runs:
 Changes made by the transaction can be written to the database
  at any time. Both original and the new data being written, must be
  stored in the log before storing it on the disk.
On a commit:
 All the updates which has not yet been recorded on the disk is first
  stored in the log file and then flushed to disk.
 The new data is then recorded in the database itself.

 On an abort, redo all the changes which that transaction has made
  to the database disk using the log entries.
 On a system restart after a failure, redo committed changes from
  log.
Shadow Paging
   In this technique, the database is considered to be made up of
    fixed-size disk blocks or pages for recovery purposes.
   Maintains two tables during the lifetime of a transaction-current
    page table and shadow page table.
   Store the shadow page table in nonvolatile storage, to recover the
    state of the database prior to transaction execution
   This is a technique for providing atomicity and durability.
When a transaction begins executing
Cont.
To recover from a failure




Advantages
    •No-redo/no-undo

Disadvantages
    •Creating shadow directory may take a long time.
    •Updated database pages change locations.
    •Garbage collection is needed
“ARIES” Recovery algorithm.
Recovery algorithms are techniques to ensure database
consistency ,transaction atomicity and durability without any
 failure.

   Recovery algorithms have two parts
    1. Actions taken during normal transaction processing to
       ensure enough information exists to recover from failures.
    2. Actions taken after a failure to recover the database
       contents to a state that ensures atomicity, consistency and
       durability.
Cont.

   ARIES (Algorithms for Recovery and Isolation
    Exploiting Semantics)

   The ARIES recovery algorithm consist of three steps
•   Analysis
•   Redo
•   Undo
Cont.

   Analysis - Identify the dirty pages(updated pages) in the
    buffer and set of active transactions at the time of failure.

   Redo - Re-apply updates from the log to the database. It will be
    done for the committed transactions.

   Undo - Scan the log backward and undo the actions of the
    active transactions in the reverse order.
Recovery from disk crashes.
 Recovery from disk crashes is much more difficult than recovery
  from transaction failures or machines crashes.
 Loss from such crashes is much less common today than it was
  previously, because of the wide use of redundancy in secondary
  storage (RAID technology).
   (RAID - method of combining several hard disk drives into one
  logical unit.)
Typical methods are;
 The log for the database system is usually written on a separate
  physical disk from the database.
    or,
 Periodically, the database is also backed up to tape or other
  archival storage.
Conclusion.
   Types of failures.
   Steal/no steal, Force/no force approaches.
   Deferred and immediate update strategies.
   Shadow paging technique.
   ARIES recovery algorithm.
   Recovery from disk crashes.
Thank you !

More Related Content

What's hot

Database backup & recovery
Database backup & recoveryDatabase backup & recovery
Database backup & recoveryMustafa Khan
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recoveryAnne Lee
 
Database recovery
Database recoveryDatabase recovery
Database recoveryStudent
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniquespusp220
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Meghaj Mallick
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management systemPooja Dixit
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Database abstraction
Database abstractionDatabase abstraction
Database abstractionRituBhargava7
 
Replication Techniques for Distributed Database Design
Replication Techniques for Distributed Database DesignReplication Techniques for Distributed Database Design
Replication Techniques for Distributed Database DesignMeghaj Mallick
 

What's hot (20)

Recovery techniques
Recovery techniquesRecovery techniques
Recovery techniques
 
Advanced DBMS presentation
Advanced DBMS presentationAdvanced DBMS presentation
Advanced DBMS presentation
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Database backup & recovery
Database backup & recoveryDatabase backup & recovery
Database backup & recovery
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Database recovery
Database recoveryDatabase recovery
Database recovery
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Database abstraction
Database abstractionDatabase abstraction
Database abstraction
 
Replication Techniques for Distributed Database Design
Replication Techniques for Distributed Database DesignReplication Techniques for Distributed Database Design
Replication Techniques for Distributed Database Design
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
Chapter18
Chapter18Chapter18
Chapter18
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 

Viewers also liked

Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering julia121214
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Prosanta Ghosh
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 

Viewers also liked (6)

Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering
 
ARIES Recovery Algorithms
ARIES Recovery AlgorithmsARIES Recovery Algorithms
ARIES Recovery Algorithms
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 
Unit06 dbms
Unit06 dbmsUnit06 dbms
Unit06 dbms
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 

Similar to database recovery techniques

What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...Raj vardhan
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfKavitaShinde26
 
Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319ARVIND SARDAR
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptAdemeCheklie
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBaivabiNayak
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryZainab Almugbel
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
TransactionsmanagementSanjeev Gupta
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and RecoveryMaham Huda
 
Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4avniS
 
Recovery System.pptx
Recovery System.pptxRecovery System.pptx
Recovery System.pptxssuserfb9a21
 
ELNA6eCh21 (1).ppt
ELNA6eCh21 (1).pptELNA6eCh21 (1).ppt
ELNA6eCh21 (1).pptNEILMANOJC1
 

Similar to database recovery techniques (20)

What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...What is Database Backup? The 3 Important Recovery Techniques from transaction...
What is Database Backup? The 3 Important Recovery Techniques from transaction...
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdf
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
 
Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319Unit no 5 transation processing DMS 22319
Unit no 5 transation processing DMS 22319
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
 
2 recovery
2 recovery2 recovery
2 recovery
 
BACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMSBACKUP & RECOVERY IN DBMS
BACKUP & RECOVERY IN DBMS
 
Introduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theoryIntroduction to transaction processing concepts and theory
Introduction to transaction processing concepts and theory
 
Transactionsmanagement
TransactionsmanagementTransactionsmanagement
Transactionsmanagement
 
Dbms
DbmsDbms
Dbms
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and Recovery
 
Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4
 
Recovery System.pptx
Recovery System.pptxRecovery System.pptx
Recovery System.pptx
 
Ch24 system administration
Ch24 system administration Ch24 system administration
Ch24 system administration
 
Ch24
Ch24Ch24
Ch24
 
Crash recovery in database
Crash recovery in databaseCrash recovery in database
Crash recovery in database
 
ELNA6eCh21 (1).ppt
ELNA6eCh21 (1).pptELNA6eCh21 (1).ppt
ELNA6eCh21 (1).ppt
 
ELNA6eCh21.ppt
ELNA6eCh21.pptELNA6eCh21.ppt
ELNA6eCh21.ppt
 
ELNA6eCh21.ppt
ELNA6eCh21.pptELNA6eCh21.ppt
ELNA6eCh21.ppt
 

More from Kalhan Liyanage

Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testingKalhan Liyanage
 
Cucumber for automated acceptance testing.pptx
Cucumber for automated acceptance testing.pptxCucumber for automated acceptance testing.pptx
Cucumber for automated acceptance testing.pptxKalhan Liyanage
 
How to do a Formal presentaion - features and how to design a formal presentaion
How to do a Formal presentaion - features and how to design a formal presentaionHow to do a Formal presentaion - features and how to design a formal presentaion
How to do a Formal presentaion - features and how to design a formal presentaionKalhan Liyanage
 
The iron lady margaret thatcher
The iron lady margaret thatcherThe iron lady margaret thatcher
The iron lady margaret thatcherKalhan Liyanage
 

More from Kalhan Liyanage (7)

Progressive web app testing
Progressive web app testingProgressive web app testing
Progressive web app testing
 
Cucumber for automated acceptance testing.pptx
Cucumber for automated acceptance testing.pptxCucumber for automated acceptance testing.pptx
Cucumber for automated acceptance testing.pptx
 
Stay Young At Heart
Stay Young At HeartStay Young At Heart
Stay Young At Heart
 
Microsoft corporation
Microsoft corporationMicrosoft corporation
Microsoft corporation
 
How to do a Formal presentaion - features and how to design a formal presentaion
How to do a Formal presentaion - features and how to design a formal presentaionHow to do a Formal presentaion - features and how to design a formal presentaion
How to do a Formal presentaion - features and how to design a formal presentaion
 
The iron lady margaret thatcher
The iron lady margaret thatcherThe iron lady margaret thatcher
The iron lady margaret thatcher
 
Nanotechnology
NanotechnologyNanotechnology
Nanotechnology
 

Recently uploaded

CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice documentXsasf Sfdfasd
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational PhilosophyShuvankar Madhu
 
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxEduSkills OECD
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxKatherine Villaluna
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 

Recently uploaded (20)

CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice document
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
Philosophy of Education and Educational Philosophy
Philosophy of Education  and Educational PhilosophyPhilosophy of Education  and Educational Philosophy
Philosophy of Education and Educational Philosophy
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 

database recovery techniques

  • 1. DATABASE RECOVERY TECHNIQUES Group – 06 Computer Science and Technology
  • 2. Introduction Database recovery is the process of restoring the database to the most recent consistent state that existed just before the failure.  Three states of database recovery:  Pre-condition: At any given point in time the database is in a consistent state.  Condition: Occurs some kind of system failure.  Post-condition: Restore the database to the consistent state that existed before the failure
  • 3. Types of failures 1. Transaction failures.  Erroneous parameter values  Logical programming errors  System errors like integer overflow, division by zero  Local errors like “data not found”  User interruption.  Concurrency control enforcement 2. Malicious transactions. 3. System crash.  A hardware, software, or network error (also called media failure) 4. Disk crash.
  • 4. Before step into recovery. Commit point: Every transaction has a commit point. This is the point at which it is finished, and all of the database modifications are made a permanent part of the database.
  • 5. Recovery approaches  Steal approach-cache page updated by a transaction can be written to disk before the transaction commits.  No-steal approach -cache page updated by a transaction cannot be written to disk before the transaction commits.  Force approach- when a transaction commits, all pages updated by the transaction are immediately written to disk.  No-force approach-when a transaction commits, all pages updated by the transaction are not immediately written to disk.
  • 6. Basic Update Strategies  Update strategies may be placed into two basic categories.  Most practical strategies are a combination of these two: Deferred Update Immediate Update
  • 7. Cont. 1. Deferred Update (No -Undo/Redo Algorithm)  These techniques do not physically update the DB on disk until a transaction reaches its commit point.  These techniques need only to redo the committed transaction and no-undo is needed in case of failure.
  • 8. Cont. While a transaction runs:  Changes made by that transaction are not recorded in the database. On a commit:  The new data is recorded in a log file and flushed to disk  The new data is then recorded in the database itself.  On an abort, do nothing (the database has not been changed).  On a system restart after a failure, REDO the log.
  • 9. Cont. 2. Immediate Update (Undo/Redo Algorithm)  The DB may be updated by some operations of a transaction before the transaction reaches it’s commit point.  The updates are recorded in the log must contain the old values and new values.  These techniques need to undo the operations of the uncommitted transactions and redo the operations of the committed transactions .
  • 10. Cont. While a transaction runs:  Changes made by the transaction can be written to the database at any time. Both original and the new data being written, must be stored in the log before storing it on the disk. On a commit:  All the updates which has not yet been recorded on the disk is first stored in the log file and then flushed to disk.  The new data is then recorded in the database itself.  On an abort, redo all the changes which that transaction has made to the database disk using the log entries.  On a system restart after a failure, redo committed changes from log.
  • 11. Shadow Paging  In this technique, the database is considered to be made up of fixed-size disk blocks or pages for recovery purposes.  Maintains two tables during the lifetime of a transaction-current page table and shadow page table.  Store the shadow page table in nonvolatile storage, to recover the state of the database prior to transaction execution  This is a technique for providing atomicity and durability. When a transaction begins executing
  • 12. Cont. To recover from a failure Advantages •No-redo/no-undo Disadvantages •Creating shadow directory may take a long time. •Updated database pages change locations. •Garbage collection is needed
  • 13. “ARIES” Recovery algorithm. Recovery algorithms are techniques to ensure database consistency ,transaction atomicity and durability without any failure.  Recovery algorithms have two parts 1. Actions taken during normal transaction processing to ensure enough information exists to recover from failures. 2. Actions taken after a failure to recover the database contents to a state that ensures atomicity, consistency and durability.
  • 14. Cont.  ARIES (Algorithms for Recovery and Isolation Exploiting Semantics)  The ARIES recovery algorithm consist of three steps • Analysis • Redo • Undo
  • 15. Cont.  Analysis - Identify the dirty pages(updated pages) in the buffer and set of active transactions at the time of failure.  Redo - Re-apply updates from the log to the database. It will be done for the committed transactions.  Undo - Scan the log backward and undo the actions of the active transactions in the reverse order.
  • 16. Recovery from disk crashes.  Recovery from disk crashes is much more difficult than recovery from transaction failures or machines crashes.  Loss from such crashes is much less common today than it was previously, because of the wide use of redundancy in secondary storage (RAID technology). (RAID - method of combining several hard disk drives into one logical unit.) Typical methods are;  The log for the database system is usually written on a separate physical disk from the database. or,  Periodically, the database is also backed up to tape or other archival storage.
  • 17. Conclusion.  Types of failures.  Steal/no steal, Force/no force approaches.  Deferred and immediate update strategies.  Shadow paging technique.  ARIES recovery algorithm.  Recovery from disk crashes.