【文档说明】数据库原理课件第一章.ppt,共(97)页,1.624 MB,由小橙橙上传
转载请保留链接:https://www.ichengzhen.cn/view-92515.html
以下为本文档部分文字说明:
DatabaseSystem-SSD7Spring,2012TanChang-gengSchoolofSoftware,CentralSouthUniversityTCG-CSU1.2DatabaseSystemsReferencesCMUSS
D7E-resourceDatabasesystemconcepts(5thed.)bySilberschatz,Korth,Sudarshan,2005,HigherEducationPress.ISBN7-04-019245-4数据库系统概念(上
书中译本),原著:Silberschatz,杨冬青译,机械工业出版社,ISBN7-111-19687-2DatabaseSystems–ApracticalApproachtoDesign,Implementation,andManagement(ThomasConnolly,C
arolynBegg,PersonEducationInc.),ISBN7-5053-8784-7Instructor:TanChanggeng.Email:cgtan163QQ:327414529Offerin
gWorld-LeadingCurriculuminComputerProgramming&SoftwareSystemsDevelopment(SSD)TCG-CSU1.4DatabaseSystemsTwoCertificatesCertificateinCom
puterProgrammingCourses1through5CertificateinSoftwareSystemsDevelopmentCourses1through10SSDCurriculumOverviewTCG-CSU1.5DatabaseS
ystemsiCarnegieCurriculum1-5=CertificateinComputerProgramming1-10=CertificateinSoftwareSystemsDevelopment1:IntroductiontoInformat
ionSystems2:IntroductiontoComputerSystems3:ObjectOrientedProgrammingandDesign5:DataStructuresandAlgorithms6:SystemLevelProgramming10:SoftwarePr
ojectOrganizationandManagement9:SoftwareSpecification,TestandMaintenance8:NetworksandDistributedComputing4:UserCenteredDesignandTesting7:Datab
aseSystemsTCG-CSU1.6DatabaseSystemsWhatdoesiCarnegiedo?10CourseSequenceRootedintheexpertiseofCarnegieMell
onUniversity‘sSchoolofComputerScienceApplied,industry-orientedskillsSoftwareDevelopmentDisciplineSoftwareDevelopment!=ComputerScience
CStrainsscientists/researchersFocusonTheoryHigherMathematicsSoftwareDevelopersarenotresearchersApplied,industryorientedskillsF
ocusonfoundationalskillsTCG-CSU1.7DatabaseSystemsThepurposeofSSD7isforstudentstoBecomefamiliarwithfundamentalDBMSconceptsandwhatadatabasesystemis
LearntouseSQL(structuredquerylanguage)LearntodesigndatabasesystemsLearntodesignandmanagetransaction(事务)LearntoimprovequeryperformanceGa
inexposuretofuturetrendsindatabasesTCG-CSU1.8DatabaseSystemsStudentssuccessfullycompletingSSD7willbeabletoPRODUCE(cont
’d)DatabasedesignsthatsupportagivenapplicationDatamodelsusingE-RdiagramsSoundschemadesignsusingnormalization(使用规范化方法设计出合理的模式)Web-based
databaseapplicationsusingSQLandJSP/ServletsTCG-CSU1.9DatabaseSystemsStudentssuccessfullycompletingSSD7willbeabletoUSE
IndexstructuresofaDBMStoimproveperformanceThetransactionfeaturesofaDBMStoachievefaultrecovery(故障恢复)andconcurrencycontrol(并发控制)Keyrelational
operationstomanipulatedata(操纵数据)SQLDDLtomodeldata,constraints,andviews(视图)SQLDMLtowritecomplexqueriesT
CG-CSU1.10DatabaseSystemsStudentswillbeabletoknowledgeablyDISCUSSThebasicconceptsofobject-relationalandobject-orienteddatabasem
anagementsystemsThebasicconceptsandapplicationofdatawarehousinganddatamining(datacubes,OLAP)Thebasicfunctionsandapplicationofmultimediadata
basesThebasicissuesofdatabaseprivacyandsecurityTheDBMSofferingsofthemostimportantvendorsTCG-CSU1.11DatabaseSystemsDatabaseProgDistributedSysOSUIDat
aStruct&Algorithms数据库的地位TCG-CSU1.12DatabaseSystemsTopicsShallbeLearnedIntroductionRelationalModelS
QLEntity-RelationshipModelRelational-DatabaseDesignTransactionsConcurrencyControlRecoverySystem(Integrity
andSecurity)DatabaseSystemArchitectures……TCG-CSU1.13DatabaseSystemsChapter1:IntroductionPurposeofDatabaseSyst
emsViewofDataDatabaseLanguagesRelationalDatabasesDatabaseDesignObject-basedandsemistructureddatabasesDataStorageandQueryingTransactio
nManagementDatabaseArchitectureDatabaseUsersandAdministratorsOverallStructureHistoryofDatabaseSystemsTCG-CSU1.14DatabaseSyste
ms1.1DatabaseManagementSystem(DBMS)DBMScontainsinformationaboutaparticularenterpriseCollectionofinterrelateddataSetofpro
gramstoaccessthedataAnenvironmentthatisbothconvenientandefficienttouseDatabaseApplications?Banking:alltransactionsAirlines:
reservations,schedulesUniversities:registration,gradesSales:customers,products,purchasesOnlineretailers:ordertracking
,customizedrecommendationsManufacturing:production,inventory,orders,supplychainHumanresources:employeereco
rds,salaries,taxdeductionsDatabasestouchallaspectsofourlivesTCG-CSU1.15DatabaseSystemsTheExamplesofDatabase
SystemsPurchasesusingyourcreditcard信用卡AcreditcarddatabaseThecheckoutassistantAcreditcardreaderCheckyourcreditAddthepu
rchasestodatabaseMonthlystatementstoeachcardholderTCG-CSU1.16DatabaseSystems1.2PurposeofDatabaseSystemsIntheearlydays,da
tabaseapplicationswerebuiltdirectlyontopoffilesystemsDrawbacksofusingfilesystemstostoredata?TCG-CSU1.17DatabaseSystems
LimitationsoftheFile-BasedApproachDataredundancyandinconsistency数据冗余与非一致性Multiplefileformats,duplicationofinformationindiff
erentfiles文件格式不相容,数据冗余Program-datadependence程序依赖于数据NeedtowriteanewprogramtocarryouteachnewtaskDataisolation—mul
tiplefilesandformats数据孤立;文件格式不相容Integrityproblems完整性问题Integrityconstraints(e.g.accountbalance>0)become―buried‖inprogramcoderatherthanb
eingstatedexplicitlyHardtoaddnewconstraintsorchangeexistingonesTraditionalFile-BasedSystems文件系统TCG-CSU1.18DatabaseSystemsDrawbacksofus
ingfilesystems(cont.)Atomicityofupdates原子更新Failuresmayleavedatabaseinaninconsistentstatewithpartialupdatescarri
edoutExample:TransferoffundsfromoneaccounttoanothershouldeithercompleteornothappenatallConcurrentaccessbym
ultipleusers并发访问ConcurrentaccessedneededforperformanceUncontrolledconcurrentaccessescanleadtoinconsistencie
s–Example:Twopeoplereadingabalanceandupdatingitatthesametime(sellticket)SecurityproblemsHardtoprovideuseraccess
tosome,butnotall,dataDatabasesystemsoffersolutionstoalltheaboveproblemsTCG-CSU1.19DatabaseSystemsCharacteristicsoft
heDatabaseApproach数据库方法Data:dataarerawfactsthatdescribepeople,objects,andeventsDatabase:Anintegratedcollectionofrelatedd
ataconstitutesaDatabase(DB).相关数据集成relateddata,thedatarepresentslogicallycoherentfactsaboutsomeaspectsoftherealworldthatarerequiredbyanapplic
ation.Integrated,thedataformultipleapplicationsisstoredtogetherandmanipulatedinauniformwayonasecondarystoragesuchasamagneticor
anopticaldisk.TCG-CSU1.20DatabaseSystemsDatabaseManagementSystemsADatabaseManagementSystem(DBMS)isacollectionofprogramst
hatcontrolsadatabase.General-purposesoftwaresystemDataDefinitionLanguage(DDL)DataManipulationLanguage(DML)Contro
lledaccesstothedatabaseasecuritysystem(authorizedusers)安全性anintegritysystem(consistencyofstoreddata)完整性aconcurrencycontrolsystem(shareda
ccess)并发控制arecoverycontrolsystem(whenH/Sfailure)恢复auser-accessiblecatalog(descriptionsofdata)数据字典TCG-CSU1.21DatabaseSystems
DatabaseSystemaDatabaseSystemconsistsofanapplicationspecificdatabase数据库theDBMSthatmaintainsthatdatabaseDBMStheapplications
oftwarethatmanipulatesthedatabase应用程序数据库系统的个体含义是指一个具体的数据库管理系统软件和用它建立起来的数据库;它的学科含义是指研究、开发、建立、维护和应用数据库系统所涉及的理论、方法、技术所构成的学科。在这一含义下,数据
库系统是软件研究领域的一个重要分支,常称为数据库领域。TCG-CSU1.22DatabaseSystemsTCG-CSU1.23DatabaseSystemsCharacteristicsoftheDatabaseApproachDBMSsembodyt
hethreedistinguishingcharacteristicsofthedatabaseapproach:dataabstraction,reliability,andefficiency.数据抽象可靠性高效TCG-CSU1.24DatabaseSystemsCharacte
risticsoftheDatabaseApproach2DataAbstractionprovideuserswithhigh-level,conceptualrepresentationsofthedata—atableinrelationalDBMSs提供高层、概念的数据表示hides
toragedetailsthatarenotofinteresttomostdatabaseusers隐藏存储细节program-dataindependence数据独立性TCG-CSU1.25DatabaseSy
stemsCharacteristicsoftheDatabaseApproach3Reliability.DBMSsprovidehighreliabilityEnforcingintegrit
yconstraints完整性约束Integrityconstraintsreflectthemeaning(or,thesemantics)ofthedataandoftheapplicationEnsuringdataconsistencydespitehardwareorsoftwar
efailures.数据一致性TansactionsWithinanapplicationprogram,oneormorequery-and-updaterequeststotheDBMScanbelogicallygroupedtogetherinord
ertoperformatask.Agroupofsuchrequestsiscalledatransaction.事务Examples:acustomerpayswithacreditcard,withdrawmoneyfromATMTCG-CSU1.26DatabaseSystems
CharacteristicsoftheDatabaseApproach4Efficiency:DBMSssupportbothefficientspaceutilizationandefficientaccesstodata.
Storingeachdataitemonlyonce减少冗余Enhancingtheperformanceofqueriesbymeansofoptimizationsandtheuseofacces
smethodstodatabasedontheirvalues查询优化Decreasingresponsetimeoftransactionsbyallowingmultipleuserstoaccessthedatabasec
oncurrently并发提高效率TCG-CSU1.27DatabaseSystemsContrastingDatabaseandFileSystemsTCG-CSU1.28DatabaseSystemsFile1File
2FilenProg1Prog2PrognFileSystemTCG-CSU1.29DatabaseSystemsDatabaseProg1Prog2PrognDBMSTCG-CSU1.30DatabaseSystems人工管理文件系统数据库系统应用背景科学
计算科学计算、管理大规模管理硬件背景无直接存取存储设备磁盘、磁鼓大容量磁盘软件背景没有操作系统有文件系统有数据库管理系统背景处理方式批处理联机实时处理批处理联机实时处理,分布处理批处理数据的管理者人文件系统数据库管理系统数据面向的对象某一应用程序某一应用程序整个应用
系统数据的共享程度无共享,冗余度极大共享性差,冗余度大共享性高,冗余度小数据的独立性不独立,完全依赖于程序独立性差具有高度的物理独立性和逻辑独立性数据的结构化无结构记录内有结构,整体无结构整体结构化,用数据模型描述特点数据控制能力应用程序自己控制应用程序自己
控制由数据库管理系统提供数据安全性、完整性、并发控制和恢复能力Comparethedifferentphasesofdatamanagement(Table1)TCG-CSU1.31DatabaseSystemsWhenIsaDatabaseManagementSystemNeede
d?Advantages1ControlofdataredundancyDataconsistencyMoreinformationfromthesameamountofdataSharingofdataImproveddataintegrityImprovedsecurity
EnforcementofstandardsEconomyofscaleTCG-CSU1.32DatabaseSystemsAdvantages2Balanceofconflictingrequireme
ntsImproveddataaccessibilityandresponsivenessIncreasedproductivityImprovedmaintenancethroughdataindependenceIncreas
edconcurrencyImprovedbackupandrecoveryservicesTCG-CSU1.33DatabaseSystemsDisadvantagesComplexitySizeCostofDBMSsAdditionalhardwarec
ostsCostofconversionPerformanceHigherimpactofafailureTCG-CSU1.34DatabaseSystemsWhenIsaDatabaseManagementSystemNotNeeded?Thedatahasasimp
lestructureanditssizeissmall.Theapplication,althoughsimpleandunchanging,hasaspecialpurpose.Concurrentaccesstodata
bymultipleusersisnotrequired.TCG-CSU1.35DatabaseSystemsFourConceptsDataDatabaseDBMS(DatabaseManagementSystems)DB
S(DatabaseSystems)TCG-CSU1.36DatabaseSystemsDatabaseSystemsConceptsData(数据):Dataarerawfactsthatdescribepe
ople,objects,andevents.Or数据实际上就是描述事物的符号记录。例如:文字、图形、图象、声音、学生的档案记录等。数据的形式本身并不能完全表达其内容,需要经过语义解释。数据与其语义是不可分的。Informatio
n(信息):一般把信息理解为关于现实世界事物存在方式或运动状态的反映.TCG-CSU1.37DatabaseSystemsDifferencebetweenDataandInformation数据是信息的符号表示
或称为载体;信息则是数据的内涵,是对数据语义的解释;数据表示了信息,而信息只有通过数据形式才能被计算机理解和接受。TCG-CSU1.38DatabaseSystemsDatabaseAninteg
ratedcollectionofrelateddataconstitutesaDatabase(DB).KeepdatalongtimeLargequantitiesofdataLogicallyr
elatedStructureddataShareTCG-CSU1.39DatabaseSystemsDatabaseManagementSystems(DBMS)ADatabaseManagementSystem(DBMS)isacollectionofprogramsthatcontr
olsadatabase.`Itenablesuserstodefine,create,maintain,andcontrolaccesstothedatabase.Wecanuseitnotonlytocreateandmaintainmultipledatabasesbutalsot
oimplementdatabasesystemsfordifferentapplications.TCG-CSU1.40DatabaseSystemsDatabaseSystemsAdatabasesy
stemisdevelopedtosupporttheoperationsofaspecificorganizationoraspecificsetofapplications.aDatabaseSystemconsistsof1)Anapplicationspecific
database2)TheDBMSthatmaintainsthatdatabase3)TheapplicationsoftwarethatmanipulatesthedatabaseThefigure1-4illustratesasimplif
ieddatabase-systemarchitectureTCG-CSU1.41DatabaseSystemsFigure1-4database-systemarchitectureTCG-CSU1.42DatabaseSystemsRolesintheDa
tabaseEnvironmentDataandDatabaseAdministrators(DAandDBA)DatabaseDesignersLogicalDatabaseDesignersPhysicalDatabaseDe
signersApplicationDevelopersEnd-UsersNaïveusersSophisticatedusersTCG-CSU1.43DatabaseSystems1.3DatabaseArchitectureThearchitectureofadatab
asesystemsisgreatlyinfluencedbytheunderlyingcomputersystemonwhichthedatabaseisrunning:CentralizedClient-server
Parallel(multi-processor)DistributedTCG-CSU1.44DatabaseSystems1.4DatabaseUsersUsersaredifferentiatedb
ythewaytheyexpecttointeractwiththesystemApplicationprogrammers–interactwithsystemthroughDMLcallsSophisticatedusers–formrequestsin
adatabasequerylanguageSpecializedusers–writespecializeddatabaseapplicationsthatdonotfitintothetradit
ionaldataprocessingframeworkNaïveusers–invokeoneofthepermanentapplicationprogramsthathavebeenwrittenpreviouslyExamples,pe
opleaccessingdatabaseovertheweb,banktellers,clericalstaffTCG-CSU1.45DatabaseSystems1.5DatabaseAdministratorCoordinatesalltheactivitiesofthedat
abasesystem;thedatabaseadministratorhasagoodunderstandingoftheenterprise‘sinformationresourcesandneeds.Databaseadministrator'sduti
esinclude:Schemadefinition模式定义StoragestructureandaccessmethoddefinitionSchemaandphysicalorganizat
ionmodificationGrantinguserauthoritytoaccessthedatabaseSpecifyingintegrityconstraintsActingasliaisonwithusersMonitoringperformanceandrespond
ingtochangesinrequirementsTCG-CSU1.46DatabaseSystemsOverallSystemStructureTCG-CSU1.47DatabaseSystems1.6Three-LevelArchitectureDBAshouldbeablet
ochangedatabasestoragestructureswithoutaffectingtheusers’views.Internalstructureofdatabaseshouldbeunaffectedbychanges
tophysicalaspectsofstorage.DBAshouldbeabletochangeconceptualstructureofdatabasewithoutaffectingallusers.Objectives:TCG-CSU1.48Datab
aseSystemsANSI-SPARCThree-LevelArchitectureTCG-CSU1.49DatabaseSystemsANSI-SPARCThree-LevelArchitectureExternalLevel
外部层Users’viewofthedatabase.用户视图Describesthatpartofdatabasethatisrelevanttoaparticularuser.ConceptualLevel概念层Communityviewoft
hedatabase.总体视图Describeswhatdataisstoredindatabaseandrelationshipsamongthedata.InternalLevel内部层Physicalrepresentation
ofthedatabaseonthecomputer.Describeshowthedataisstoredinthedatabase.TCG-CSU1.50DatabaseSystemsDifferencesbetweenThreeLevelsofANSI-SPARC
ArchitectureTCG-CSU1.51DatabaseSystems1.6.1DataIndependence数据依赖LogicalDataIndependenceReferstoimmu
nityofexternalschemastochangesinconceptualschema.概念模式变化不会影响外模式Conceptualschemachanges(e.g.addition/removalofentities).Shouldno
trequirechangestoexternalschemaorrewritesofapplicationprograms.PhysicalDataIndependenceReferstoimmunityofconceptualschematoch
angesintheinternalschema.Internalschemachanges(e.g.usingdifferentfileorganizations,storagestructures/devices).S
houldnotrequirechangetoconceptualorexternalschemas.TCG-CSU1.52DatabaseSystemsDataIndependenceandtheANSI-SPARCTh
ree-LevelArchitectureTCG-CSU1.53DatabaseSystemsViewofDataAnarchitectureforadatabasesystemTCG-CSU1.54DatabaseSystems现
实世界Conceptualmodel转换internalmodelabstractView1View2abstractFigure1-5threedatamodelsTCG-CSU1.55DatabaseSystemsLevelsofAb
stractionPhysicallevel:describeshowarecord(e.g.,customer)isstored.typecustomer=recordcustomer_id:st
ring;customer_name:string;customer_street:string;customer_city:integer;end;Logicallevel:describesdatastoredi
ndatabase,andtherelationshipsamongthedata.Viewlevel:applicationprogramshidedetailsofdatatypes.Viewscanalsohideinformation(suchasanemployee‘ss
alary)forsecuritypurposes.TCG-CSU1.56DatabaseSystemsInstancesandSchemasSimilartovariablesandtypesinprogramminglang
uagesSchema–thelogicalstructureofthedatabaseExample:Thedatabaseconsistsofinformationaboutasetofcustomersandaccountsandther
elationshipbetweenthem)AnalogoustotypeinformationofavariableinaprogramPhysicalschema:databasedesigna
tthephysicallevelLogicalschema:databasedesignatthelogicallevelInstance–theactualcontentofthedatabaseataparticularp
ointintimeAnalogoustothevalueofavariableTCG-CSU1.57DatabaseSystemsInstancesandSchemasPhysicalDataInde
pendence–theabilitytomodifythephysicalschemawithoutchangingthelogicalschemaApplicationsdependonthelogicalschemaIngen
eral,theinterfacesbetweenthevariouslevelsandcomponentsshouldbewelldefinedsothatchangesinsomepartsdonotseriouslyinflue
nceothers.TCG-CSU1.58DatabaseSystems1.7DataModelsAcollectionoftoolsfordescribingDataDatarelationshipsDatasemanticsDataco
nstraints描述数据、数据间联系、数据语义以及约束的概念工具的集合Adatamodelcanbethoughtofascomprisingthreecomponents:数据模型由三部分组成:DatastructureDatamanipulationConstraintsofdata
integrityTCG-CSU1.59DatabaseSystemsDataModelsDataModel:Relationalmodel(Table)Entity-Relationshipdatamodel(m
ainlyfordatabasedesign)Object-baseddatamodels(Object-orientedandObject-relational)Semistructureddatamodel(XML)
Otheroldermodels:NetworkmodelHierarchicalmodelTCG-CSU1.60DatabaseSystems1.8DataManipulationLanguage(DM
L)LanguageforaccessingandmanipulatingthedataorganizedbytheappropriatedatamodelDMLalsoknownasquerylanguageTwoclassesoflanguagesProce
dural过程式–userspecifieswhatdataisrequiredandhowtogetthosedataDeclarative声明式(nonprocedural)–userspecifieswhatdataisrequiredwithoutspecify
inghowtogetthosedataSQListhemostwidelyusedquerylanguageTCG-CSU1.61DatabaseSystemsDataDefinitionLanguage(DDL)Specificationnotationfordefining
thedatabaseschemaExample:createtableaccount(account-numberchar(10),balanceinteger)DDLcompilergeneratesasetoftablesstor
edinadatadictionaryDatadictionarycontainsmetadata(i.e.,dataaboutdata)DatabaseschemaDatastorageanddefinition
languageSpecifiesthestoragestructureandaccessmethodsusedIntegrityconstraintsDomainconstraintsReferentialintegrity(referencesconstraintinSQL
)AssertionsAuthorizationTCG-CSU1.62DatabaseSystemsRelationalModelExampleoftabulardataintherelationalmodelAttributesTCG-CSU1.63DatabaseSystems
ASampleRelationalDatabaseTCG-CSU1.64DatabaseSystems1.9SQLSQL:widelyusednon-procedurallanguageExample:Findthename
ofthecustomerwithcustomer-id192-83-7465selectcustomer.customer_namefromcustomerwherecustomer.customer_id=‗192-83-7465‘Examp
le:Findthebalancesofallaccountsheldbythecustomerwithcustomer-id192-83-7465selectaccount.balancefromdepositor,accountwheredep
ositor.customer_id=‗192-83-7465‘anddepositor.account_number=account.account_numberTCG-CSU1.65DatabaseSystemsApplication
programsgenerallyaccessdatabasesthroughoneofLanguageextensionstoallowembeddedSQLApplicationprograminterface(e.g.,ODBC/JDBC)whichallowSQLque
riestobesenttoadatabaseTCG-CSU1.66DatabaseSystems1.10DatabaseDesignTheprocessofdesigningthegeneralstructureofthedatabase:Logical
Design–Decidingonthedatabaseschema(acollectionofrelationschemas).Databasedesignrequiresthatwefinda“good”collectionofrelationsche
mas.Businessdecision–Whatattributesshouldwerecordinthedatabase?ComputerSciencedecision–Whatrelationschemasshouldwehaveandhowshouldtheattributesbed
istributedamongthevariousrelationschemas?PhysicalDesign–DecidingonthephysicallayoutofthedatabaseTCG-CSU1.67Databas
eSystemsTheEntity-RelationshipModelModelsanenterpriseasacollectionofentitiesandrelationships一单位建模为实体与联系的集合Entity:
a―thing‖or―object‖intheenterprisethatisdistinguishablefromotherobjectsDescribedbyasetofattributesRelationship:anassociationamongseveralentitiesRe
presenteddiagrammaticallybyanentity-relationshipdiagram:TCG-CSU1.68DatabaseSystemsObject-RelationalDataModelsExtendtherelationaldatamodelbyincl
udingobjectorientationandconstructstodealwithaddeddatatypes.Allowattributesoftuplestohavecomplextypes,includingnon-atomicvaluessuchasnestedrelations
.Preserverelationalfoundations,inparticularthedeclarativeaccesstodata,whileextendingmodelingpower.Provideupwardcompatibilitywithexi
stingrelationallanguages.TCG-CSU1.69DatabaseSystemsXML:ExtensibleMarkupLanguageDefinedbytheWWWConsortium(W3C)Originallyintendedasadocumentmarkupl
anguagenotadatabaselanguageTheabilitytospecifynewtags,andtocreatenestedtagstructuresmadeXMLagreatwaytoexchangedata,no
tjustdocumentsXMLhasbecomethebasisforallnewgenerationdatainterchangeformats.Awidevarietyoftoolsisavaila
bleforparsing,browsingandqueryingXMLdocuments/dataTCG-CSU1.70DatabaseSystems1.11StorageManagementStoragemanagerisaprogrammodulethatprovidest
heinterfacebetweenthelow-leveldatastoredinthedatabaseandtheapplicationprogramsandqueriessubmittedtothesystem.Thestoragemanagerisresponsibletothefol
lowingtasks:InteractionwiththefilemanagerEfficientstoring,retrievingandupdatingofdataIssues:StorageaccessFileo
rganizationIndexingandhashingTCG-CSU1.71DatabaseSystems1.12QueryProcessing1.Parsingandtranslation语法分析与转换
2.Optimization优化3.Evaluation评价TCG-CSU1.72DatabaseSystemsQueryProcessing(Cont.)Alternativewaysofevaluatinga
givenqueryEquivalentexpressionsDifferentalgorithmsforeachoperationCostdifferencebetweenagoodandabadwayofev
aluatingaquerycanbeenormousNeedtoestimatethecostofoperationsDependscriticallyonstatisticalinformationaboutrelationswhichthedatabasemus
tmaintainNeedtoestimatestatisticsforintermediateresultstocomputecostofcomplexexpressionsTCG-CSU1.73DatabaseSystems1.12TransactionManagementAtransa
ctionisacollectionofoperationsthatperformsasinglelogicalfunctioninadatabaseapplicationWithinanapplicationprogram,oneormo
requery-and-updaterequeststotheDBMScanbelogicallygroupedtogetherinordertoperformatask.Agroupofsuchrequest
siscalledatransaction.Examples:acustomerpayswithacreditcard,withdrawmoneyfromATMTransaction-managementcomponentensurestha
tthedatabaseremainsinaconsistent(correct)statedespitesystemfailures(e.g.,powerfailuresandoperatingsystemcrashes
)andtransactionfailures.Concurrency-controlmanagercontrolstheinteractionamongtheconcurrenttransactions,toensuret
heconsistencyofthedatabase.TCG-CSU1.74DatabaseSystemsTheDatabaseSystemEnvironmentDatabasesystemiscomposedof5mainparts:1.Hardware2.SoftwareOpera
tingsystemsoftwareDBMSsoftwareApplicationprogramsandutilitysoftware3.People4.Procedures5.DataTCG-CSU1.75DatabaseSystemsTheDa
tabaseSystemEnvironment(continued)TCG-CSU1.76DatabaseSystemsComponentsofaDBMSTCG-CSU1.77DatabaseSystemsCo
mponentsofDatabaseManager(DM)TCG-CSU1.78DatabaseSystemsMulti-UserDBMSArchitecturesTeleprocessingFile-serverClient-serverTCG-CSU1.79Da
tabaseSystemsTeleprocessingTraditionalarchitecture.Singlemainframewithanumberofterminalsattached.Trendisnowtowardsdownsizing.TCG-CSU1.80D
atabaseSystemsTeleprocessingTopologyTCG-CSU1.81DatabaseSystemsFile-ServerFile-serverisconnectedtoseveralworkstationsacrossanetwork.Databa
seresidesonfile-server.DBMSandapplicationsrunoneachworkstation.Disadvantagesinclude:Significantnetworktraffic.CopyofDBMSoneachworkstation.
Concurrency,recoveryandintegritycontrolmorecomplex.TCG-CSU1.82DatabaseSystemsFile-ServerArchitectureTCG-CSU1.83DatabaseSystemsClien
t-ServerServerholdsthedatabaseandtheDBMS.Clientmanagesuserinterfaceandrunsapplications.Advantagesinclude:wideraccesstoexistingdatabases;in
creasedperformance;possiblereductioninhardwarecosts;reductionincommunicationcosts;increasedconsistency.TCG-CSU1.84DatabaseSystems
Client-ServerArchitectureTCG-CSU1.85DatabaseSystemsAlternativeClient-ServerTopologiesTCG-CSU1.86DatabaseSys
temsHistoryofDatabaseSystems1950sandearly1960s:DataprocessingusingmagnetictapesforstorageTapesprovideonlysequentialaccessPu
nchedcardsforinputLate1960sand1970s:HarddisksallowdirectaccesstodataHierarchical(IMS)andNetwork(IDS、DBTG)datamodelsinwidesprea
duse(1G)TedCodddefinestherelationaldatamodelWouldwintheACMTuringAwardforthisworkIBMResearchbeginsSystemRprototypeUCBerkeleybeginsIngre
sprototypeHigh-performance(fortheera)transactionprocessingTCG-CSU1.87DatabaseSystemsHistory(cont.)1980s:Resear
chrelationalprototypesevolveintocommercialsystems(2G)SQLbecomesindustrialstandardParallelanddistributeddatabasesystemsObject-orienteddatabasesyste
ms(3G)1990s:Largedecisionsupportanddata-miningapplicationsLargemulti-terabytedatawarehousesEmergenceof
Webcommerce2000s:XMLandXQuerystandardsAutomateddatabaseadministrationEndofChapter1TCG-CSU1.89DatabaseSystemsFigure1.4TCG-CSU1.90DatabaseSystems
Figure1.7TCG-CSU1.91DatabaseSystemsDatabase(con’t)人们收集并抽取出一个应用所需要的大量数据之后,应将其保存起来以供进一步加工处理,进一步抽取有用信息Def.ofDBAninteg
ratedcollectionofrelateddataconstitutesaDatabase(DB).是长期储存在计算机内、有组织的、可共享的大量数据集合TCG-CSU1.92DatabaseSystems二、数据库(续)数据库的特征数据按一
定的数据模型组织、描述和储存可为各种用户共享冗余度较小数据独立性较高易扩展TCG-CSU1.93DatabaseSystems三、数据库管理系统DBMSAcollectionofprogramsthatcontrolsadatabase.Specifically,
itprovidesuswithaninterfacetocreate,maintain,andmanipulatemultipledatabases.Forgeneral-purpose,是位于用户与操作系统之间的一层数据管理软件。DBMS的用途
科学地组织和存储数据、高效地获取和维护数据TCG-CSU1.94DatabaseSystemsDBMS的主要功能数据定义功能提供数据定义语言(DDL)定义数据库中的数据对象数据操纵功能:提供数据操纵语言(DML)操纵数据实现对数据库的基本操作(查询、插入、删除和修改
)TCG-CSU1.95DatabaseSystemsDBMS的主要功能数据库的运行管理保证数据的安全性、完整性、多用户对数据的并发使用发生故障后的系统恢复数据库的建立和维护功能(实用程序)数据库数据批量装载数据库转储介质故障恢复数据库的重组织性能监视等TCG-CSU1.96Database
Systems四、数据库系统DatabaseSystem:Bedevelopedtosupporttheoperationsofaspecificorganizationoraspecificsetofapplications.Consistsof1
)anapplicationspecificdatabase,2)theDBMSthatmaintainsthatdatabase,and3)theapplicationsoftwarethatmanipulatesthedatabase.(数据库系统(,简称DBS)是指在计算机系统中
引入数据库后的系统构成。在不引起混淆的情况下常常把数据库系统简称为数据库。)数据库系统的构成由数据库、数据库管理系统(及其开发工具)、应用系统、数据库管理员(和用户)构成。TCG-CSU1.97DatabaseSystemsInstruc
tor:谭长庚.(cgtan163)Textbook:Database–systemconcepts(5thed.)bySilberschatz,Korth,Sudarshan,2005Fundamentalsof
DatabaseSystems(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:40loc
ation:CB-402Gradingfinal(70%),others(30%),6(1per2~3weeks)homework1programminghwatmost!