SlideShare une entreprise Scribd logo
1  sur  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 !

Contenu connexe

Tendances

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management SystemJanki Shah
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of RecoveryPooja Dixit
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency controlDhani Ahmad
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniquespusp220
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbmsNancy Gulati
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)Ravinder Kamboj
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesMeghaj Mallick
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating SystemJanki Shah
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process ConceptsMukesh Chinta
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 

Tendances (20)

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 System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
 
Memory management
Memory managementMemory management
Memory management
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency control
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 
Distributed database
Distributed databaseDistributed database
Distributed database
 
Memory management
Memory managementMemory management
Memory management
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Query processing
Query processingQuery processing
Query processing
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Overview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed DatabasesOverview of Concurrency Control & Recovery in Distributed Databases
Overview of Concurrency Control & Recovery in Distributed Databases
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
serializability in dbms
serializability in dbmsserializability in dbms
serializability in dbms
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 

Similaire à 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
 

Similaire à 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
 
Chapter19
Chapter19Chapter19
Chapter19
 
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
 
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
 

Plus 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
 

Plus 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
 

Dernier

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Dernier (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

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.