A first course in Database Systems(1)_第1页
A first course in Database Systems(1)_第2页
A first course in Database Systems(1)_第3页
A first course in Database Systems(1)_第4页
A first course in Database Systems(1)_第5页
已阅读5页,还剩31页未读 继续免费阅读

下载本文档

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

文档简介

.,AFirstCourseinDatabaseSystems,Departmentofcomputersciencewithoutallowingtheactionofoneusertoaffectotherusers;withoutallowingsimultaneousaccessestocorruptthedataaccidentally.,.,1.1TheEvolutionofDatabaseSystems,Databasesystemsevolvedfromfilesystems.,DataredundancyandinconsistencyMultiplefileformats,duplicationofinformationindifferentfiles.DifficultyinaccessingdataNeedtowriteanewprogramtocarryouteachnewtask.Dataisolationmultiplefilesandformats.IntegrityproblemsIntegrityconstraints(e.g.accountbalance0)become“buried”inprogramcoderatherthanbeingstatedexplicitly.Hardtoaddnewconstraintsorchangeexistingones.,.,1.1TheEvolutionofDatabaseSystems,AtomicityofupdatesFailuresmayleavedatabaseinaninconsistentstatewithpartialupdatescarriedout.Example:Transferoffundsfromoneaccounttoanothershouldeithercompleteornothappenatall.ConcurrentaccessbymultipleusersConcurrentaccessedneededforperformance.Uncontrolledconcurrentaccessescanleadtoinconsistencies.Example:Twopeoplereadingabalanceandupdatingitatthesametime.SecurityproblemsHardtoprovideuseraccesstosome,butnotall,data.,.,1.1TheEvolutionofDatabaseSystems,Late1960sand1970s:HarddisksallowdirectaccesstodataNetworkandhierarchicaldatamodelsinwidespreaduseTheearlyDBMSdidntsupporthigh-levelquerylanguages.,.,1.1TheEvolutionofDatabaseSystems,1970:TedCodddefinestherelationaldatamodelWouldwintheACMTuringAwardforthisworkIBMResearchbeginsSystemRprototypeMainidea:organizeallthedataindatabaseastablescalledrelations.Queriescouldbeexpressedinaveryhigh-levellanguagetoincreasetheefficiencyofdatabaseprogrammers.,.,1.1TheEvolutionofDatabaseSystems,1980s:ResearchrelationalprototypesevolveintocommercialsystemsSQLbecomesindustrialstandardParallelanddistributeddatabasesystemsObject-orienteddatabasesystems,1990s:Largedecisionsupportanddata-mining(数据挖掘)applicationsLargemulti-terabytedatawarehousesEmergenceofWebcommerce,2000s:XMLandXQuerystandardsAutomateddatabaseadministration,.,1.2OverviewofaDatabaseManagementSystem,ADBMSisapowerfultoolforcreatingandmanaginglargeamountsofdataefficientlyandallowingittopersistoverlongperiodsoftime,safely.,.,1.2OverviewofaDatabaseManagementSystem,.,1.2OverviewofaDatabaseManagementSystem,Application1,Application2,.,Applicationn,DBMS,database,DatabaseManagementSystem,.,1.2OverviewofaDatabaseManagementSystem,.,Storagemanager,Buffermanager,read/writepages,buffers,index/file/recordmanger,pagecommands,data,metadata,indexs,Executionengine,index,file,andrecordrequests,Querycompiler,Queryplan,Queries,updates,User/application,Transactionmanager,DDLcompiler,DDLcommands,Databaseadministrator,Transactioncommands,Loggingandrecovery,Concurrencycontrol,Locktable,logpages,metadata,Metadata,statistics,单线框系统成分双线框内存中的数据结构实线控制和数据流虚线数据流,.,1.2OverviewofaDatabaseManagementSystem,Twotypesofuser:ConventionalusersandapplicationprogramsAdatabaseadministrator(DBA)ThreetypesofinputstotheDBMS:Queries:questionsaboutthedatatwoways:SQL,APIModifications:operationstomodifythedataSchemamodifications:commandstochangetheschemaofthedatabaseorcreateanewdatabasebydatabaseadministrators,DDLcommands,.,1.2OverviewofaDatabaseManagementSystem,Queryprocessor:QuerycompilerTranslatesthequeryintoaninternalformcalledaqueryplan.Aqueryparser(分析器)AquerypreprocessorAqueryoptimizer(优化器)ExecutionengineItgetsthedatafromthedatabaseintobuffersinordertomanipulatethatdata.Itneedstointeractwiththeschedulertoavoidaccessingdatathatislocked,andwiththelogmanagertomakesurethatalldatabasechangesareproperlylogged.,.,1.2OverviewofaDatabaseManagementSystem,Storage:Aplacewheredataisstored,containsdataandmetadataData:thecontentsofthedatabaseitself.Metadata(元数据):thedatabaseschemathatdescribesthestructureof,andconstraintson,thedatabase.Indexes:datastructuresthatsupportefficientaccesstothedata.Indexesarepartofthestoreddata,andadescriptionofwhichattributeshaveindexesispartofthemetadata.,.,1.2OverviewofaDatabaseManagementSystem,Storagemanagerandbuffermanager:managesthereadingandwritingofinformationincludesthestoragemanagerandthebuffermanager:storagemanager:keepstrackofthelocationoffilesonthediskandobtainstheblockorblockscontainingafileonrequestfromthebuffermanager.block:4K-16Kbuffermanager:partitiontheavailablemainmemoryintobuffers.page:1K-4K,.,1.2OverviewofaDatabaseManagementSystem,Transaction:agroupofoperationsthatmustappeartohavebeenexecutedtogethersequentially,asaunit.Properties:ACIDAtomicity:eitherallofatransactionbeexecutedornoneofitis.Consistency:keepconsistentstate.Isolation:Whentwoormoretransactionsrunconcurrently,theireffectsmustbeisolatedfromoneanother.Durability(持久性):Ifatransactionhascompleteditswork,itseffectshouldnotgetlostwhilethesystemfail,evenifitfailsimmediatelyafterthetransactioncompletes.,.,1.2OverviewofaDatabaseManagementSystem,Transactionmanager:beresponsiblefortheintegrityofthesystemLoggingConcurrencycontrol:lockDeadlockresolution,.,1.2OverviewofaDatabaseManagementSystem,Client/Server(C/S)architecture,DBClient,DBClient,DBServer,JavaC/C+PowerBuilderDelphiVB,MSAccessSybaseASAMySQLOracleIBMDB2,sqlrequest,sqlrequest,reply,reply,Client:theprocesssendingqueriesorothercommands.Server:theprocessexecutingqueriesorothercommands,.,1.3OutlineofDatabase-SystemsStudies,Ideasrelatedtodatabasesystemcanbedividedintothreebroadcategories:Design:Howtobuildausefuldatabase?Requirementanalysis,datamodeling,relationalmodeling.Programming:Howtoexpressqueriesandotheroperationsondatabase?Iimplementation:HowtobuildaDBMS?,.,1.3.1DatabaseDesign,Chapter2and3coverdesign.Chapter2:TheEntity-RelationshipDataModelChapter3:TheRelationalDataModel,.,1.3.3Example,Wellbuildamarketingdatabasesystemforasalecompany(supermarket).Itwillmanageallthefollowinginformation:1.Managealldepartmentsinformationinthecompany(suchasShanghaisaledepartment,JiangSusaledepartment).Alsomanageeverysalesmaninformationinthosedepartmentsincludingexclusiveemployeenumber,IDcardnumber,andsomeprivateinformation(suchasname,gender,birthdayandphonenumber).Bythewayoneofsalesmenwillactasthedepartmentmanagerinhisdepartment.,.,1.3.3Example,2.Manageagroupofcustomers:name,province,city,companyname,phonenumber.3.Managealltheproductsinformation:manufacturers(e.g.Chunlan,Hailer),types(e.g.motorcycle,airconditioner),specifications(e.g.MT125,RE1500),prices,descriptions.4.Managesalesorderwhichrecordeachdealhasbeendone.Notes:everysalesordercontainsanuniqueorderNo.,signdate,acorrespondingcustomer,asalesman,andatleastonekindofproducts.Anyproductintheordershouldhaveitsquantityandunitpricewhichwillbeusedtocalculatethetotalprices.,.,.,RelationalDataModel:Customer(custid,name,prov,city,phone,unit)Product(prodid,factory,type,spec,price,desc)Salesman(empid,idno,name,gender,phone,deptid)Department(deptid,name,headerid)Salesorder(orderno,signdate,empid,custid)Salesitem(orderno,lineno,prodid,singlecost,quantity),.,1.3.1DatabaseDesign,Chapter5through8coverdatabaseprogramming.Chapters5RelationalAlgebraChapters6TheDatabas

温馨提示

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

评论

0/150

提交评论