SlideShare a Scribd company logo
1 of 17
RELATIONAL DATABASE MANAGEMENT SYSTEM
TRANSACTION MANAGEMENT
By,
S.Subhalakshmi,
M.Sc(cs).
Nadar saraswathi college of arts and science.
TRANSACTION MANAGEMENT:
 A Transaction is a very small unit of a program and it
may contain several low level tasks.
 A Transaction in a database system must maintain
Atomicity, Consistency, Isolation, and Durability − commonly
known as ACID properties.
 In order to ensure accuracy, completeness, and data
integrity.
FAILURE CLASSIFICATION:
 The simplest type of failure is one that does not result
in the loss of information in the system.
 There are various types of failure that may occur in a
system.
 The failures that are more difficult to deal with are
those that result in loss of information.
 The following types of failures are:
TRANSACTION FAILURE:
 There are two types of errors that may cause a transaction to
fail:
 LOGICAL ERROR :transaction cannot complete due to
some internal error condition.
 SYSTEM ERROR: 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-STOPASSUMPTION: non-volatile storage contents
are assumed to not be corrupted by system crash.
 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 WITH CONCURRENT
TRANSACTIONS :
 We modify the log-based recovery schemes to allow
multiple transactions to execute concurrently.
 All transactions share a single disk buffer and a single
log.
 A buffer block can have data items updated by one or
more transactions.
CHECKPOINTS:
 We modify the log-based recovery schemes to allow multiple
transactions to execute concurrently.
 All transactions share a single disk buffer and a single log
 A buffer block can have data items updated by one or more
transactions.
 Streamline recovery procedure by periodically performing
check pointing.
RESTART RECOVERY:
 When the system recovers from a crash, it constructs two list:
 The undo-list consists of transaction to be done.
 The system constructs the two lists as follows:
 Initially, they are both empty.
 The system scans the log backward, examining each record, until
it finds the first <checkpoint> record:
 For each record found of the form<Ti commit>,it adds Ti to redo-
list.
 For each record found of the form<Ti start>,if Ti is not in redo-
list, then it adds Ti to undo-list.
 When the system has examined all the appropriate log records, it
checks the list L in the checkpoint record.
 For each transaction Ti in L, if Ti is not in redo-list, then it adds
Ti to undo-list.
SHADOW PAGING:
 Shadow paging is an alternative to log-based recovery.
 IDEA: maintain two page tables during the lifetime of a
transaction .
 Store the shadow page table in nonvolatile storage, such that state
of the database prior to transaction execution may be recovered.
 Only current page table is used for data item accesses during
execution of the transaction.
 TO COMMIT A TRANSACTION :
1. Flush all modified pages in main memory to disk
2. Output current page table to disk
3. Make the current page table the new shadow page table, as
follows:
 keep a pointer to the shadow page table at a fixed (known)
location on disk.
 to make the current page table the new shadow page table,
simply update the pointer to point to current page table on disk.
 BUFFER MANAGEMENT:
 LOG RECORD BUFFERING: log records are buffered in
main memory, instead of being output directly to stable storage.
 Log force is performed to commit a transaction by forcing all its
log records (including the commit record) to stable storage.
 Several log records can thus be output using a single output
operation, reducing the I/O cost.
 DATABASE BUFFERING :
 Database maintains an in-memory buffer of data blocks.
 When a new block is needed, if buffer is full an existing block
needs to be removed from buffer.
 If the block chosen for removal has been updated, it must be
output to disk.
 If a block with uncommitted updates is output to disk, log
records with undo information for the updates are output to the
log on stable storage first.
 OPERATING SYSTEM ROLE IN BUFFER
MANAGEMENT:
 We can manage the database buffer by using one of this
approaches:
 The database system reserves part of main memory to serve as a
buffer that it, rather than the operating system, manages.
 The database system implements its buffer within the virtual
memory provided by the operating system.
 The database system in turn force-output the buffer blocks to the
database, after writing relevant log records to stable storage.
 Unfortunately, almost all current-generation operating systems
retain complete control of virtual memory.
 The operating system reserves space on disk for storing virtual-
memory pages that are not currently in main memory ; this space
is called swap space.
 Although both approaches suffer from some drawbacks, one or
the other must be chosen unless the operating system is designed
to support the requirements of database logging.
Database management

More Related Content

What's hot

Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recoveryAnne Lee
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Prosanta Ghosh
 
Database backup and recovery basics
Database backup and recovery basicsDatabase backup and recovery basics
Database backup and recovery basicsShahed Mohamed
 
Topic 4 database recovery
Topic 4 database recoveryTopic 4 database recovery
Topic 4 database recoveryacap paei
 
Sql server logshipping
Sql server logshippingSql server logshipping
Sql server logshippingZeba Ansari
 
Processes description and process control.
Processes description and process control.Processes description and process control.
Processes description and process control.Ahsan Rahim
 
Introduction to data_load
Introduction to data_loadIntroduction to data_load
Introduction to data_loadsramkumar88
 
SAP BASIS Training in Chennai Demo Part-6
SAP BASIS Training in Chennai Demo Part-6SAP BASIS Training in Chennai Demo Part-6
SAP BASIS Training in Chennai Demo Part-6Thecreating Experts
 
Dfd over flowcharts
Dfd over flowcharts Dfd over flowcharts
Dfd over flowcharts Ashwathy Nair
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process managementBabasab Patil
 
Unix Process management
Unix Process managementUnix Process management
Unix Process managementWave Digitech
 

What's hot (16)

Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013Dbms ii mca-ch11-recovery-2013
Dbms ii mca-ch11-recovery-2013
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Database backup and recovery basics
Database backup and recovery basicsDatabase backup and recovery basics
Database backup and recovery basics
 
Topic 4 database recovery
Topic 4 database recoveryTopic 4 database recovery
Topic 4 database recovery
 
Os
OsOs
Os
 
Sql server logshipping
Sql server logshippingSql server logshipping
Sql server logshipping
 
Chapter7
Chapter7Chapter7
Chapter7
 
Processes description and process control.
Processes description and process control.Processes description and process control.
Processes description and process control.
 
Introduction to data_load
Introduction to data_loadIntroduction to data_load
Introduction to data_load
 
SAP BASIS Training in Chennai Demo Part-6
SAP BASIS Training in Chennai Demo Part-6SAP BASIS Training in Chennai Demo Part-6
SAP BASIS Training in Chennai Demo Part-6
 
Dfd over flowcharts
Dfd over flowcharts Dfd over flowcharts
Dfd over flowcharts
 
Recovery system
Recovery systemRecovery system
Recovery system
 
My ppt @ bec doms on process management
My ppt @ bec doms on process managementMy ppt @ bec doms on process management
My ppt @ bec doms on process management
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Unix Process management
Unix Process managementUnix Process management
Unix Process management
 

Similar to Database management

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
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfKavitaShinde26
 
recovery system
recovery systemrecovery system
recovery systemshreeuva
 
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
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10Ala Qunaibi
 
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
 
SAP ADMINISTRATION
SAP ADMINISTRATIONSAP ADMINISTRATION
SAP ADMINISTRATIONAly Adel
 
Databases: Backup and Recovery
Databases: Backup and RecoveryDatabases: Backup and Recovery
Databases: Backup and RecoveryDamian T. Gordon
 
Introduction to Data Management
Introduction to Data ManagementIntroduction to Data Management
Introduction to Data ManagementCloudbells.com
 

Similar to Database management (20)

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
 
UNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdfUNIT 4- CRASH AND RECOVERY.pdf
UNIT 4- CRASH AND RECOVERY.pdf
 
DBMS Vardhaman.pdf
DBMS Vardhaman.pdfDBMS Vardhaman.pdf
DBMS Vardhaman.pdf
 
recovery system
recovery systemrecovery system
recovery system
 
Dbms
DbmsDbms
Dbms
 
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
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10
 
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...
 
Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 
Dbms
DbmsDbms
Dbms
 
Recovery techniques
Recovery techniquesRecovery techniques
Recovery techniques
 
Dbms
DbmsDbms
Dbms
 
SAP ADMINISTRATION
SAP ADMINISTRATIONSAP ADMINISTRATION
SAP ADMINISTRATION
 
ch-5 advanced db.pdf
ch-5 advanced db.pdfch-5 advanced db.pdf
ch-5 advanced db.pdf
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
Database
DatabaseDatabase
Database
 
Databases: Backup and Recovery
Databases: Backup and RecoveryDatabases: Backup and Recovery
Databases: Backup and Recovery
 
Introduction to Data Management
Introduction to Data ManagementIntroduction to Data Management
Introduction to Data Management
 

More from Subha Selvam

More from Subha Selvam (14)

Digital image processing
Digital image processingDigital image processing
Digital image processing
 
Mobile computing
Mobile computingMobile computing
Mobile computing
 
Complier Design
Complier DesignComplier Design
Complier Design
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Web programming
Web programmingWeb programming
Web programming
 
Big data
Big dataBig data
Big data
 
Data mining
Data miningData mining
Data mining
 
Operating system
Operating systemOperating system
Operating system
 
Database management
Database managementDatabase management
Database management
 
Computer network
Computer networkComputer network
Computer network
 
Mathematical foundation in cs
Mathematical foundation in csMathematical foundation in cs
Mathematical foundation in cs
 
Java
JavaJava
Java
 
Sc
ScSc
Sc
 
Ds
DsDs
Ds
 

Recently uploaded

Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatmentnswingard
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCamilleBoulbin1
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Pooja Nehwal
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedDelhi Call girls
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoKayode Fayemi
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfSkillCertProExams
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIINhPhngng3
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Baileyhlharris
 

Recently uploaded (20)

Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 

Database management

  • 1. RELATIONAL DATABASE MANAGEMENT SYSTEM TRANSACTION MANAGEMENT By, S.Subhalakshmi, M.Sc(cs). Nadar saraswathi college of arts and science.
  • 2. TRANSACTION MANAGEMENT:  A Transaction is a very small unit of a program and it may contain several low level tasks.  A Transaction in a database system must maintain Atomicity, Consistency, Isolation, and Durability − commonly known as ACID properties.  In order to ensure accuracy, completeness, and data integrity.
  • 3. FAILURE CLASSIFICATION:  The simplest type of failure is one that does not result in the loss of information in the system.  There are various types of failure that may occur in a system.  The failures that are more difficult to deal with are those that result in loss of information.  The following types of failures are:
  • 4. TRANSACTION FAILURE:  There are two types of errors that may cause a transaction to fail:  LOGICAL ERROR :transaction cannot complete due to some internal error condition.  SYSTEM ERROR: the database system must terminate an active transaction due to an error condition (e.g., deadlock).
  • 5.  SYSTEM CRASH: a power failure or other hardware or software failure causes the system to crash.  FAIL-STOPASSUMPTION: non-volatile storage contents are assumed to not be corrupted by system crash.  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.
  • 6. RECOVERY WITH CONCURRENT TRANSACTIONS :  We modify the log-based recovery schemes to allow multiple transactions to execute concurrently.  All transactions share a single disk buffer and a single log.  A buffer block can have data items updated by one or more transactions.
  • 7. CHECKPOINTS:  We modify the log-based recovery schemes to allow multiple transactions to execute concurrently.  All transactions share a single disk buffer and a single log  A buffer block can have data items updated by one or more transactions.  Streamline recovery procedure by periodically performing check pointing.
  • 8. RESTART RECOVERY:  When the system recovers from a crash, it constructs two list:  The undo-list consists of transaction to be done.  The system constructs the two lists as follows:  Initially, they are both empty.  The system scans the log backward, examining each record, until it finds the first <checkpoint> record:
  • 9.  For each record found of the form<Ti commit>,it adds Ti to redo- list.  For each record found of the form<Ti start>,if Ti is not in redo- list, then it adds Ti to undo-list.  When the system has examined all the appropriate log records, it checks the list L in the checkpoint record.  For each transaction Ti in L, if Ti is not in redo-list, then it adds Ti to undo-list.
  • 10. SHADOW PAGING:  Shadow paging is an alternative to log-based recovery.  IDEA: maintain two page tables during the lifetime of a transaction .  Store the shadow page table in nonvolatile storage, such that state of the database prior to transaction execution may be recovered.  Only current page table is used for data item accesses during execution of the transaction.
  • 11.
  • 12.  TO COMMIT A TRANSACTION : 1. Flush all modified pages in main memory to disk 2. Output current page table to disk 3. Make the current page table the new shadow page table, as follows:  keep a pointer to the shadow page table at a fixed (known) location on disk.  to make the current page table the new shadow page table, simply update the pointer to point to current page table on disk.
  • 13.  BUFFER MANAGEMENT:  LOG RECORD BUFFERING: log records are buffered in main memory, instead of being output directly to stable storage.  Log force is performed to commit a transaction by forcing all its log records (including the commit record) to stable storage.  Several log records can thus be output using a single output operation, reducing the I/O cost.
  • 14.  DATABASE BUFFERING :  Database maintains an in-memory buffer of data blocks.  When a new block is needed, if buffer is full an existing block needs to be removed from buffer.  If the block chosen for removal has been updated, it must be output to disk.  If a block with uncommitted updates is output to disk, log records with undo information for the updates are output to the log on stable storage first.
  • 15.  OPERATING SYSTEM ROLE IN BUFFER MANAGEMENT:  We can manage the database buffer by using one of this approaches:  The database system reserves part of main memory to serve as a buffer that it, rather than the operating system, manages.  The database system implements its buffer within the virtual memory provided by the operating system.  The database system in turn force-output the buffer blocks to the database, after writing relevant log records to stable storage.
  • 16.  Unfortunately, almost all current-generation operating systems retain complete control of virtual memory.  The operating system reserves space on disk for storing virtual- memory pages that are not currently in main memory ; this space is called swap space.  Although both approaches suffer from some drawbacks, one or the other must be chosen unless the operating system is designed to support the requirements of database logging.