SlideShare uma empresa Scribd logo
1 de 18
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 !

Mais conteúdo relacionado

Mais procurados

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniquespusp220
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management systemPooja Dixit
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMSkoolkampus
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency controlJaved Khan
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database conceptsTemesgenthanks
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency controlBinte fatima
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMSkoolkampus
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptxRajapriya82
 

Mais procurados (20)

Active database
Active databaseActive database
Active database
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Chapter19
Chapter19Chapter19
Chapter19
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency control
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
 
File allocation methods (1)
File allocation methods (1)File allocation methods (1)
File allocation methods (1)
 
Temporal databases
Temporal databasesTemporal databases
Temporal databases
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
 
20. Parallel Databases in DBMS
20. Parallel Databases in DBMS20. Parallel Databases in DBMS
20. Parallel Databases in DBMS
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Acid properties
Acid propertiesAcid properties
Acid properties
 

Semelhante a 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
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Prosanta Ghosh
 
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
 

Semelhante a 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
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 
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
 
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
 

Mais de 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
 

Mais de 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
 

Último

EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 

Último (20)

EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 

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.