资源描述:
《数据库系统概念第六版课后习题部分答案16s》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、CHAPTER16RecoverySystemPracticeExercises16.1Explainwhylogrecordsfortransactionsontheundo-listmustbepro-cessedinreverseorder,whereasredoisperformedinaforwarddirection.Answer:Withinasingletransactioninundo-list,supposeadataitemisupdatedmorethanonce,sayfrom1to2,andthenfrom2to3.Iftheundologre
2、cordsareprocessedinforwardorder,thefinalvalueofthedataitemwouldbeincorrectlysetto2,whereasbyprocessingtheminreverseorder,thevalueissetto1.Thesamelogicalsoholdsfordataitemsupdatedbymorethanonetransactiononundo-list.Usingthesameexampleasabove,butassumingthetransactioncommit-ted,itiseasytosee
3、thatifredoprocessingprocessestherecordsinforwardorder,thefinalvalueissetcorrectlyto3,butifdoneinreverseorder,thefinalvaluewouldbesetincorrectlyto2.16.2Explainthepurposeofthecheckpointmechanism.Howoftenshouldcheckpointsbeperformed?Howdoesthefrequencyofcheckpointsaffect:•Systemperformancewhen
4、nofailureoccurs?•Thetimeittakestorecoverfromasystemcrash?•Thetimeittakestorecoverfromamedia(disk)failure?Answer:Checkpointingisdonewithlog-basedrecoveryschemestore-ducethetimerequiredforrecoveryafteracrash.Ifthereisnocheckpoint-ing,thentheentirelogmustbesearchedafteracrash,andalltransacti
5、onsundone/redonefromthelog.Ifcheckpointinghadbeenperformed,thenmostofthelog-recordspriortothecheckpointcanbeignoredatthetimeofrecovery.Anotherreasontoperformcheckpointsistoclearlog-recordsfromstablestorageasitgetsfull.Sincecheckpointscausesomelossinperformancewhiletheyarebeingtaken,theirf
6、requencyshouldbereducediffastrecoveryisnotcritical.Ifweneedfastrecoverycheckpointingfrequencyshouldbeincreased.If1516Chapter16RecoverySystemtheamountofstablestorageavailableisless,frequentcheckpointingisunavoidable.Checkpointshavenoeffectonrecoveryfromadiskcrash;archivaldumpsaretheequival
7、entofcheckpointsforrecoveryfromdiskcrashes.16.3Somedatabasesystemsallowtheadministratortochoosebetweentwoformsoflogging:normallogging,usedtorecoverfromsystemcrashes,andarchivallogging,usedtorecoverfrommedia(disk)failure.Whencanalogrecordbedeleted,ineachofthesecases,