SlideShare una empresa de 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 !

Más contenido relacionado

La actualidad más candente

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
koolkampus
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
koolkampus
 
9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS
koolkampus
 

La actualidad más candente (20)

17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
File organization 1
File organization 1File organization 1
File organization 1
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Transaction
TransactionTransaction
Transaction
 
Data independence
Data independenceData independence
Data independence
 
Rdbms
RdbmsRdbms
Rdbms
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Acid properties
Acid propertiesAcid properties
Acid properties
 
2 phase locking protocol DBMS
2 phase locking protocol DBMS2 phase locking protocol DBMS
2 phase locking protocol DBMS
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Query processing
Query processingQuery processing
Query processing
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Data Models
Data ModelsData Models
Data Models
 
13. Query Processing in DBMS
13. Query Processing in DBMS13. Query Processing in DBMS
13. Query Processing in DBMS
 
9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS
 
Transactions in dbms
Transactions in dbmsTransactions in dbms
Transactions in dbms
 

Similar a database recovery techniques

Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4
avniS
 

Similar 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
 
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
 
E-Business Information System BBA AVI.pptx
E-Business Information System BBA AVI.pptxE-Business Information System BBA AVI.pptx
E-Business Information System BBA AVI.pptx
 
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
 
Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
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
 

Más 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

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Último (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.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.