SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Recovery System
Recovery System
 Failure Classification
 Storage Structure
 Recovery and Atomicity
 Log-Based Recovery
 Remote Backup Systems
Failure Classification
 Transaction failure :
Logical errors: transaction cannot complete due to
some internal error condition
System errors: the database system must terminate
an active transaction due to an error condition (e.g.,
deadlock)
 System crash: a power failure or other hardware or
software failure causes the system to crash.
Fail-stop assumption: non-volatile storage contents
are assumed to not be corrupted by system crash
Database systems have numerous integrity checks
to prevent corruption of disk data
 Disk failure: a head crash or similar disk failure destroys all or
part of disk storage
Destruction is assumed to be detectable: disk drives use
checksums to detect failures.
Recovery Algorithms
 Recovery algorithms are techniques to ensure database
consistency and transaction atomicity and durability despite
failures
 Focus of this chapter
 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
Recovery Algorithms
 Recovery algorithms are techniques to
ensure database consistency and
transaction atomicity and durability despite
failures
 Focus of this chapter
 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
Storage Structure
 Volatile storage:
 does not survive system crashes
 examples: main memory, cache memory
 Nonvolatile storage:
 survives system crashes
 examples: disk, tape, flash memory,
non-volatile (battery backed up) RAM
 Stable storage:
 a mythical form of storage that survives all failures
 approximated by maintaining multiple copies on
distinct nonvolatile media
Stable-Storage Implementation
 Maintain multiple copies of each block on separate disks
 copies can be at remote sites to protect against disasters such
as fire or flooding.
 Failure during data transfer can still result in inconsistent
copies: Block transfer can result in
 Successful completion
 Total failure: destination block was never updated
 Execute output operation as follows (assuming two copies of
each block):
 Write the information onto the first physical block.
 When the first write successfully completes, write the
same information onto the second physical block.
 The output is completed only after the second write
successfully completes.
Stable-Storage Implementation (Cont.)
 Protecting storage media from failure during data transfer
(cont.):
 Copies of a block may differ due to failure during output
operation. To recover from failure:
1. First find inconsistent blocks:
1. Expensive solution: Compare the two copies of every
disk block.
2. Better solution:
 Record in-progress disk writes on non-volatile storage
(Non-volatile RAM or special area of disk).
2. If either copy of an inconsistent block is detected to have an
error (bad checksum), overwrite it by the other copy. If both
have no error, but are different, overwrite the second block
by the first block.
Data Access
 Physical blocks are those blocks residing on the disk.
 Buffer blocks are the blocks residing temporarily in main
memory.
 Block movements between disk and main memory are initiated
through the following two operations:
 input(B) transfers the physical block B to main memory.
 output(B) transfers the buffer block B to the disk, and
replaces the appropriate physical block there.
 We assume, for simplicity, that each data item fits in, and is
stored inside, a single block.
Example of Data Access
x
Y A
B
x1
y1
buffer
Buffer Block A
Buffer Block B
input(A)
output(B)
read(X)
write(Y)
disk
work area
of T1
work area
of T2
memory
x2
Recovery and Atomicity
 Modifying the database without ensuring that the
transaction will commit may leave the database in an
inconsistent state.
 Consider transaction Ti that transfers $50 from account A
to account B; goal is either to perform all database
modifications made by Ti or none at all.
 Several output operations may be required for Ti (to output
A and B). A failure may occur after one of these
modifications have been made but before all of them are
made.
Log-Based Recovery
 A log is kept on stable storage.
 The log is a sequence of log records, and maintains a
record of update activities on the database.
 When Ti finishes it last statement, the log record <Ti
commit> is written.
 We assume for now that log records are written directly to
stable storage (that is, they are not buffered)
 Two approaches using logs
 Deferred database modification
 Immediate database modification
Checkpoints
 Problems in recovery procedure as discussed earlier :
1. searching the entire log is time-consuming
2. we might unnecessarily redo transactions which have already
3. output their updates to the database.
 Streamline recovery procedure by periodically performing check
pointing
1. Output all log records currently residing in main memory
onto stable storage.
2. Output all modified buffer blocks to the disk.
3. Write a log record < checkpoint> onto stable storage.
Example of Checkpoints
 T1 can be ignored (updates already output to disk due to
checkpoint)
 T2 and T3 redone.
 T4 undone
Tc
Tf
T1
T2
T3
T4
checkpoint system failure
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniquespusp220
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMSkoolkampus
 
Lesson12 recovery architectures
Lesson12 recovery architecturesLesson12 recovery architectures
Lesson12 recovery architecturesRaval Vijay
 
Data base recovery
Data base recoveryData base recovery
Data base recoveryVisakh V
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency ControlRavimuthurajan
 
Topic 4 database recovery
Topic 4 database recoveryTopic 4 database recovery
Topic 4 database recoveryacap paei
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Prosanta Ghosh
 
Process management
Process managementProcess management
Process managementMohd Arif
 
OS_UNIT_2 Study Materials (1).docx
OS_UNIT_2 Study Materials (1).docxOS_UNIT_2 Study Materials (1).docx
OS_UNIT_2 Study Materials (1).docxGayathriRHICETCSESTA
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and RecoveryMaham Huda
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 

Was ist angesagt? (20)

Database recovery techniques
Database recovery techniquesDatabase recovery techniques
Database recovery techniques
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Ch17
Ch17Ch17
Ch17
 
Chapter19
Chapter19Chapter19
Chapter19
 
Lesson12 recovery architectures
Lesson12 recovery architecturesLesson12 recovery architectures
Lesson12 recovery architectures
 
Dbms
DbmsDbms
Dbms
 
Dbms
DbmsDbms
Dbms
 
Data base recovery
Data base recoveryData base recovery
Data base recovery
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
 
Topic 4 database recovery
Topic 4 database recoveryTopic 4 database recovery
Topic 4 database recovery
 
4 process
4 process4 process
4 process
 
Unit 07 dbms
Unit 07 dbmsUnit 07 dbms
Unit 07 dbms
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 
Aries
AriesAries
Aries
 
10 replication
10 replication10 replication
10 replication
 
Process management
Process managementProcess management
Process management
 
OS_UNIT_2 Study Materials (1).docx
OS_UNIT_2 Study Materials (1).docxOS_UNIT_2 Study Materials (1).docx
OS_UNIT_2 Study Materials (1).docx
 
Backing Up and Recovery
Backing Up and RecoveryBacking Up and Recovery
Backing Up and Recovery
 
Chapter 22 - Windows XP
Chapter 22 - Windows XPChapter 22 - Windows XP
Chapter 22 - Windows XP
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 

Ähnlich wie Recovery system

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
 
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
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recoveryArun Sharma
 
ELNA6eCh21 (1).ppt
ELNA6eCh21 (1).pptELNA6eCh21 (1).ppt
ELNA6eCh21 (1).pptNEILMANOJC1
 
ELNA6eCh21.ppt
ELNA6eCh21.pptELNA6eCh21.ppt
ELNA6eCh21.pptrenwakurd1
 
dbms ppt data base Management System 12
dbms ppt  data base Management System 12dbms ppt  data base Management System 12
dbms ppt data base Management System 12Kumari Naveen
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptAdemeCheklie
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfKavitaShinde26
 
Transaction Management system.ppt
Transaction Management system.pptTransaction Management system.ppt
Transaction Management system.pptKaranKhurana54
 
Recovery System.pptx
Recovery System.pptxRecovery System.pptx
Recovery System.pptxssuserfb9a21
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 

Ähnlich wie Recovery system (20)

17 Recovery system.ppt
17 Recovery system.ppt17 Recovery system.ppt
17 Recovery system.ppt
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
 
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
 
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...
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 
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
 
ELNA6eCh21.ppt
ELNA6eCh21.pptELNA6eCh21.ppt
ELNA6eCh21.ppt
 
dbms ppt data base Management System 12
dbms ppt  data base Management System 12dbms ppt  data base Management System 12
dbms ppt data base Management System 12
 
ch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.pptch 5 Daatabase Recovery.ppt
ch 5 Daatabase Recovery.ppt
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdf
 
Transaction Management system.ppt
Transaction Management system.pptTransaction Management system.ppt
Transaction Management system.ppt
 
Recovery techniques
Recovery techniquesRecovery techniques
Recovery techniques
 
File system implementation
File system implementationFile system implementation
File system implementation
 
Recovery System.pptx
Recovery System.pptxRecovery System.pptx
Recovery System.pptx
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
ch17
ch17ch17
ch17
 
Operating System
Operating SystemOperating System
Operating System
 

Mehr von GowriLatha1

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domainGowriLatha1
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessGowriLatha1
 
Software engineering
Software engineeringSoftware engineering
Software engineeringGowriLatha1
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ componentsGowriLatha1
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databasesGowriLatha1
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databasesGowriLatha1
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationGowriLatha1
 
computer network
computer networkcomputer network
computer networkGowriLatha1
 
Operating System
Operating SystemOperating System
Operating SystemGowriLatha1
 
Data mining query language
Data mining query languageData mining query language
Data mining query languageGowriLatha1
 
Path &amp; application(ds)2
Path &amp; application(ds)2Path &amp; application(ds)2
Path &amp; application(ds)2GowriLatha1
 

Mehr von GowriLatha1 (20)

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Hive
HiveHive
Hive
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ components
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Static analysis
Static analysisStatic analysis
Static analysis
 
Hema dm
Hema dmHema dm
Hema dm
 
Data reduction
Data reductionData reduction
Data reduction
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
computer network
computer networkcomputer network
computer network
 
Operating System
Operating SystemOperating System
Operating System
 
Data mining query language
Data mining query languageData mining query language
Data mining query language
 
Enterprice java
Enterprice javaEnterprice java
Enterprice java
 
Ethernet
EthernetEthernet
Ethernet
 
Java script
Java scriptJava script
Java script
 
Path &amp; application(ds)2
Path &amp; application(ds)2Path &amp; application(ds)2
Path &amp; application(ds)2
 

Kürzlich hochgeladen

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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 ModeThiyagu K
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
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 GraphThiyagu K
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
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.pdfJayanti Pande
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
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 . pdfQucHHunhnh
 
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.pdfQucHHunhnh
 

Kürzlich hochgeladen (20)

Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).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
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
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
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
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
 
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
 

Recovery system

  • 2. Recovery System  Failure Classification  Storage Structure  Recovery and Atomicity  Log-Based Recovery  Remote Backup Systems
  • 3. Failure Classification  Transaction failure : Logical errors: transaction cannot complete due to some internal error condition System errors: the database system must terminate an active transaction due to an error condition (e.g., deadlock)  System crash: a power failure or other hardware or software failure causes the system to crash. Fail-stop assumption: non-volatile storage contents are assumed to not be corrupted by system crash Database systems have numerous integrity checks to prevent corruption of disk data
  • 4.  Disk failure: a head crash or similar disk failure destroys all or part of disk storage Destruction is assumed to be detectable: disk drives use checksums to detect failures. Recovery Algorithms  Recovery algorithms are techniques to ensure database consistency and transaction atomicity and durability despite failures  Focus of this chapter  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
  • 5. Recovery Algorithms  Recovery algorithms are techniques to ensure database consistency and transaction atomicity and durability despite failures  Focus of this chapter  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
  • 6. Storage Structure  Volatile storage:  does not survive system crashes  examples: main memory, cache memory  Nonvolatile storage:  survives system crashes  examples: disk, tape, flash memory, non-volatile (battery backed up) RAM  Stable storage:  a mythical form of storage that survives all failures  approximated by maintaining multiple copies on distinct nonvolatile media
  • 7. Stable-Storage Implementation  Maintain multiple copies of each block on separate disks  copies can be at remote sites to protect against disasters such as fire or flooding.  Failure during data transfer can still result in inconsistent copies: Block transfer can result in  Successful completion  Total failure: destination block was never updated  Execute output operation as follows (assuming two copies of each block):  Write the information onto the first physical block.  When the first write successfully completes, write the same information onto the second physical block.  The output is completed only after the second write successfully completes.
  • 8. Stable-Storage Implementation (Cont.)  Protecting storage media from failure during data transfer (cont.):  Copies of a block may differ due to failure during output operation. To recover from failure: 1. First find inconsistent blocks: 1. Expensive solution: Compare the two copies of every disk block. 2. Better solution:  Record in-progress disk writes on non-volatile storage (Non-volatile RAM or special area of disk). 2. If either copy of an inconsistent block is detected to have an error (bad checksum), overwrite it by the other copy. If both have no error, but are different, overwrite the second block by the first block.
  • 9. Data Access  Physical blocks are those blocks residing on the disk.  Buffer blocks are the blocks residing temporarily in main memory.  Block movements between disk and main memory are initiated through the following two operations:  input(B) transfers the physical block B to main memory.  output(B) transfers the buffer block B to the disk, and replaces the appropriate physical block there.  We assume, for simplicity, that each data item fits in, and is stored inside, a single block.
  • 10. Example of Data Access x Y A B x1 y1 buffer Buffer Block A Buffer Block B input(A) output(B) read(X) write(Y) disk work area of T1 work area of T2 memory x2
  • 11. Recovery and Atomicity  Modifying the database without ensuring that the transaction will commit may leave the database in an inconsistent state.  Consider transaction Ti that transfers $50 from account A to account B; goal is either to perform all database modifications made by Ti or none at all.  Several output operations may be required for Ti (to output A and B). A failure may occur after one of these modifications have been made but before all of them are made.
  • 12. Log-Based Recovery  A log is kept on stable storage.  The log is a sequence of log records, and maintains a record of update activities on the database.  When Ti finishes it last statement, the log record <Ti commit> is written.  We assume for now that log records are written directly to stable storage (that is, they are not buffered)  Two approaches using logs  Deferred database modification  Immediate database modification
  • 13. Checkpoints  Problems in recovery procedure as discussed earlier : 1. searching the entire log is time-consuming 2. we might unnecessarily redo transactions which have already 3. output their updates to the database.  Streamline recovery procedure by periodically performing check pointing 1. Output all log records currently residing in main memory onto stable storage. 2. Output all modified buffer blocks to the disk. 3. Write a log record < checkpoint> onto stable storage.
  • 14. Example of Checkpoints  T1 can be ignored (updates already output to disk due to checkpoint)  T2 and T3 redone.  T4 undone Tc Tf T1 T2 T3 T4 checkpoint system failure