SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

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
 

What's hot (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
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
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
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
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
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

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