【文档说明】数据库原理课件第一章.ppt,共(97)页,1.624 MB,由小橙橙上传
转载请保留链接:https://www.ichengzhen.cn/view-92515.html
以下为本文档部分文字说明:
DatabaseSystem-SSD7Spring,2012TanChang-gengSchoolofSoftware,CentralSouthUniversityTCG-CSU1.2DatabaseSy
stemsReferencesCMUSSD7E-resourceDatabasesystemconcepts(5thed.)bySilberschatz,Korth,Sudarshan,2005,HigherEducationPress.ISBN7-04-019245-4数据
库系统概念(上书中译本),原著:Silberschatz,杨冬青译,机械工业出版社,ISBN7-111-19687-2DatabaseSystems–ApracticalApproachtoDesign,Implementation,andMan
agement(ThomasConnolly,CarolynBegg,PersonEducationInc.),ISBN7-5053-8784-7Instructor:TanChanggeng.Email:cgtan163Q
Q:327414529OfferingWorld-LeadingCurriculuminComputerProgramming&SoftwareSystemsDevelopment(SSD)TCG-C
SU1.4DatabaseSystemsTwoCertificatesCertificateinComputerProgrammingCourses1through5CertificateinSoftware
SystemsDevelopmentCourses1through10SSDCurriculumOverviewTCG-CSU1.5DatabaseSystemsiCarnegieCurriculu
m1-5=CertificateinComputerProgramming1-10=CertificateinSoftwareSystemsDevelopment1:IntroductiontoInformationSystems2:IntroductiontoComputerSystems
3:ObjectOrientedProgrammingandDesign5:DataStructuresandAlgorithms6:SystemLevelProgramming10:SoftwareProjectOrganizationandManagement9:S
oftwareSpecification,TestandMaintenance8:NetworksandDistributedComputing4:UserCenteredDesignandTesting7:DatabaseSystemsTCG-
CSU1.6DatabaseSystemsWhatdoesiCarnegiedo?10CourseSequenceRootedintheexpertiseofCarnegieMellonUniversity‘sSchoolofComputerScienceAp
plied,industry-orientedskillsSoftwareDevelopmentDisciplineSoftwareDevelopment!=ComputerScienceCStrain
sscientists/researchersFocusonTheoryHigherMathematicsSoftwareDevelopersarenotresearchersApplied,industryorientedskillsFocusonfoundat
ionalskillsTCG-CSU1.7DatabaseSystemsThepurposeofSSD7isforstudentstoBecomefamiliarwithfundamentalDBMSconceptsandwhatadatabasesystemisLearntouseSQL(s
tructuredquerylanguage)LearntodesigndatabasesystemsLearntodesignandmanagetransaction(事务)LearntoimprovequeryperformanceGainexposuretofutu
retrendsindatabasesTCG-CSU1.8DatabaseSystemsStudentssuccessfullycompletingSSD7willbeabletoPRODUCE(cont’d)Databased
esignsthatsupportagivenapplicationDatamodelsusingE-RdiagramsSoundschemadesignsusingnormalization(使用规范化方法设
计出合理的模式)Web-baseddatabaseapplicationsusingSQLandJSP/ServletsTCG-CSU1.9DatabaseSystemsStudentssuccessfullycompletingSSD7willbeable
toUSEIndexstructuresofaDBMStoimproveperformanceThetransactionfeaturesofaDBMStoachievefaultrecovery(故
障恢复)andconcurrencycontrol(并发控制)Keyrelationaloperationstomanipulatedata(操纵数据)SQLDDLtomodeldata,constrain
ts,andviews(视图)SQLDMLtowritecomplexqueriesTCG-CSU1.10DatabaseSystemsStudentswillbeabletoknowledgeablyDISCUSSThebasicconceptsofobject-rel
ationalandobject-orienteddatabasemanagementsystemsThebasicconceptsandapplicationofdatawarehousinganddatamining(datacube
s,OLAP)ThebasicfunctionsandapplicationofmultimediadatabasesThebasicissuesofdatabaseprivacyandsecurityTheDBMSofferingsofthemostimportantvendor
sTCG-CSU1.11DatabaseSystemsDatabaseProgDistributedSysOSUIDataStruct&Algorithms数据库的地位TCG-CSU1.12DatabaseSystemsTopicsShallbeL
earnedIntroductionRelationalModelSQLEntity-RelationshipModelRelational-DatabaseDesignTransactionsConcurren
cyControlRecoverySystem(IntegrityandSecurity)DatabaseSystemArchitectures……TCG-CSU1.13DatabaseSystemsChapter1:IntroductionP
urposeofDatabaseSystemsViewofDataDatabaseLanguagesRelationalDatabasesDatabaseDesignObject-basedandsemistructureddatabasesDataStorageandQu
eryingTransactionManagementDatabaseArchitectureDatabaseUsersandAdministratorsOverallStructureHistoryofDatabaseSystemsTCG-CSU1.
14DatabaseSystems1.1DatabaseManagementSystem(DBMS)DBMScontainsinformationaboutaparticularenterpriseCollection
ofinterrelateddataSetofprogramstoaccessthedataAnenvironmentthatisbothconvenientandefficienttouseDatabaseAppli
cations?Banking:alltransactionsAirlines:reservations,schedulesUniversities:registration,gradesSales:customers,products,purchasesOnli
neretailers:ordertracking,customizedrecommendationsManufacturing:production,inventory,orders,supplychainHumanresou
rces:employeerecords,salaries,taxdeductionsDatabasestouchallaspectsofourlivesTCG-CSU1.15DatabaseSystemsTheExamplesofDatabaseSystemsPu
rchasesusingyourcreditcard信用卡AcreditcarddatabaseThecheckoutassistantAcreditcardreaderCheckyourcreditAddthepurc
hasestodatabaseMonthlystatementstoeachcardholderTCG-CSU1.16DatabaseSystems1.2PurposeofDatabaseSystemsIntheearlydays,databaseapplication
swerebuiltdirectlyontopoffilesystemsDrawbacksofusingfilesystemstostoredata?TCG-CSU1.17DatabaseSystemsLimitationsoftheFile-BasedApproachDatar
edundancyandinconsistency数据冗余与非一致性Multiplefileformats,duplicationofinformationindifferentfiles文件格式不相容,数据冗余Program-datadependence程序依赖于数据Ne
edtowriteanewprogramtocarryouteachnewtaskDataisolation—multiplefilesandformats数据孤立;文件格式不相容Integrityproblems完整性问题Integrityconstraints(e.
g.accountbalance>0)become―buried‖inprogramcoderatherthanbeingstatedexplicitlyHardtoaddnewconstraintsorchan
geexistingonesTraditionalFile-BasedSystems文件系统TCG-CSU1.18DatabaseSystemsDrawbacksofusingfilesystems(cont.)At
omicityofupdates原子更新FailuresmayleavedatabaseinaninconsistentstatewithpartialupdatescarriedoutExample
:TransferoffundsfromoneaccounttoanothershouldeithercompleteornothappenatallConcurrentaccessbymultipleusers并发访问Concurr
entaccessedneededforperformanceUncontrolledconcurrentaccessescanleadtoinconsistencies–Example:Twopeoplereadingabalanceandupdatingitatthesame
time(sellticket)SecurityproblemsHardtoprovideuseraccesstosome,butnotall,dataDatabasesystemsoffersolutionstoalltheab
oveproblemsTCG-CSU1.19DatabaseSystemsCharacteristicsoftheDatabaseApproach数据库方法Data:dataarerawfactsthatdescribepeopl
e,objects,andeventsDatabase:AnintegratedcollectionofrelateddataconstitutesaDatabase(DB).相关数据集成relateddata,thedatarep
resentslogicallycoherentfactsaboutsomeaspectsoftherealworldthatarerequiredbyanapplication.Integrated,thedataformult
ipleapplicationsisstoredtogetherandmanipulatedinauniformwayonasecondarystoragesuchasamagneticoranopticaldisk.TCG-CSU1.20Databa
seSystemsDatabaseManagementSystemsADatabaseManagementSystem(DBMS)isacollectionofprogramsthatcontrolsadatabase.General
-purposesoftwaresystemDataDefinitionLanguage(DDL)DataManipulationLanguage(DML)Controlledaccesstothedatabaseasecuritysystem(authorizedusers)安
全性anintegritysystem(consistencyofstoreddata)完整性aconcurrencycontrolsystem(sharedaccess)并发控制arecoverycontrolsystem(whenH/Sfai
lure)恢复auser-accessiblecatalog(descriptionsofdata)数据字典TCG-CSU1.21DatabaseSystemsDatabaseSystemaDatabaseSystemconsistsofanapplicationspe
cificdatabase数据库theDBMSthatmaintainsthatdatabaseDBMStheapplicationsoftwarethatmanipulatesthedatabase应用程序数据库系统的个体含义是指一个具体的数据库管理系统软件和用它建立起来的
数据库;它的学科含义是指研究、开发、建立、维护和应用数据库系统所涉及的理论、方法、技术所构成的学科。在这一含义下,数据库系统是软件研究领域的一个重要分支,常称为数据库领域。TCG-CSU1.22DatabaseSystemsTCG-CSU1.23DatabaseS
ystemsCharacteristicsoftheDatabaseApproachDBMSsembodythethreedistinguishingcharacteristicsofthedatabaseapproach:dataa
bstraction,reliability,andefficiency.数据抽象可靠性高效TCG-CSU1.24DatabaseSystemsCharacteristicsoftheDatabaseAppr
oach2DataAbstractionprovideuserswithhigh-level,conceptualrepresentationsofthedata—atableinrelationalDBMSs提供
高层、概念的数据表示hidestoragedetailsthatarenotofinteresttomostdatabaseusers隐藏存储细节program-dataindependence数据独立性TCG-CSU1.25DatabaseSystemsCharacteristicsofth
eDatabaseApproach3Reliability.DBMSsprovidehighreliabilityEnforcingintegrityconstraints完整性约束Integrityconstraintsreflectthemeaning(or,theseman
tics)ofthedataandoftheapplicationEnsuringdataconsistencydespitehardwareorsoftwarefailures.数据一致性TansactionsWithinanapplicationprogram,on
eormorequery-and-updaterequeststotheDBMScanbelogicallygroupedtogetherinordertoperformatask.Agroupofsuchrequ
estsiscalledatransaction.事务Examples:acustomerpayswithacreditcard,withdrawmoneyfromATMTCG-CSU1.26DatabaseSystemsCharacte
risticsoftheDatabaseApproach4Efficiency:DBMSssupportbothefficientspaceutilizationandefficientaccesstodata.Storingeachda
taitemonlyonce减少冗余Enhancingtheperformanceofqueriesbymeansofoptimizationsandtheuseofaccessmethodstodatabasedontheirvalues查询优化Decreasingresponsetim
eoftransactionsbyallowingmultipleuserstoaccessthedatabaseconcurrently并发提高效率TCG-CSU1.27DatabaseSystemsContrastingDatabaseandFileSystemsTCG-CS
U1.28DatabaseSystemsFile1File2FilenProg1Prog2PrognFileSystemTCG-CSU1.29DatabaseSystemsDatabaseProg1Prog2PrognDBMSTCG-CSU1.30Databa
seSystems人工管理文件系统数据库系统应用背景科学计算科学计算、管理大规模管理硬件背景无直接存取存储设备磁盘、磁鼓大容量磁盘软件背景没有操作系统有文件系统有数据库管理系统背景处理方式批处理联机实时处理批处理
联机实时处理,分布处理批处理数据的管理者人文件系统数据库管理系统数据面向的对象某一应用程序某一应用程序整个应用系统数据的共享程度无共享,冗余度极大共享性差,冗余度大共享性高,冗余度小数据的独立性不独立,完全依赖于程序独立性差具
有高度的物理独立性和逻辑独立性数据的结构化无结构记录内有结构,整体无结构整体结构化,用数据模型描述特点数据控制能力应用程序自己控制应用程序自己控制由数据库管理系统提供数据安全性、完整性、并发控制和恢复能力Comparethedi
fferentphasesofdatamanagement(Table1)TCG-CSU1.31DatabaseSystemsWhenIsaDatabaseManagementSystemNeeded?Advantages1Cont
rolofdataredundancyDataconsistencyMoreinformationfromthesameamountofdataSharingofdataImproveddataintegrityImpro
vedsecurityEnforcementofstandardsEconomyofscaleTCG-CSU1.32DatabaseSystemsAdvantages2BalanceofconflictingrequirementsImproveddataaccessibilityan
dresponsivenessIncreasedproductivityImprovedmaintenancethroughdataindependenceIncreasedconcurrencyImpro
vedbackupandrecoveryservicesTCG-CSU1.33DatabaseSystemsDisadvantagesComplexitySizeCostofDBMSsAdditionalhardwarecostsCo
stofconversionPerformanceHigherimpactofafailureTCG-CSU1.34DatabaseSystemsWhenIsaDatabaseManagementSystemNotNeeded?Thedatahasasimplest
ructureanditssizeissmall.Theapplication,althoughsimpleandunchanging,hasaspecialpurpose.Concurrentaccesstodatabymultipleusersisnotrequired.TCG-CSU1
.35DatabaseSystemsFourConceptsDataDatabaseDBMS(DatabaseManagementSystems)DBS(DatabaseSystems)TCG-CSU1.36DatabaseSystemsDatabaseSystemsCon
ceptsData(数据):Dataarerawfactsthatdescribepeople,objects,andevents.Or数据实际上就是描述事物的符号记录。例如:文字、图形、图象、声音、学生的档案记录等。数据的形式本身并不能完全表达其内容,需要经过语义
解释。数据与其语义是不可分的。Information(信息):一般把信息理解为关于现实世界事物存在方式或运动状态的反映.TCG-CSU1.37DatabaseSystemsDifferencebetweenDataandInform
ation数据是信息的符号表示或称为载体;信息则是数据的内涵,是对数据语义的解释;数据表示了信息,而信息只有通过数据形式才能被计算机理解和接受。TCG-CSU1.38DatabaseSystemsDatabaseAnintegratedcollectionofrelatedda
taconstitutesaDatabase(DB).KeepdatalongtimeLargequantitiesofdataLogicallyrelatedStructureddataShareTCG-CSU1.39DatabaseSystemsDatabaseMan
agementSystems(DBMS)ADatabaseManagementSystem(DBMS)isacollectionofprogramsthatcontrolsadatabase.`Itenablesuserstode
fine,create,maintain,andcontrolaccesstothedatabase.Wecanuseitnotonlytocreateandmaintainmultipledatabasesbutalsotoimplem
entdatabasesystemsfordifferentapplications.TCG-CSU1.40DatabaseSystemsDatabaseSystemsAdatabasesystemisdevelopedtosupporttheop
erationsofaspecificorganizationoraspecificsetofapplications.aDatabaseSystemconsistsof1)Anapplicationspecificdatabase2)TheDB
MSthatmaintainsthatdatabase3)TheapplicationsoftwarethatmanipulatesthedatabaseThefigure1-4illustratesasimplifieddatabase-systemarchi
tectureTCG-CSU1.41DatabaseSystemsFigure1-4database-systemarchitectureTCG-CSU1.42DatabaseSystemsRolesintheDatabaseEnvironm
entDataandDatabaseAdministrators(DAandDBA)DatabaseDesignersLogicalDatabaseDesignersPhysicalDatabaseDesignersApplicationDeveloper
sEnd-UsersNaïveusersSophisticatedusersTCG-CSU1.43DatabaseSystems1.3DatabaseArchitectureThearchitectureofadataba
sesystemsisgreatlyinfluencedbytheunderlyingcomputersystemonwhichthedatabaseisrunning:CentralizedClient-serverPa
rallel(multi-processor)DistributedTCG-CSU1.44DatabaseSystems1.4DatabaseUsersUsersaredifferentiatedbythewaytheyexpecttointer
actwiththesystemApplicationprogrammers–interactwithsystemthroughDMLcallsSophisticatedusers–formrequestsinadatabasequ
erylanguageSpecializedusers–writespecializeddatabaseapplicationsthatdonotfitintothetraditionaldataprocess
ingframeworkNaïveusers–invokeoneofthepermanentapplicationprogramsthathavebeenwrittenpreviouslyExamples,peopleaccessing
databaseovertheweb,banktellers,clericalstaffTCG-CSU1.45DatabaseSystems1.5DatabaseAdministratorCoordina
tesalltheactivitiesofthedatabasesystem;thedatabaseadministratorhasagoodunderstandingoftheenterprise‘sinformationresourcesandneeds.Data
baseadministrator'sdutiesinclude:Schemadefinition模式定义StoragestructureandaccessmethoddefinitionSchemaandphysicalorganizationmodificationGr
antinguserauthoritytoaccessthedatabaseSpecifyingintegrityconstraintsActingasliaisonwithusersMonitoringperformanceandrespondingtochangesi
nrequirementsTCG-CSU1.46DatabaseSystemsOverallSystemStructureTCG-CSU1.47DatabaseSystems1.6Three-LevelArchitectureDBAshouldbe
abletochangedatabasestoragestructureswithoutaffectingtheusers’views.Internalstructureofdatabaseshouldbeunaffectedbychangestophysical
aspectsofstorage.DBAshouldbeabletochangeconceptualstructureofdatabasewithoutaffectingallusers.Objectives:TCG-CSU1.48DatabaseSystemsANSI-SPARCThre
e-LevelArchitectureTCG-CSU1.49DatabaseSystemsANSI-SPARCThree-LevelArchitectureExternalLevel外部层Users’viewofthedataba
se.用户视图Describesthatpartofdatabasethatisrelevanttoaparticularuser.ConceptualLevel概念层Communityviewofth
edatabase.总体视图Describeswhatdataisstoredindatabaseandrelationshipsamongthedata.InternalLevel内部层Physi
calrepresentationofthedatabaseonthecomputer.Describeshowthedataisstoredinthedatabase.TCG-CSU1.50DatabaseSystemsDifferencesbe
tweenThreeLevelsofANSI-SPARCArchitectureTCG-CSU1.51DatabaseSystems1.6.1DataIndependence数据依赖LogicalDataIndependenceReferstoimmunityofexternalschema
stochangesinconceptualschema.概念模式变化不会影响外模式Conceptualschemachanges(e.g.addition/removalofentities).Shouldnotrequirechan
gestoexternalschemaorrewritesofapplicationprograms.PhysicalDataIndependenceReferstoimmunityofconceptualschematochangesintheinternalsche
ma.Internalschemachanges(e.g.usingdifferentfileorganizations,storagestructures/devices).Shouldnotrequirechan
getoconceptualorexternalschemas.TCG-CSU1.52DatabaseSystemsDataIndependenceandtheANSI-SPARCThree-Level
ArchitectureTCG-CSU1.53DatabaseSystemsViewofDataAnarchitectureforadatabasesystemTCG-CSU1.54DatabaseSyste
ms现实世界Conceptualmodel转换internalmodelabstractView1View2abstractFigure1-5threedatamodelsTCG-CSU1.55DatabaseSystemsLevelsofAbstractionPhysicallevel:des
cribeshowarecord(e.g.,customer)isstored.typecustomer=recordcustomer_id:string;customer_name:string;customer_street:s
tring;customer_city:integer;end;Logicallevel:describesdatastoredindatabase,andtherelationshipsamongthedata.Viewlev
el:applicationprogramshidedetailsofdatatypes.Viewscanalsohideinformation(suchasanemployee‘ssalary)forsecuritypurposes.TCG-CSU1
.56DatabaseSystemsInstancesandSchemasSimilartovariablesandtypesinprogramminglanguagesSchema–thelogicalstructureof
thedatabaseExample:Thedatabaseconsistsofinformationaboutasetofcustomersandaccountsandtherelationshipbetweenthem)Analogoustot
ypeinformationofavariableinaprogramPhysicalschema:databasedesignatthephysicallevelLogicalschema:databa
sedesignatthelogicallevelInstance–theactualcontentofthedatabaseataparticularpointintimeAnalogoustothevalueofa
variableTCG-CSU1.57DatabaseSystemsInstancesandSchemasPhysicalDataIndependence–theabilitytomodifythephys
icalschemawithoutchangingthelogicalschemaApplicationsdependonthelogicalschemaIngeneral,theinterfacesb
etweenthevariouslevelsandcomponentsshouldbewelldefinedsothatchangesinsomepartsdonotseriouslyinfluenceothers.
TCG-CSU1.58DatabaseSystems1.7DataModelsAcollectionoftoolsfordescribingDataDatarelationshipsDatasemanticsDataconstraints描述数据、数据间联
系、数据语义以及约束的概念工具的集合Adatamodelcanbethoughtofascomprisingthreecomponents:数据模型由三部分组成:DatastructureDatamanipulation
ConstraintsofdataintegrityTCG-CSU1.59DatabaseSystemsDataModelsDataModel:Relationalmodel(Table)Entity-Relations
hipdatamodel(mainlyfordatabasedesign)Object-baseddatamodels(Object-orientedandObject-relational)Semistructureddat
amodel(XML)Otheroldermodels:NetworkmodelHierarchicalmodelTCG-CSU1.60DatabaseSystems1.8DataManipulati
onLanguage(DML)LanguageforaccessingandmanipulatingthedataorganizedbytheappropriatedatamodelDMLalsoknownasquerylanguageTwoclassesof
languagesProcedural过程式–userspecifieswhatdataisrequiredandhowtogetthosedataDeclarative声明式(nonprocedural)–userspecifi
eswhatdataisrequiredwithoutspecifyinghowtogetthosedataSQListhemostwidelyusedquerylanguageTCG-CSU1.61DatabaseSystemsDataDefinitionLanguage(DDL)Sp
ecificationnotationfordefiningthedatabaseschemaExample:createtableaccount(account-numberchar(10),balanceinteger)DDLcompilergeneratesasetof
tablesstoredinadatadictionaryDatadictionarycontainsmetadata(i.e.,dataaboutdata)DatabaseschemaDatasto
rageanddefinitionlanguageSpecifiesthestoragestructureandaccessmethodsusedIntegrityconstraintsDomainconstraintsReferent
ialintegrity(referencesconstraintinSQL)AssertionsAuthorizationTCG-CSU1.62DatabaseSystemsRelationalModelExampleoftabulardataintherelationalmodelA
ttributesTCG-CSU1.63DatabaseSystemsASampleRelationalDatabaseTCG-CSU1.64DatabaseSystems1.9SQLSQL:widelyusednon-procedurallanguageExample:Find
thenameofthecustomerwithcustomer-id192-83-7465selectcustomer.customer_namefromcustomerwherecustomer.customer_id=‗192-
83-7465‘Example:Findthebalancesofallaccountsheldbythecustomerwithcustomer-id192-83-7465selectaccount.balancefr
omdepositor,accountwheredepositor.customer_id=‗192-83-7465‘anddepositor.account_number=account.account_
numberTCG-CSU1.65DatabaseSystemsApplicationprogramsgenerallyaccessdatabasesthroughoneofLanguageextensionstoallowe
mbeddedSQLApplicationprograminterface(e.g.,ODBC/JDBC)whichallowSQLqueriestobesenttoadatabaseTCG-CSU1.66DatabaseSystems1.
10DatabaseDesignTheprocessofdesigningthegeneralstructureofthedatabase:LogicalDesign–Decidingonthedatabaseschema(acollectionofrela
tionschemas).Databasedesignrequiresthatwefinda“good”collectionofrelationschemas.Businessdecision–Whatattrib
utesshouldwerecordinthedatabase?ComputerSciencedecision–Whatrelationschemasshouldwehaveandhowshouldtheattributesbedistributedamongthevariousre
lationschemas?PhysicalDesign–DecidingonthephysicallayoutofthedatabaseTCG-CSU1.67DatabaseSystemsTheEntity-Relati
onshipModelModelsanenterpriseasacollectionofentitiesandrelationships一单位建模为实体与联系的集合Entity:a―thing‖or―object‖intheenterpri
sethatisdistinguishablefromotherobjectsDescribedbyasetofattributesRelationship:anassociationamongseveralentitiesRepresenteddiagra
mmaticallybyanentity-relationshipdiagram:TCG-CSU1.68DatabaseSystemsObject-RelationalDataModelsExtendtherelationaldatamodelbyincludingobject
orientationandconstructstodealwithaddeddatatypes.Allowattributesoftuplestohavecomplextypes,includingnon-a
tomicvaluessuchasnestedrelations.Preserverelationalfoundations,inparticularthedeclarativeaccesstodata,whileextendingmodelingpower.Pro
videupwardcompatibilitywithexistingrelationallanguages.TCG-CSU1.69DatabaseSystemsXML:ExtensibleMarkupLanguageDe
finedbytheWWWConsortium(W3C)OriginallyintendedasadocumentmarkuplanguagenotadatabaselanguageTheabilitytospecifynewtags,andtocreatene
stedtagstructuresmadeXMLagreatwaytoexchangedata,notjustdocumentsXMLhasbecomethebasisforallnewgenerationdata
interchangeformats.Awidevarietyoftoolsisavailableforparsing,browsingandqueryingXMLdocuments/dataTCG-CSU1.70DatabaseSyst
ems1.11StorageManagementStoragemanagerisaprogrammodulethatprovidestheinterfacebetweenthelow-leveldat
astoredinthedatabaseandtheapplicationprogramsandqueriessubmittedtothesystem.Thestoragemanagerisresponsibletothef
ollowingtasks:InteractionwiththefilemanagerEfficientstoring,retrievingandupdatingofdataIssues:StorageaccessFileorganization
IndexingandhashingTCG-CSU1.71DatabaseSystems1.12QueryProcessing1.Parsingandtranslation语法分析与转换2.Optimization优化3.Evaluation评价TCG-CSU1.72Databas
eSystemsQueryProcessing(Cont.)AlternativewaysofevaluatingagivenqueryEquivalentexpressionsDifferentalgorithmsforeachoperationCostdiffe
rencebetweenagoodandabadwayofevaluatingaquerycanbeenormousNeedtoestimatethecostofoperationsDependscriticallyonstatistical
informationaboutrelationswhichthedatabasemustmaintainNeedtoestimatestatisticsforintermediateresultstocomputecostofcomplexexpressionsTCG-CSU1.73Dat
abaseSystems1.12TransactionManagementAtransactionisacollectionofoperationsthatperformsasinglelogica
lfunctioninadatabaseapplicationWithinanapplicationprogram,oneormorequery-and-updaterequeststotheDBMScanbelogicallygroupedtogetherinordertope
rformatask.Agroupofsuchrequestsiscalledatransaction.Examples:acustomerpayswithacreditcard,withdrawmoneyfromATMTransaction-managementcomponen
tensuresthatthedatabaseremainsinaconsistent(correct)statedespitesystemfailures(e.g.,powerfailuresandoperatingsystemcrash
es)andtransactionfailures.Concurrency-controlmanagercontrolstheinteractionamongtheconcurrenttransaction
s,toensuretheconsistencyofthedatabase.TCG-CSU1.74DatabaseSystemsTheDatabaseSystemEnvironmentDatabasesystemiscomposedof5mainparts:1.Ha
rdware2.SoftwareOperatingsystemsoftwareDBMSsoftwareApplicationprogramsandutilitysoftware3.People4.Procedures5.DataTC
G-CSU1.75DatabaseSystemsTheDatabaseSystemEnvironment(continued)TCG-CSU1.76DatabaseSystemsComponentsofaDBMSTCG-CSU1.77DatabaseSystemsComponentsofDa
tabaseManager(DM)TCG-CSU1.78DatabaseSystemsMulti-UserDBMSArchitecturesTeleprocessingFile-serverClient-serverTCG-CSU1.79DatabaseSystemsTeleprocess
ingTraditionalarchitecture.Singlemainframewithanumberofterminalsattached.Trendisnowtowardsdownsizing.TCG-CSU1.80DatabaseSystemsTelepr
ocessingTopologyTCG-CSU1.81DatabaseSystemsFile-ServerFile-serverisconnectedtoseveralworkstationsacrossanetwork.
Databaseresidesonfile-server.DBMSandapplicationsrunoneachworkstation.Disadvantagesinclude:Significantnetworktraffic.CopyofDB
MSoneachworkstation.Concurrency,recoveryandintegritycontrolmorecomplex.TCG-CSU1.82DatabaseSystemsFile-Se
rverArchitectureTCG-CSU1.83DatabaseSystemsClient-ServerServerholdsthedatabaseandtheDBMS.Clientmanagesuserinterfacea
ndrunsapplications.Advantagesinclude:wideraccesstoexistingdatabases;increasedperformance;possiblereductioninhardwarecosts;reductionincom
municationcosts;increasedconsistency.TCG-CSU1.84DatabaseSystemsClient-ServerArchitectureTCG-CSU1.85DatabaseSystemsAlternativeClient-ServerTopo
logiesTCG-CSU1.86DatabaseSystemsHistoryofDatabaseSystems1950sandearly1960s:DataprocessingusingmagnetictapesforstorageTape
sprovideonlysequentialaccessPunchedcardsforinputLate1960sand1970s:HarddisksallowdirectaccesstodataHierarchi
cal(IMS)andNetwork(IDS、DBTG)datamodelsinwidespreaduse(1G)TedCodddefinestherelationaldatamodelWouldwintheACMTuringAwardforthisworkIBMResearchbeg
insSystemRprototypeUCBerkeleybeginsIngresprototypeHigh-performance(fortheera)transactionprocessingT
CG-CSU1.87DatabaseSystemsHistory(cont.)1980s:Researchrelationalprototypesevolveintocommercialsystems(2G)SQLbecomesindustri
alstandardParallelanddistributeddatabasesystemsObject-orienteddatabasesystems(3G)1990s:Largedecisionsupportanddata-miningapplicationsLargemulti-
terabytedatawarehousesEmergenceofWebcommerce2000s:XMLandXQuerystandardsAutomateddatabaseadministrationEndofChapter1TCG-CSU1.89DatabaseSyst
emsFigure1.4TCG-CSU1.90DatabaseSystemsFigure1.7TCG-CSU1.91DatabaseSystemsDatabase(con’t)人们收集并抽取出一个应用所需要的大量数据之后,应将其保存起来以供进一步加工处理,进一步抽取有用信息Def.ofDBA
nintegratedcollectionofrelateddataconstitutesaDatabase(DB).是长期储存在计算机内、有组织的、可共享的大量数据集合TCG-CSU1.92DatabaseSystems二、数据库(续)数据库的特征数据按一定的数据模型组织、描述和储存
可为各种用户共享冗余度较小数据独立性较高易扩展TCG-CSU1.93DatabaseSystems三、数据库管理系统DBMSAcollectionofprogramsthatcontrolsadatabase.Specifically,itprovidesu
swithaninterfacetocreate,maintain,andmanipulatemultipledatabases.Forgeneral-purpose,是位于用户与操作系统之间的一层数据管理软件。DBMS的用途科学地组织和存储数据、高效
地获取和维护数据TCG-CSU1.94DatabaseSystemsDBMS的主要功能数据定义功能提供数据定义语言(DDL)定义数据库中的数据对象数据操纵功能:提供数据操纵语言(DML)操纵数据实现对数据库的基本操作(查询、插入、删除和修改
)TCG-CSU1.95DatabaseSystemsDBMS的主要功能数据库的运行管理保证数据的安全性、完整性、多用户对数据的并发使用发生故障后的系统恢复数据库的建立和维护功能(实用程序)数据库数据批量装载数据库转储介质故障恢复数据库的
重组织性能监视等TCG-CSU1.96DatabaseSystems四、数据库系统DatabaseSystem:Bedevelopedtosupporttheoperationsofaspecificor
ganizationoraspecificsetofapplications.Consistsof1)anapplicationspecificdatabase,2)theDBMSthatmaintains
thatdatabase,and3)theapplicationsoftwarethatmanipulatesthedatabase.(数据库系统(,简称DBS)是指在计算机系统中引入数据库后的系统构成。在不引起混淆的情况下常常把数据库系统简称为数据库。)数据库系统的构成
由数据库、数据库管理系统(及其开发工具)、应用系统、数据库管理员(和用户)构成。TCG-CSU1.97DatabaseSystemsInstructor:谭长庚.(cgtan163)Textbook:Database–systemconcepts(5
thed.)bySilberschatz,Korth,Sudarshan,2005FundamentalsofDatabaseSystems(4thed.)byElmasri&Navathe,2019Lecturestime:Tue.Am8:00-
9:40,15:55-17:30,location:CA-502,CB-402time:Fir.Am8:00-9:40,10:00-11:40location:CB-402Gradingfinal(70
%),others(30%),6(1per2~3weeks)homework1programminghwatmost!