数据库系统课件第10章ch0tps architecture_第1页
数据库系统课件第10章ch0tps architecture_第2页
数据库系统课件第10章ch0tps architecture_第3页
数据库系统课件第10章ch0tps architecture_第4页
数据库系统课件第10章ch0tps architecture_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

TheArchitectureofTransactionProcessingSystems2EvolutionofTransactionProcessingSystemsThebasiccomponentsofatransactionprocessingsystemcanbefoundinsingleusersystems.Theevolutionofthesesystemsprovidesaconvenientframeworkforintroducingtheirvariousfeatures.3Single-UserSystemPresentationServices-displaysforms,handlesflowofinformationto/fromscreenApplicationServices-implementsuserrequest,interactswithDBMSACIDpropertiesautomatic(isolationistrivial)ornotrequired(thisisnotreallyanenterprise)DBMSusermodulecentralizedsystemPresentationServicesApplicationServicesDB4CentralizedMulti-UserSystemusermodulecentralmachinepresentationapplicationservicesservicespresentationapplicationservicesservices•••communicationDBMSdumbterminalDB5

Two-TieredModelofTPSDBMSdatabaseservermachinepresentationapplicationservicesservicespresentationapplicationservicesservices•••clientmachinescommunicationStoredProceduresSPsDB6

Three-TieredModelofTPSDBMSdatabaseservermachinepresentationserver•••clientmachinescommunicationpresentationserverapplicationserverapplicationservermachineDB7

Three-TieredModelofTPSDBMSdatabaseservermachinepresent.server•••clientmachinescommunicationpresent.serverapplic.serverapplic.servermachinestrans.servertrans.servermachinesDB8Concurrency

of

TransactionsExecution9TransactionT1&T2T1T2localcomputationlocalvariablesbegintrans..op1,1..op1,2..commitbegintrans..op2,1..op2,2..commit多用户事务执行示例begintrans..op1,1..op1,2..commitbegintrans..op2,1..op2,2..commit10TransactionExecutionT1T2localcomputationlocalvariablessequenceofdboperationsoutputbyT1op1,1op1.2

c1op2,1op2.2

c2sequenceofdb

operationsoutputbyT2begintrans..op2,1..op2,2..commitbegintrans..op1,1..op1,2..commit11SequenceofDBop.inputtoDBMST1T2op1,1op1.2

c1op2,1op2.2

c2DBMSinterleavedsequenceofdboperationsinputtoDBMSop1,1op2,1op2.2

c2

op1.2c1受并发控制的影响,各个事务的数据库访问请求在DBMS内部的执行顺序,与它们到达DBMS的顺序不完全一样!但就单个事务而言,其操作的执行顺序是不变的!12ExecutionsequenceofDBop.inDBMST1T2op1,1op1.2

c1op2,1op2.2

c2DBMSinterleavedsequenceofdboperationsinputtoDBMSop1,1

op2,1op1.2c1op2.2

c2executionsequenceofdboperationsinDBMSop1,1op2,1op2.2

c2

op1.2c1各个事务的数据库访问操作,在DBMS中的实际执行序列,就构成这些事务之间的一个调度(Schedule或History)如上图所示,最终产生的是这两个事务之间的一个串行调度(先T1后T2)。13SerialExecutioninDBMST1T2op1,1op1.2

c1op2,1op2.2

c2DBMSinterleavedsequenceofdboperationsinputtoDBMSop1,1

op1.2c1op2,1op2.2

c2SerialExecutioninDBMST1&T2op1,1op2,1op2.2

c2

op1.2c114ConcurrentExecutioninDBMST1T2op1,1op1.2

c1op2,1op2.2

c2DBMSinterleavedsequenceofdboperationsinputtoDBMSop1,1op2,1op2.2

c2

op1.2c1如上图所示,最终产生的是这两个事务之间的一个并发调度。不正确的并发执行,可能产生错误的执行结果。DMBS并发控制的目标,是实现并发事务的可串行化调度!op1,1

op2,1op1.2c1op2.2

c2concurrentsequenceofdboperationsinDBMSTransaction(事务)‘事务’是一个非常古老的思想,一般是指要做的或所做的事情;在计算机术语中,‘事务’是指访问并可能更新数据库中数据的一个程序执行单元(unit);在传统语义学上,‘事务’就是一种转换系统状态的行为。三个层面上的‘事务’概念现实世界:一件‘事情’计算机世界:一个‘程序执行单元’数据库管理系统:一个用于访问数据库的‘执行单元’在关系数据库系统中一个事务是指由“一条SQL语句”或“一组SQL语句”所构成的一个执行过程,并具有ACID四个特性。‘事务’是恢复和并发控制的基本单位为什么要引入‘事务’概念?数据完整性(integrityofthedatabase)consistentstate影响数据完整性的因素concurrencyrecoverytransactionabortsystemcrashmediafault在数据库管理系统中引入事务处理功能,可以确保在任何情况下,都能保证数据库中数据的正确性。DB事务执行concurrencycontrolrecoverycontrolConcurrencycontroldealswithensuringthattheintegrityofthedatabaseispreservedwhenitisbeingsimultaneouslyaccessedbymorethanoneuser.Recoverycontroldealswithensuringthattheintegrityofthedatabaseispreservedevenifaabort/crash/faultshouldoccurwhilechangesarebeingmadetothedatabase.ThePropertiesofTransact

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论