ERwin使用說明(中英文)_第1頁
ERwin使用說明(中英文)_第2頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、 10/10ERwin使用說明(中英文) Getting Started with ER win (Erwin 入門) by Dr. Peter Wolcott Department of Information Systems and Quantitative Analysis College of Information Science and Technology University of Nebraska at Omaha(由內布拉斯加州的奧馬哈大學信息科學與技術學院門的信息系統(tǒng)和定量分析博士彼得著) Introduction (介紹) ER win is a popular dat

2、a modeling tool used by a number of major companies in Omaha and throughout the world. (Erwin是受奧馬哈和世界各地的一些主要的公司歡迎的數(shù)據(jù)模型工具) The product is currently owned, developed, and marketed by Computer Associates, a leading software developer.(該產品是由具有領導地位的CA軟件開發(fā)公司擁有、開發(fā)和銷售) The product supports a variety of aspe

3、cts 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 Mi

4、crosoft Access, Oracle, DB2, Sybase, and others.該軟件為多種多樣的關系型數(shù)據(jù)庫管理系統(tǒng),包括 Microsoft Access,甲骨文,Sybase,DB2,和其他人提供支持數(shù)據(jù)庫設計的各個方面,包括數(shù)據(jù)建模、正向工程(在現(xiàn)有的數(shù)據(jù)模型的基礎上創(chuàng)建數(shù)據(jù)模式和物理數(shù)據(jù)庫)和逆向工程(在現(xiàn)在的數(shù)據(jù)庫基礎上創(chuàng)建數(shù)據(jù)模型) This brief tutorial steps you through the process of creating a data model using ER win.(你可以通過這個簡單教程中的步驟運用Erwin來創(chuàng)建數(shù)據(jù)模

5、 型) 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,但它向你展示了必要的最基本的創(chuàng)建和使用數(shù)據(jù)模型的知識) It consists of three major segments, which correspond to the project-related assignments in your class: (這個課程由三個主要部分組成,它與

6、有關項目任務相符) 1.Creation of a basic data model (Conceptual data model) 創(chuàng)建一個 基本的數(shù)據(jù)模型(概念數(shù)據(jù)模型) 2.Creation of a database schema 建立數(shù)據(jù)庫模式 3.Creation of the database創(chuàng)建數(shù)據(jù)庫 This tutorial is a static one, suitable for printing.本教程是一個靜態(tài)的,適合印刷A tutorial using screen captures and narration is also available. 一個指南使用屏

7、幕捕捉和敘述是可用的。 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.教程中你將創(chuàng)建一個和研究心臟地帶個案相似的數(shù)據(jù)模型 The Entities involved in this model include: Employee, Office, Property, and Inspection. 參與本次的實體模型包括:員工、辦公、財

8、產、及檢驗。 First, invoke ER win from Start-Programs-Computer Associates-All Fusion- ERwin Data Modeler- Erwin首先,從開始程序CA所 有程序ERwin Data Modeler You will first encounter a dialog box entitled ModelMart Connection Manager(經理ModelMart連接). Simply click on Cancel.將首先遇到一 個對話框題為“ModelMart Connection Manager”。只需

9、點擊“取消”。You will be asked to choose between creating a new model, and opening an existing model, as shown in Figure 1你將被要求之間作出選擇,創(chuàng)造了一種新的模式,開放一個現(xiàn)有的模型,如圖1所示. For this exercise, create a new model.通過這個練習,創(chuàng)建一個新的模型 Figure 1: Create a new model The next dialog box, shown in Figure 2, will ask you to choose

10、 the template to be used to create the new model. 下一個對話框,如圖2所示,會讓你選擇的模板可以被用來創(chuàng)造新的模型 At this point, you may associate the model with a target DBMS product, such as Microsoft Access, Oracle, DB2, etc. 在這一點上,你可以把這個模型與如Microsoft Access,甲骨文,DB2等目標數(shù)據(jù)庫產品聯(lián)系在一起 You will have the opportunity to change this cho

11、ice later, but for now choose Microsoft Access. 你之后將有機會改變這種選擇,但是現(xiàn)在選擇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). 這個選擇將讓我

12、們輕易之間來回切換邏輯模型(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現(xiàn)在將顯示在主窗口大部分你ER圖發(fā)展來完成,如圖3。 Figure 3: The ERwin Workplace ERwin工作場所 The ERwin workplace consists of two main par

13、ts. 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 a

14、ppear in the display window (if they are visual in nature, like entities), and appear in the hierarchy within the Model Navigator.當你創(chuàng)建對象時,他們將會出現(xiàn)在顯示器窗口(如果它們是視覺的自然屬性,就像實體),并將出現(xiàn)在層級模型導航器。 Setting Preferences 偏好設置 A tool like ER win can accomodate a number of data modeling notations and conventions. 像ER這

15、樣工具可以容納大量的數(shù)據(jù)建模的符號和對話 In my class please make the following changes to the preferences before you begin to create your model在我的課上請完成下面的改變的偏好,在你開始之前,創(chuàng)造你的模型: 1.From the Format-Entity Display menu, make sure that Primary Key Designator is checked從格式- 實體顯示菜單,確保主鍵欄進行檢查 2.From the Format-Entity Display men

16、u, make sure that Foreign Key Designator (FK) is un checked.從格式- 實體顯示菜單,確保外國關鍵指示器(FK)是不能檢查 3.From the Format-Entity Display menu, make sure that Show Migrated Attributes is un checked.從格式- 實體顯示菜單,確保顯示屬性遷移 到un checked 4.From the Format-Relationship Display, make sure that Verb Phrase is checked. 從格式-

17、 關系顯示、確保動詞短語進行檢查 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 notation This tutorial is based on the Information Engineering

18、(Crows Foot) notation. You may also use IDEF1X, if you wish.本教程是基于信息工程(“烏鴉腳”)的符號。你也可以使用IDEF1X,如果你愿意的話。 Creating an Entity創(chuàng)造一個實體 To create a new entity, click on the entity icon () on the toolbar, or right-click on the word Entity in the Model Navigator. 創(chuàng)建一個新的 實體,點擊實體工具欄上的圖標(),或者以右鍵點擊這個詞中的實體模型導航器 If

19、 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. 如果你點擊了實體圖標,那么你應該點擊顯示窗口,在那里你會喜歡這個實體出現(xiàn)的各位朋友,如圖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 cas

20、e). 注意,默認的名字因為實體是E / x,那里的x是一些數(shù)字(2 在這種情況下) Click on the Tab key several times and notice what happens.點擊Tab鍵了好幾次,通知會發(fā)生些什么 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)主要的關鍵屬性,

21、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鍵循環(huán)到適當?shù)囊徊糠?然后輸入實體的增加或修改的那部分實體 Right now, pr

22、ess the Tab key until the entity name is highlighted.現(xiàn)在,按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. 在這一點上,你可能想要存起來,說出你的

23、圖來避免損失應該系統(tǒng)或應用程序崩潰。 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

24、, 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 hor

25、izontal line in the Entity, where you will add in a number of non-primary key attributes.按Tab鍵一遍把焦點的水 平線以下的實體,在那里您將加入一定數(shù)量的時速關鍵屬性。 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 cur

26、sor is now positioned for you to add another attribute in this same portion of the Entity, the non-primary key attribute portion. 定位光標被現(xiàn)在你添加另一個屬性在這個相同的部分實體、時速關鍵屬性分。 Figure 7: Adding non-primary key attributes Continue adding the following non-primary key attributes: 繼續(xù)增加下列時速關鍵屬性: Emp_Lname Emp_SSN E

27、mp_Street Emp_City Emp_State Emp_Zipcode Emp_Phone Emp_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. 重復這個實體創(chuàng)建過程中為實體及其屬性列于表1。 Notice that some of the entities have no primary key attr

28、ibutes (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

29、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 Creat

30、ing Relationships建立人際關系 ER win supports the creation of relationships with three basic kinds of connectivity (ER win支持創(chuàng)造之間的關系三種基本的連通性: one-to-one, one-to-many, and many-to-many. Within the one-to-many category, ER win allows us to distinguish between identifying and non-identifying one-to-many relat

31、ionships.這一對范疇,ithin歐文允許我們區(qū)分識別和 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. 同時與

32、檢驗是財產和員工在一對多的關 系 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

33、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. 問題的關鍵在于性質的主

34、鍵的檢驗、實體上的“許多”方面的關系。 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 的商業(yè)規(guī)則,在這里,每一種性質影響的條件下,在大多數(shù)

35、人檢查每天. 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.值得注意的是,主鍵檢查包括主鍵的

36、性質、實體與它有關系 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 ().創(chuàng)建一個識別關系是通過點擊第一的 在識別關系圖標() Notice th

37、at 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

38、(on the many side of the relationship). 創(chuàng)建一個識別關系,點擊先在這個圖標,然后點擊“家長實體(在這邊的關系),然后點擊孩子實體(在許多一端的關系) 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. 結果顯示于圖10 Figure 10: An ide

39、ntifying relationship Notice that ER win has provided a label R/1 for the relationship, which is not very helpful. 值得注意的是, ER win已經提供了一個標簽 R / 1”的關系,而不是很有幫助 Double-click on the relationship itself to bring up a dialog box in which we can further refine the relationship definition 雙擊關系本身造就了一個對話框,以這種方

40、式我們能夠進一步提煉的關系的定義. 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 d

41、efine 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 Chi

42、ld-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. 人際關系的行集數(shù)的一部分,這窗戶,我們可以決定了有多少孩子實體檢測儀可伴有

43、每個父母實體發(fā)生 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

44、, then we could have forced mandatory participation by choosing the One or More option.如果每個財產不得不經歷了至少一個檢測為了被儲存在數(shù)據(jù)庫中,那么,我們就可以迫使強制性參與挑選一個或更多的選擇。 Click OK to complete the relationship definition, as shown in Figure 12.點擊OK完成關系定義,如圖12。 Figure 12: Finished relationship Notice that when an entity particip

45、ates 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.這個符號是用來在其他數(shù)據(jù)建模工具,一種被稱為“弱單位”。 The relationship between Inspection and Employee is somewhat different. 檢

46、查和員工之間的關系是有不同的。 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 us

47、es 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.點擊屏幕上的

48、圖標,然后 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 rel

49、ationship. 和以前一樣,我們提供更多的有意義的動詞短語的關系 As before, since each employee may be associated with zero, one or more inspections, we choose the corresponding cardinality. 和以前一樣,因為每個員工可能伴有零,一個或多個檢查,我們選擇相應的行集數(shù) Unlike before, when we chose the identifying relationship type, we have now chosen the non-identifyin

50、g relationship type. 不同于以往的,當我們選擇了識別關系類型,我們現(xiàn)在已經選好了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, d

51、oes each child entity occurence (Inspection) have to be associated with a parent entity occurence (Employee)? 換句話說,每一個孩子的實體(檢查)發(fā)生有助于家長實體發(fā)生(雇員)嗎? In this case, the answer yes. Each inspection must be carried out by an employee, or it is not considered a proper inspection. 在這種情況下,答案是的。每項考核必須執(zhí)行一個雇員,或并不

52、被認為是一個適當?shù)臋z驗。 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.員工

53、和辦公室也參與相互認識 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 n

54、ot 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

55、 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.每間辦公室的行集數(shù)表明,伴隨著一個或多個(但不是零)的雇員。 The Relationship Type indicates that this is a non-identifying relationship, and that Nulls are not permitted.他的關系類型顯示,這是一個non-identifying關系,

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論