ERwin使用说明(中英文).doc_第1页
ERwin使用说明(中英文).doc_第2页
ERwin使用说明(中英文).doc_第3页
ERwin使用说明(中英文).doc_第4页
ERwin使用说明(中英文).doc_第5页
免费预览已结束,剩余18页可下载查看

下载本文档

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

文档简介

Getting Started with ERwin (Erwin入门)by Dr. Peter WolcottDepartment of Information Systems and Quantitative AnalysisCollege of Information Science and TechnologyUniversity of Nebraska at Omaha(由内布拉斯加州的奥马哈大学信息科学与技术学院门的信息系统和定量分析博士彼得著)Introduction (介绍)ERwin is a popular data modeling tool used by a number of major companies in Omaha and throughout the world. (Erwin是受奥马哈和世界各地的一些主要的公司欢迎的数据模型工具) The product is currently owned, developed, and marketed by Computer Associates, a leading software developer.(该产品是由具有领导地位的CA软件开发公司拥有、开发和销售) The product supports a variety of aspects of database design, including data modeling, forward engineering (the creation of a database schema and physical database on the basis of a data model), and reverse engineering (the creation of a data model on the basis of an existing database) for a wide variety of relational DBMS, including Microsoft Access, Oracle, DB2, Sybase, and others.该软件为多种多样的关系型数据库管理系统,包括Microsoft Access,甲骨文,Sybase,DB2,和其他人提供支持数据库设计的各个方面,包括数据建模、正向工程(在现有的数据模型的基础上创建数据模式和物理数据库) 和逆向工程(在现在的数据库基础上创建数据模型)This brief tutorial steps you through the process of creating a data model using ERwin.(你可以通过这个简单教程中的步骤运用Erwin来创建数据模型) It will not explain all aspects of ERwin, but will show you the minimum necessary to create and use data models for this class. (这个课程不可能全面地讲解Erwin,但它向你展示了必要的最基本的创建和使用数据模型的知识)It consists of three major segments, which correspond to the project-related assignments in your class: (这个课程由三个主要部分组成,它与有关项目任务相符)1. Creation of a basic data model (Conceptual data model) 创建一个基本的数据模型(概念数据模型)2. Creation of a database schema 建立数据库模式3. Creation of the database 创建数据库This tutorial is a static one, suitable for printing. 本教程是一个静态的,适合印刷A tutorial using screen captures and narration is also available. 一个指南使用屏幕捕捉和叙述是可用的。Section 1. Creation of a basic data model You will be creating a data model similar to that created for the Heartland Properties case study used in class.教程中你将创建一个和研究心脏地带个案相似的数据模型 The Entities involved in this model include: Employee, Office, Property, and Inspection. 参与本次的实体模型包括:员工、办公、财产、及检验。First, invoke ERwin from Start-Programs-Computer Associates-All Fusion- ERwin Data Modeler- Erwin首先,从开始程序CA所有程序ERwin Data ModelerYou will first encounter a dialog box entitled ModelMart Connection Manager(经理ModelMart连接). Simply click on Cancel. 将首先遇到一个对话框题为“ModelMart Connection Manager”。只需点击“取消”。You will be asked to choose between creating a new model, and opening an existing model, as shown in Figure 1你将被要求之间作出选择,创造了一种新的模式,开放一个现有的模型,如图1所示. For this exercise, create a new model. 通过这个练习,创建一个新的模型Figure 1: Create a new model The next dialog box, shown in Figure 2, will ask you to choose the template to be used to create the new model. 下一个对话框,如图2所示,会让你选择的模板可以被用来创造新的模型At this point, you may associate the model with a target DBMS product, such as Microsoft Access, Oracle, DB2, etc. 在这一点上,你可以把这个模型与如Microsoft Access,甲骨文,DB2等目标数据库产品联系在一起You will have the opportunity to change this choice later, but for now choose Microsoft Access. 你之后将有机会改变这种选择,但是现在选择Microsoft Access。Also, choose Logical/Physical as the new model type. 同时,选择的逻辑或者物理作为新模型形式This choice will allow us to switch back and forth easily between a logical model (ER Diagram) and a physical model (database schema). 这个选择将让我们轻易之间来回切换逻辑模型(ER图)和物理模型(资料库)Figure 2: Selecting a model type ERwin will now display the main window from which most of your ER diagram development will be done, as shown in Figure 3. ERwin现在将显示在主窗口大部分你ER图发展来完成,如图3。Figure 3: The ERwin Workplace ERwin工作场所The ERwin workplace consists of two main parts. On the left is the Model Navigator, which displays a hierarchy of items of importance, such as entities, domains, and subject areas. 左面是模型的领航员,显示某一层次的物品的重要性,如实体、领域和课题。 On the right is the Display Window, which will show the ER diagram itself. 右边是显示窗口,它能够显示ER图本身As you create objects, they will appear in the display window (if they are visual in nature, like entities), and appear in the hierarchy within the Model Navigator. 当你创建对象时,他们将会出现在显示器窗口(如果它们是视觉的自然属性,就像实体),并将出现在层级模型导航器。 Setting Preferences 偏好设置A tool like ERwin can accomodate a number of data modeling notations and conventions. 像ER这样工具可以容纳大量的数据建模的符号和对话 In my class please make the following changes to the preferences before you begin to create your model在我的课上请完成下面的改变的偏好,在你开始之前,创造你的模型: 1. From the Format-Entity Display menu, make sure that Primary Key Designator is checked从格式- 实体显示菜单,确保主键栏进行检查2. From the Format-Entity Display menu, make sure that Foreign Key Designator (FK) is unchecked. 从格式- 实体显示菜单,确保外国关键指示器(FK)是不能检查 3. From the Format-Entity Display menu, make sure that Show Migrated Attributes is unchecked. 从格式- 实体显示菜单,确保显示属性迁移到unchecked4. From the Format-Relationship Display, make sure that Verb Phrase is checked. 从格式- 关系显示、确保动词短语进行检查In addition, you may choose between two different E-R diagramming notations.另外,你可以选择两种不同的e - r种画图符号In ERwin, click on Model-Model Properties to see the window shown in Figure 3b: 点击模型- 窗口模型属性看到如图3b.Figure 3b: Choice of notationThis tutorial is based on the Information Engineering (Crows Foot) notation. You may also use IDEF1X, if you wish. 本教程是基于信息工程(“乌鸦脚”)的符号。你也可以使用IDEF1X,如果你愿意的话。Creating an Entity创造一个实体To create a new entity, click on the entity icon () on the toolbar, or right-click on the word Entity in the Model Navigator. 创建一个新的实体,点击实体工具栏上的图标(),或者以右键点击这个词中的实体模型导航器If you click on the entity icon, you then should click on the Display Window where you would like the entity to appear, as shown in Figure 4. 如果你点击了实体图标,那么你应该点击显示窗口,在那里你会喜欢这个实体出现的各位朋友,如图4所示Figure 4: A new entity Notice that the default name for the entity is E/x, where x is some number (2 in this case). 注意,默认的名字因为实体是E / x,那里的x是一些数字(2在这种情况下)Click on the Tab key several times and notice what happens. 点击Tab键了好几次,通知会发生些什么Pressing the tab key cause the focus to cycle between the three main parts of the Entity: 按tab键引起关注焦点,周期之间的三个主要部分的实体 the name of the entity, the primary key attribute(s) 主要的关键属性, and the non-primary key attribute(s) 时速的关键属性(s). In general, to modify one of these three parts of the entity, you will press the Tab key to cycle to the appropriate part of the entity, then type to add or modify that part of the entity. 一般来说,修改这三部分的实体,你会按Tab键循环到适当的一部分,然后输入实体的增加或修改的那部分实体 Right now, press the Tab key until the entity name is highlighted. 现在,按Tab键,直到实体名称是突出了Then type EMPLOYEE, as shown in Figure 5. 然后输入雇员,如图5。Figure 5: Changing the name of the entity At this point, you may wish to save and name your diagram to avoid loss should the system or application crash. 在这一点上,你可能想要存起来,说出你的图来避免损失应该系统或应用程序崩溃。Adding primary key columns添加主键字段Once you have changed the name to EMPLOYEE, press the Tab key again to move the focus to the next part of the Entity, adding a primary key attribute. 一旦你已经更改了名称给员工,按Tab键来移动焦点再下一部分的实体,添加一个关键属性Then type the name of the primary key attribute, Emp_Num, as shown in Figure 6. 然后输入名称的属性,Emp_Num主键,如图6。Figure 6: Adding a primary key attribute Notice that because of the preferences you set earlier, the primary key attribute has a key icon next to it. 值得注意的是,因为你的喜好设定早些时候,主键的属性是一个关键的图标旁边。Press the Tab key one more time to bring the focus below the horizontal line in the Entity, where you will add in a number of non-primary key attributes. 按Tab键一遍把焦点的水平线以下的实体,在那里您将加入一定数量的时速关键属性。 Type Emp_Fname, as shown in Figure 7. Emp_Fname型,如图7 When you have typed Emp_Name, press the Enter key (not Tab) 当你打了Emp_Name,按回车键(不是选项卡). Notice what happens当你学得. The cursor is now positioned for you to add another attribute in this same portion of the Entity, the non-primary key attribute portion. 定位光标被现在你添加另一个属性在这个相同的部分实体、时速关键属性分。 Figure 7: Adding non-primary key attributes Continue adding the following non-primary key attributes: 继续增加下列时速关键属性:Emp_LnameEmp_SSNEmp_StreetEmp_CityEmp_StateEmp_ZipcodeEmp_PhoneEmp_Fax Your diagram should now look like Figure 8. Figure 8: The Employee entity Repeat the entity creation process for the entities and attributes listed in Table 1. 重复这个实体创建过程中为实体及其属性列于表1。EntityAttributesEntityAttributesOFFICEOffice_Num (pk)Office_StreetOffice_CityOffice_StateOffice_ZipcodeOffice_NameOffice_PhoneOffice_FaxINSPECTIONInsp_Date (pk)Insp_CommentsPROPERTYProp_ID (pk)Prop_StreetProp_CityProp_StateProp_TypeProp_BathsProp_RoomsProp_MonthlyRentMANAGERMan_SalaryMan_Car_AllowanceASSOCIATEAssoc_Hourly_RateTable 1: Entities and Attributes Notice that some of the entities have no primary key attributes (Manager, Associate), and one entity has an attribute which is part of the primary key, but by itself does not constitute a primary key (Inspection). 注意到一些实体属性没有主键(经理、副),和一个实体有一个属性的一部分,而是由主键本身并不会构成一个主键(检验)。As we add relationships to the diagram, the nature of the keys for these entities will become clear. 当我们添加关系图,大自然的钥匙,这些实体就变得清晰了For the time being, be sure that there are no primary key attributes for Manager and Associate, and only one primary key attribute for Inspection, as shown in Figure 9. 随着时间的推移,要确保没有关键属性对经理及员工,只有一个主要的关键属性进行检验,如图9所示Figure 9: Heartland Properties Entities Creating Relationships建立人际关系ERwin supports the creation of relationships with three basic kinds of connectivity (ERwin支持创造之间的关系三种基本的连通性: one-to-one, one-to-many, and many-to-many. Within the one-to-many category, ERwin allows us to distinguish between identifying and non-identifying one-to-many relationships. 这一对范畴,ithin欧文允许我们区分识别和non-identifying一对多的关系。 One-to-many Relationships Well begin with two relationships, between Inspection and Employee and between Inspection and Property. 我们可以先开始两个关系,检验和员工之间,检验和财产的权利之间Inspection is related to both Property and Employee in one to many relationships. 同时与检验是财产和员工在一对多的关系 Each Inspection is undertaken at one Property; 在进行每个检查是一套房产each Property may undergo many inspections每处房产,可能经过许多检查. Each Inspection is carried out by one Employee每次检验进行了一名员工; each Employee carries out many Inspections每一位员工进行许多检查. Are these relationships identifying relationships or non-identifying relationships? 这些是关系识别关系或non-identifying关系吗?Are these relationships identifying relationships or non-identifying relationships?这些是关系识别关系或non-identifying关系吗? The issue hinges on the nature of the primary key of Inspection, the entity on the many side of the relationship. 问题的关键在于性质的主键的检验、实体上的“许多”方面的关系。The primary key of Inspection in this example is a composite primary key consisting of two attributes主键的检验在本例中是一个合成物,主键由两个属性: Insp_Date, Prop_ID The business rule in effect here is that each property has at most one inspection per day Insp_Date Prop_ID 的商业规则,在这里,每一种性质影响的条件下,在大多数人检查每天. One might argue whether or not that is a sound assumption, but lets suppose for the sake of illustration that it is. 一个人可能会争辩说不管那是一种合理的假设,但为了说明我们可以假设它是。Notice that the primary key of Inspection includes the primary key of Property, the entity with which it has a relationship. 值得注意的是,主键检查包括主键的性质、实体与它有关系For this reason, we say that the relationship between Inspection and Property is an identifying one-to-many relationship. 因为这个原因,我们说,检验和财产之间的关系是一种识别一对多的关系。An identifying relationship is created by clicking first on the identifying relationship icon ().创建一个识别关系是通过点击第一的在识别关系图标()Notice that it has the crows foot notation (indicating many) and a solid line (indicating identifying). 值得注意的是,它有乌鸦脚的符号(表示“许多”)和一个实线(指着识别) To create an identifying relationship, click first on this icon, then click on the parent entity (on the one side of the relationship) and then click on the child entity (on the many side of the relationship). 创建一个识别关系,点击先在这个图标,然后点击“家长实体(在这边的关系),然后点击孩子实体(在许多一端的关系) In this case, you will click first on the identifying relationship icon, then on Property, then on Inspection. 在这种情况下,你就会点击图标先识别,然后在产权关系,然后在检查The results are shown in Figure 10. 结果显示于图10Figure 10: An identifying relationship Notice that ERwin has provided a label R/1 for the relationship, which is not very helpful. 值得注意的是, ERwin已经提供了一个标签 R / 1”的关系,而不是很有帮助Double-click on the relationship itself to bring up a dialog box in which we can further refine the relationship definition双击关系本身造就了一个对话框,以这种方式我们能够进一步提炼的关系的定义. Fill out this dialog box as shown in Figure 11. 填写这对话框如图11分 Figure 11: Relationships definition In the Relationship: text box the relationship is presented in the form parent entity R/1 child entity. 在这段关系的关系:文本框的形式给出了R / 1孩子家长实体的实体The Verb Phrase portion of this box allows us to define the label to place on the relationship in place of R/1. 这个动词短语的一部分,这盒允许我们来定义标签的地方的关系上所处的R / 1 Since the parent entity is Property and the Child entity is Inspection, the Parent-to-Child verb phrase will read Property Undergoes Inspection. 自从父母实体是财产和孩子的主体是检查、Parent-to-Child动词短语会读财产经历检查。” The Child-to-Parent verb phrase will read Inspection Undertaken at Property. 动词短语的Child-to-Parent会读”的检测在进行财产。”In the Relationship Cardinality portion of this window, we can determine how many child entity occurences may be associated with each parent entity occurence. 人际关系的行集数的一部分,这窗户,我们可以决定了有多少孩子实体检测仪可伴有每个父母实体发生More specifically, One Property Undergoes Zero, One or More Inspections. 更具体地说,“一个财产经历零,一个或更多的检查。”Notice that at this point we are also able to define participation. 值得注意的是,在这一点上我们也能够定义的参与。 If each property had to have undergone at least one inspection in order to be stored in the database, then we could have forced mandatory participation by choosing the One or More option. 如果每个财产不得不经历了至少一个检测为了被储存在数据库中,那么,我们就可以迫使强制性参与挑选一个或更多的选择。 Click OK to complete the relationship definition, as shown in Figure 12. 点击OK完成关系定义,如图12。 Figure 12: Finished relationship Notice that when an entity participates as the child in an identifying relationship it is modeled with rounded corners. 值得注意的是,当一个实体作为识别的关系那孩子是模仿和圆角。 This notation is used for what in other data modeling tools is called a Weak Entity.这个符号是用来在其他数据建模工具,一种被称为“弱单位”。 The relationship between Inspection and Employee is somewhat different. 检查和员工之间的关系是有不同的。It is a one-to-many relationship, but it is non-identifying, because the primary key of Employee is not part of the primary key of Inspection. 这是一个一对多的关系,但它是non-identifying中的主键,因为雇员没有部分的主键检查For such a relationship, we must click on the non-identifying relationship icon (), which uses a dashed line instead of a solid line. 对于这样一个关系,我们必须点击屏幕上的图标(),它使用一个虚线来代替一个实线。As before, we click on the icon, then the parent entity, then the child entity. 和以前一样,我们点击这个图标,那么父的实体,然后孩子的实体 Click on the non-identifying relationship icon, then the Employee entity, then the Inspection entity. 点击屏幕上的图标,然后non-identifying员工关系实体,然后检验实体 Double-click on the relationship to bring up the relationship definition window and fill it in as shown in Figure 13. ouble-click的关系来定义窗口和关系把它填上如图13岁。Figure 13: Non-identifying relationship definition. As before, we provide more meaningful verb phrases for the relationship. 和以前一样,我们提供更多的有意义的动词短语的关系As before, since each employee may be associated with zero, one or more inspections, we choose the corresponding cardinality. 和以前一样,因为每个员工可能伴有零,一个或多个检查,我们选择相应的行集数Unlike before, when we chose the identifying relationship type, we have now chosen the non-identifying relationship type. 不同于以往的,当我们选择了识别关系类型,我们现在已经选好了non-identifying关系类型。We have the option of indicating whether nulls are permitted or not. 我们可以选择是否允许nulls表示。 This decision regards the participation of the parent entity in a relationship with the child entity. 这一决定将参与实体的父母与孩子的关系实体。In other words, does each child entity occurence (Inspection) have to be associated with a parent entity occurence (Employee)? 换句话说,每一个孩子的实体(检查)发生有助于家长实体发生(雇员)吗? In this case, the answer yes. Each inspection must be carried out by an employee, or it is not considered a proper inspection. 在这种情况下,答案是的。每项考核必须执行一个雇员,或并不被认为是一个适当的检验。The participation of Employee in the relationship is mandatory. 在参与的员工之间的关系是强制性的。 Click OK to complete the relationship definition, as shown in Figure 14. 点击OK完成关系定义,如图14。Figure 14: Non-identifying relationship Employee and Office also participation in a relationship with each other. 员工和办公室也参与相互认识Each Employee is assigned to one and only one Office, and each Office has one or more Employees. 每个员工被指定到唯一的一间办公室,每个办公室都拥有一个或更多的员工。In this one-to-many relationship, Office is the parent and Employee is the child. 在这一对多的关系,办公室是家长和员工是孩子。Since the primary key of the child (Employee) does not include the primary key of the parent (Office), this is a non-identifying relationship. 自从主键的孩子(雇员)并不包括主键的父母(办公室),这是一个non-identifying关系。Click on the non-identifying relationship icon, Office, and Employee to create this relationship. 点击屏幕上的图标non-identifying关系、写字楼及员工,形成了这种关系。Double-click on the relationship and fill in the relationship definition window as shown in Figure 15. 双击关系并填入关系定义窗口如图15。 Figure 15: A non-identifying relationship with mandatory participation In Figure 15, see an example of a relationship in which participation is mandatory for both entities. 在图15,看一个例子,这样一种关系,参与对双方都是强制性的实体The Cardinality indicates that each Office is associated with One or More (but not Zero) Employees. 每间办公室的行集数表明,伴随着一个或多个(但不是零)的雇员。 The Relationship Type indicates that this is a non-identifying relationship, and that Nulls are not permitt

温馨提示

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

评论

0/150

提交评论