ERwin使用说明(中英文)_第1页
ERwin使用说明(中英文)_第2页
ERwin使用说明(中英文)_第3页
ERwin使用说明(中英文)_第4页
ERwin使用说明(中英文)_第5页
已阅读5页,还剩18页未读 继续免费阅读

下载本文档

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

文档简介

经典word整理文档,仅参考,转Word此处可删除页眉页脚。本资料属于网络整理,如有侵权,请联系删除,谢谢!GettingStartedwithER(Erwinwin入门)byDr.PeterWolcottDepartmentofInformationSystemsandQuantitativeAnalysisCollegeofInformationScienceandTechnologyUniversityofNebraskaatOmaha(由内布拉斯加州的奥马哈大学信息科学与技术学院门的信息系统和定量分析博士彼得著)Introduction(介绍)ERwinisapopulardatamodelingtoolusedbyanumberofmajorcompaniesinOmahaandthroughouttheworld.(Erwin是受奥马哈和世界各地的一些主要的公司欢迎的数据模型工具)Theproductiscurrentlyowned,developed,andmarketedbyComputer,aleadingsoftwaredeveloper.(该产品是由具有领导地位的CA软件开发公司拥有、开发和销售)Theproductsupportsavarietyofaspectsofdatabasedesign,includingdatamodeling,forwardengineering(thecreationofadatabaseschemaandphysicaldatabaseonthebasisofadatamodel),andreverseengineering(thecreationofadatamodelonthebasisofanexistingdatabase)forawidevarietyofrelationalDBMS,includingMicrosoftAccess,Oracle,DB2,Sybase,andothers.该软件为多种多样的关系型数据库管理系统,包括MicrosoftAccess,甲骨文,Sybase,DB2,和其他人提供支持数据库设计的各个方数据库)和逆向工程(在现在的数据库基础上创建数据模型)ThisbrieftutorialstepsyouthroughtheprocessofcreatingadatamodelwinusingER.(你可以通过这个简单教程中的步骤运用Erwin来创建数据模型)ItwillnotexplainallaspectsofERwin,butwillshowyoutheminimumnecessarytocreateandusedatamodelsforthisclass.(这个课程不可能全面地讲解Erwin模型的知识)Itconsistsofthreemajorsegments,whichcorrespondtotheproject-relatedassignmentsinyourclass:(这个课程由三个主要部分组成,它与有关项目任务相符)1.Creationofabasicdatamodel(Conceptualdatamodel)创建一个基本的数据模型(概念数据模型)2.Creationofadatabaseschema建立数据库模式3.Creationofthedatabase创建数据库Thistutorialisastaticone,suitableforprinting.本教程是一个静态的,适合印刷Atutorialusingscreencapturesandnarrationisalsoavailable.一个指南使用屏幕捕捉和叙述是可用的。Section1.CreationofabasicdatamodelYouwillbecreatingadatamodelsimilartothatcreatedfortheHeartlandPropertiescasestudyusedinclass.教程中你将创建一个和研究心脏地带个案相似的数据模型TheEntitiesinvolvedinthismodelinclude:Employee,Office,Property,andInspection.参与本次的实体模型包括:员工、办公、财产、及检验。First,invokeERwinfromStart->Programs->ComputerAssociates->AllFusion->ERwinDataModeler->Erwin首先,从开始——程序——CA——所有程序——ERwinDataModelerYouwillfirstencounteradialogboxentitled"ModelMartConnectionManager"(经理ModelMart连接).SimplyclickonCancel.将首先遇到一个对话框题为“ModelMartConnectionManager”。只需点击“取消”。Youwillbeaskedtochoosebetweencreatinganewmodel,andopeninganexistingmodel,asshowninFigure1你将被要求之间作出选择,创造了一种新的模式,开放一个现有的模型,如图1所示.Forthisexercise,createanewmodel.通过这个练习,创建一个新的模型Figure1:CreateanewmodelThenextdialogbox,showninFigure2,willaskyoutochoosethetemplatetobeusedtocreatethenewmodel.下一个对话框,如图2所示,会让你选择的模板可以被用来创造新的模型Atthispoint,youmayassociatethemodelwithatargetDBMSproduct,suchasMicrosoftAccess,Oracle,DB2,etc.在这一点上,你可以把这个模型与如MicrosoftAccess,甲骨文,DB2等目标数据库产品联系在一起Youwillhavetheopportunitytochangethischoicelater,butfornowchooseMicrosoftAccess.你之后将有机会改变这种选择,但是现在选择MicrosoftAccess。Also,chooseLogical/Physicalasthenewmodeltype.同时,选择的逻辑或者物理作为新模型形式Thischoicewillallowustoswitchbackandfortheasilybetweenalogicalmodel(ERDiagram)andaphysicalmodel(databaseschema).这个选择将让我们轻易之间来回切换逻辑模型(ER图)和物理模型(资料库)Figure2:SelectingamodeltypeERwinwillnowdisplaythemainwindowfromwhichmostofyourERdiagramdevelopmentwillbedone,asshowninFigure3.ERwin现在将显示在主窗口大部分你ER图发展来完成,如图3。Figure3:TheERwinWorkplaceERwin工作场所TheERwinworkplaceconsistsoftwomainparts.OntheleftistheModelNavigator,whichdisplaysahierarchyofitemsofimportance,suchasentities,domains,andsubjectareas.左面是模型的领航员,显示某一层次的物品的重要性,如实体、领域和课题。OntherightistheDisplayWindow,whichwillshowtheERdiagramitself.右边是显示窗口,它能够显示ER图本身Asyoucreateobjects,theywillappearinthedisplaywindow(iftheyarevisualinnature,likeentities),andappearinthehierarchywithintheModelNavigator.当你创建对象时,他们将会出现在显示器窗口(如果它们是视觉的自然属性,就像实体),并将出现在层级模型导航器。AtoollikeERcanaccomodateanumberofdatamodelingnotationsandwinconventions.像ER这样工具可以容纳大量的数据建模的符号和对话Inmyclasspleasemakethefollowingchangestothepreferencesbeforeyoubegintocreateyourmodel在我的课上请完成下面的改变的偏好,在你开始之前,创造你的模型:1.FromtheFormat->EntityDisplaymenu,makesurethatPrimaryKeyDesignatoris2.FromtheFormat->EntityDisplaymenu,makesurethatForeignKeychecked.从格式-实体显示菜单,确保外国关键checked从格式->实体显示菜单,确保主键栏进行检查Designator(FK)is指示器(FK)是不能检查3.FromtheFormat->EntityDisplaymenu,makesurethatShowMigratedchecked.从格式->实体显示菜单,确保显示属性迁移Attributesischecked到4.FromtheFormat->RelationshipDisplay,makesurethatVerbPhraseischecked.从格式-关系显示、确保动词短语进行检查Inaddition,youmaychoosebetweentwodifferentE-Rdiagrammingnotations.另外,你可以选择两种不同的e-r种画图符号InERwin,clickonModel->ModelPropertiestoseethewindowshowninFigure3b:点击模型->窗口模型属性看到如图3b.Figure3b:ChoiceofnotationThistutorialisbasedontheInformationEngineering("CrowsFoot")notation.YoumayalsouseIDEF1X,ifyouwish.本教程是基于信息工程(“乌鸦脚”)的符号。你也可以使用IDEF1X,如果你愿意的话。Tocreateanewentity,clickontheentityicon()onthetoolbar,orright-clickonthewordintheModelNavigator.创建一个新的Entity实体,点击实体工具栏上的图标(),或者以右键点击这个词中的实体模型导航器Ifyouclickontheentityicon,youthenshouldclickontheDisplayWindowwhereyouwouldliketheentitytoappear,asshowninFigure4.如果你点击了实体图标,那么你应该点击显示窗口,在那里你会喜欢这个实体出现的各位朋友,如图4所示Figure4:AnewentityNoticethatthedefaultnamefortheentityisE/x,wherexissomenumber(2inthiscase).注意,默认的名字因为实体是E/x,那里的x是一些数字(2在这种情况下)ClickontheTabkeyseveraltimesandnoticewhathappens.点击Tab键了好几次,通知会发生些什么PressingthetabkeycausethefocustocyclebetweenthethreemainpartsoftheEntity:按tab键引起关注焦点,周期之间的三个主要部分的实体thenameoftheentity,theprimarykeyattribute(s)主要的关键属性,andthenon-primarykeyattribute(s)时速的关键属性(s).Ingeneral,tomodifyoneofthesethreepartsoftheTabentity,youwillpressthekeytocycletotheappropriatepartoftheentity,thentypetoaddormodifythatpartoftheentity.一般来说,修改这三部分的实体,你会按Tab键循环到适当的一部分,然后输入实体的增加或修改的那部分实体TabRightnow,pressthekeyuntiltheentitynameishighlighted.现在,按Tab键,直到实体名称是突出了ThentypeEMPLOYEE,asshowninFigure5.然后输入雇员,如图5。Figure5:ChangingthenameoftheentityAtthispoint,youmaywishtosaveandnameyourdiagramtoavoidlossshouldthesystemorapplicationcrash.在这一点上,你可能想要存起来,说出你的图来避免损失应该系统或应用程序崩溃。OnceyouhavechangedthenametoEMPLOYEE,presstheTabkeyagaintomovethefocustothenextpartoftheEntity,addingaprimarykeyattribute.一旦你已经更改了名称给员工,按Tab键来移动焦点再下一部分的实体,添加一个关键属性Thentypethenameoftheprimarykeyattribute,Emp_Num,asshowninFigure6.然后输入名称的属性,Emp_Num主键,如图6。Figure6:AddingaprimarykeyattributeNoticethatbecauseofthepreferencesyousetearlier,theprimarykeyattributehasakeyiconnexttoit.值得注意的是,因为你的喜好设定早些时候,主键的属性是一个关键的图标旁边。PresstheTabkeyonemoretimetobringthefocusbelowthehorizontallineintheEntity,whereyouwilladdinanumberofnon-primarykeyattributes.按Tab键一遍把焦点的水平线以下的实体,在那里您将加入一定数量的时速关键属性。TypeEmp_Fname,asshowninFigure7.Emp_Fname型,如图7WhenyouhavetypedEmp_Name,Enterkey(notTab)当你打了Emp_Name,按回车键(不是选项pressthe卡).Noticewhathappens当你学得.ThecursorisnowpositionedforyoutoaddanotherattributeinthissameportionoftheEntity,thenon-primarykeyattributeportion.定位光标被现在你添加另一个属性在这个相同的部分实体、时速关键属性分。Figure7:Addingnon-primarykeyattributesContinueaddingthefollowingnon-primarykeyattributes:继续增加下列时速关键属性:Emp_LnameEmp_SSNEmp_StreetEmp_CityEmp_StateEmp_ZipcodeEmp_PhoneEmp_FaxYourdiagramshouldnowlooklikeFigure8.Figure8:TheEmployeeentityRepeattheentitycreationprocessfortheentitiesandattributeslistedinTable1.重复这个实体创建过程中为实体及其属性列于表1。Man_Car_AllowanceASSOCIATEAssoc_Hourly_RateTable1:EntitiesandAttributesNoticethatsomeoftheentitieshavenoprimarykeyattributes(Manager,Associate),andoneentityhasanattributewhichispartoftheprimarykey,butbyitselfdoesnotconstituteaprimarykey(Inspection).注意到一些实体属性没有主键(),和一个实体有一个属性的一部分,而是由主键本身并不会构成一个主键(检验)Asweaddrelationshipstothediagram,thenatureofthekeysfortheseentitieswillbecomeclear.当我们添加关系图,大自然的钥匙,这些实体就变得清晰了Forthetimebeing,besurethattherearenoprimarykeyattributesforManagerandAssociate,andonlyoneprimarykeyattributeforInspection,asshowninFigure9.随着时间的推移,要确保没有关键属性对经理及员工,只有一个主要的关键属性进行检验,如图9所示Figure9:HeartlandPropertiesEntitiesERwinsupportsthecreationofrelationshipswiththreebasickindsofconnectivity(ERwin支持创造之间的关系三种基本的连通性:one-to-one,winone-to-many,andmany-to-many.Withintheone-to-manycategory,ERallowsustodistinguishbetweenidentifyingandnon-identifyingone-to-manyrelationships.这一对范畴,ithin欧文允许我们区分识别和non-identifying一对多的关系。One-to-manyRelationshipsWe'llbeginwithtworelationships,betweenInspectionandEmployeeandbetweenInspectionandProperty.我们可以先开始两个关系,检验和员工之间,检验和财产的权利之间InspectionisrelatedtobothPropertyandEmployeeinonetomanyrelationships.同时与检验是财产和员工在一对多的关系EachInspectionisundertakenatoneProperty;在进行每个检查是一套房产eachPropertymayundergomanyinspections每处房产,可能经过许多检查.EachInspectioniscarriedoutbyoneEmployee每次检验进行了一名员工;eachEmployeecarriesoutmanyInspections每一位员工进行许多检查.Aretheserelationshipsnon-identifyingrelationships?这些是关系识别关系或non-identifying关identifyingrelationshipsoridentifyingrelationshipsor系吗?Aretheserelationshipsnon-identifyingrelationships?这些是关系识别关系或non-identifying关系吗?TheissuehingesonthenatureoftheprimarykeyofInspection,theentityonthe"many"sideoftherelationship.问题的关键在于性质的主键的检验、实体上的“许多”方面的关系。TheprimarykeyofInspectioninthisexampleisacompositeprimarykeyconsistingoftwoattributes主键的检验在本例中是一个合成物,主键由两个属性:{Insp_Date,Prop_ID}ThebusinessruleineffecthereisthateachpropertyhasatmostoneinspectionperdayInsp_DateProp_ID}的商业规则,在这里,每一种性质影响的条件下,在大多数人检查每天.Onemightarguewhetherornotthatisasoundassumption,butletssupposeforthesakeofillustrationthatitis.一个人可能会争辩说不管那是一种合理的假设,但为了说明我们可以假设它是。NoticethattheprimarykeyofInspectionincludestheprimarykeyofProperty,theentitywithwhichithasarelationship.值得注意的是,主键检查包括主键的性质、实体与它有关系Forthisreason,wesaythattherelationshipbetweenInspectionandPropertyisanidentifyingone-to-manyrelationship.因为这个原因,我们说,检验和财产之间的关系是一种识别一对多的关系。Anidentifyingrelationshipiscreatedbyclickingfirstontheidentifyingrelationshipicon().创建一个识别关系是通过点击第一的在识别关系图标()Noticethatithasthecrow'sfootnotation(indicating"many")andasolidline(indicatingidentifying).值得注意的是,它有乌鸦脚的符号()和一个实线(指着识别)Tocreateanidentifyingrelationship,clickfirstonthisicon,thenclickontheparententity(ontheonesideoftherelationship)andthenclickonthechildentity(onthemanysideoftherelationship).创建一个识别关系,点击先在这个图标,然后点击“家长实体(在这边的关系),然后点击孩子实体(在许多一端的关系)Inthiscase,youwillclickfirstontheidentifyingrelationshipicon,thenonProperty,thenonInspection.在这种情况下,你就会点击图标先识别,然后在产权关系,然后在检查TheresultsareshowninFigure10.结果显示于图10Figure10:AnidentifyingrelationshipNoticethatERwinhasprovidedalabel"R/1"fortherelationship,whichisnotveryhelpful.值得注意的是,win已经提供了一个标签"R/”的关系,而不是很有帮助Double-clickontherelationshipitselftobringupadialogboxinwhichwecanfurtherrefinetherelationshipdefinition双击关系本身造就了一个对话框,以这种方式我们能够进一步提炼的关系的定义.FilloutthisdialogboxasshowninFigure11.填写这对话框如图11分Figure11:RelationshipsdefinitionRelationship:textboxtherelationshipispresentedintheformIntheparententityR/1childentity.在这段关系的关系:文本框的形式给出了R/1孩子家长实体的实体TheVerbPhraseportionofthisboxallowsustodefinethelabeltoplaceontherelationshipinplaceofR/1.这个动词短语的一部分,这盒允许我们来定义标签的地方的关系上所处的R/1SincetheparententityisPropertyandtheChildentityisInspection,theParent-to-Childverbphrasewillread"PropertyUndergoesInspection."自从父母实体是财产和孩子的主体是检查、Parent-to-Child动词短语会读"财产经历检查。”TheChild-to-Parentverbphrasewillread"InspectionUndertakenatProperty."动词短语的Child-to-Parent会读”的检测在进行财产。”IntheRelationshipCardinalityportionofthiswindow,wecandeterminehowmanychildentityoccurencesmaybeassociatedwitheachparententityoccurence.人际关系的行集数的一部分,这窗户,我们可以决定了有多少孩子实体检测仪可伴有每个父母实体发生Morespecifically,"OnePropertyUndergoesZero,OneorMoreInspections."更具体地说,“一个财产经历零,一个或更多的检查。”Noticethatatthispointwearealsoabletodefineparticipation.值得注意的是,在这一点上我们也能够定义的参与。Ifeachpropertyhadtohaveundergoneatleastoneinspectioninordertobemandatoryparticipationstoredinthedatabase,thenwecouldhaveforcedbychoosingtheOneorMoreoption.如果每个财产不得不经历了至少一个检测为了被储存在数据库中,那么,我们就可以迫使强制性参与挑选一个或更多的选择。ClickOKtocompletetherelationshipdefinition,asshowninFigure12.点击OK完成关系定义,如图12。Figure12:FinishedrelationshipNoticethatwhenanentityparticipatesasthechildinanidentifyingrelationshipitismodeledwithroundedcorners.值得注意的是,当一个实体作为识别的关系那孩子是模仿和圆角。Thisnotationisusedforwhatinotherdatamodelingtoolsiscalleda"WeakEntity".这个符号是用来在其他数据建模工具,一种被称为“弱单位”。TherelationshipbetweenInspectionandEmployeeissomewhatdifferent.检查和员工之间的关系是有不同的。Itisaone-to-manyrelationship,butnon-identifying,becausetheprimarykeyofEmployeeisnotitispartoftheprimarykeyofInspection.这是一个一对多的关系,但它是non-identifying中的主键,因为雇员没有部分的主键检查Forsucharelationship,wemustclickonthenon-identifyingrelationshipicon(),whichusesadashedlineinsteadofasolidline.对于这样一个关系,我们必须点击屏幕上的图标()),它使用一个虚线来代替一个实线。Asbefore,weclickontheicon,thentheparententity,thenthechildentity.和以前一样,我们点击这个图标,那么父的实体,然后孩子的实体Clickonthenon-identifyingrelationshipicon,thentheEmployeeentity,thentheInspectionentity.点击屏幕上的图标,然后non-identifying员工关系实体,然后检验实体Double-clickontherelationshiptobringuptherelationshipdefinitionwindowandfillitinasshowninFigure13.ouble-click的关系来定义窗口和关系把它填上如图13岁。Figure13:Non-identifyingrelationshipdefinition.Asbefore,weprovidemoremeaningfulverbphrasesfortherelationship.和以前一样,我们提供更多的有意义的动词短语的关系Asbefore,sinceeachemployeemaybeassociatedwithzero,oneormoreinspections,wechoosethecorrespondingcardinality.和以前一样,因为每个员工可能伴有零,一个或多个检查,我们选择相应的行集数Unlikebefore,whenwechosetheidentifyingrelationshiptype,wehavenowchosenthenon-identifyingrelationshiptype.不同于以往的,当我们选择了识别关系类型,我们现在已经选好了non-identifying关系类型。Wehavetheoptionofindicatingwhethernullsarepermittedornot.我们可以选择是否允许nulls表示。Thisdecisionregardstheparticipationoftheparententityinarelationshipwiththechildentity.这一决定将参与实体的父母与孩子的关系实体。Inhavetobeotherwords,doeseachchildentityoccurence(Inspection)associatedwithaparententityoccurence(Employee)?换句话说,每一个孩子的实体(检查)发生有助于家长实体发生(雇员)吗?Inthiscase,theansweryes.Eachinspectionmustbecarriedoutbyanemployee,oritisnotconsideredaproperinspection.在这种情况下,答案是的。每项考核必须执行一个雇员,或并不被认为是一个适当的检验。TheparticipationofEmployeeintherelationshipis制性的。mandatory.在参与的员工之间的关系是强ClickOKtocompletetherelationshipdefinition,asshowninFigure14.点击OK完成关系定义,如图14。Figure14:Non-identifyingrelationshipEmployeeandOfficealsoparticipationinarelationshipwitheachother.员工和办公室也参与相互认识EachEmployeeisassignedtooneandonlyoneOffice,andeachOfficehasoneormoreEmployees.每个员工被指定到唯一的一间办公室,每个办公室都拥有一个或更多的员工。Inthisone-to-manyrelationship,OfficeistheparentandEmployeeisthechild.在这一对多的关系,办公室是家长和员工是孩子。Sincetheprimarykeyofthechild(Employee)doesnotincludetheprimarykeyoftheparent(Office),thisisanon-identifyingrelationship.自从主键的孩子(雇员)并不包括主键的父母(办公室),这是一个non-identifying关系。Clickonthenon-identifyingrelationshipicon,Office,andEmployeetocreatethisrelationship.点击屏幕上的图标non-identifying关系、写字楼及员工,形成了这种关系。Double-clickontherelationshipandfillintherelationshipdefinitionwindowasshowninFigure15.双击关系并填入关系定义窗口如图15。Figure15:Anon-identifyingrelationshipwithmandatoryparticipationInFigure15,seeanexampleofarelationshipinwhichparticipationismandatoryforbothentities.在图15,看一个例子,这样一种关系,参与对双方都是强制性的实体TheCardinalityindicatesthateachOfficeisassociatedwithOneorMore(butnotZero)Employees.每间办公室的行集数表明,伴随着一个或多个(但不是零)的雇员。TheRelationshipTypeindicatesthatthisisanon-identifyingrelationship,andthatNullsarenotpermitt

温馨提示

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

评论

0/150

提交评论