PART5TRANSACTIONMANAGEMENTChapter17RecoverySystemJune2009DatabaseSystemConcepts-Chapter17RecoverySystem-3RecoverycomponentinDBMSensureatomicityanddurabilitydespitefailures,thusprovideshighavailability(可用性)Recoveryschemesincludeactionstakenduringnormaltransactionprocessingtorecordenoughinformationabouttransactionexecutiontorecoverfromfailures,e.g.loginDBSactionstakenafterafailuretorecoverthedatabasecontentstoastatethatensuresatomicityanddurabilityBackup(备份)isanotherapproachtakenbyDBStoensurehighavailabilityofDBSIntroductionJune2009DatabaseSystemConcepts-Chapter17RecoverySystem-4§17.1FailureClassificationThreetypesoffailuresmayoccurinDBSTransactionfailurelogicalerrorstransactioncannotcompleteduetosomeinternalerrorconditionsystemerrorsthedatabasesystemmustterminateanactivetransactionduetoanerrorcondition(e.g.,deadlock)Systemcrashhardwaremalfunction(e.g.powerfailureorotherhardwarefailures),andbugsinDBSsoftwareoroperatingsystems,whichcausesthesystemtocrashJune2009DatabaseSystemConcepts-Chapter17RecoverySystem-5§17.1FailureClassification(cont.)fail-stopassumption:dataitemsinnon-volatilestorageareassumedtonotbecorruptedbysystemcrashe.g.databasesystemshaveefficientmechanisms,athardwareandsoftwarelevels,topreventcorruptionofdiskdataDiskfailure(storagemediumfailure)aheadcrashorsimilardiskfailuredestroysallorpartofdiskstoragedestructionisassumedtobedetectable,becausediskdrivesusechecksumstodetectfailuresJune2009DatabaseSystemConcepts-Chapter17RecoverySystem-6§17.2StorageStructure17.2.1StorageTypesThreecategoriesofstoragemediumincomputersystemsVolatile(易失)storage:doesnotsurvivesystemcrashese.g.mainmemory,cachememoryNonvolatile(非易失,永久)storage:survivessystemcrashese.g.disk,tape,flashmemory,non-volatile(batterybackedup)RAMJune2009DatabaseSystemConcepts-Chapter17RecoverySystem-717.2.1StorageTypes(cont.)Stable(可靠、稳定)storageamythicalformofstoragethatsurvivesallfailuresapproximatedbymaintainingmultiplecopiesondi...