Erwin Tutorial: Erwin Workplace Consists of The Following Main Areas
Erwin Tutorial: Erwin Workplace Consists of The Following Main Areas
All Fusion Erwin Data Modeler commonly known as Erwin, is a powerful and leading data
modeling tool from Computer Associates. Computer Associates delivers several software for
enterprise management, storage management solutions, security solutions, application life
cycle management, data management and business intelligence.
Erwin makes database creation very simple by generating the DDL(sql) scripts from a data
model by using its Forward Engineering technique or Erwin can be used to create data
models from the existing database by using its Reverse Engineering technique.
• Logical: In this view, data model represents business requirements like entities,
attributes etc.
• Physical: In this view, data model represents physical structures like tables, columns,
datatypes etc.
• Modelmart: Many users can work with a same data model concurrently.
In order to create data models in Erwin, you need to have this All Fusion Erwin Data Modeler
installed in your system. If you have installed Modelmart, then more than one user can work
on the same model.
How to create a Logical Data Model using CA Erwin Data Modeler Version 9?
In the following section, a simple example with a step by step procedure to create a logical
data model with two entities and their relationship are explained in detail.
The Logical Data Model created by following the above steps looks similar to the
following diagram.
• SAVE: To save the file, click save button in the 'standard' tool bar and save it as
.'CA_Erwin_Data_Modeler_v9_example' and file type will be .erwin.
How to create a Physical Data Model using CA Erwin Data Modeler Version 9?
• Change the view from 'Logical to Physical' from the drop down list.
• If you want to add some physical properties, you can add it here.
Explanation:
In the logical view: When you right click and view entity properties for entity 'Country', you
can see tabs like volumetrics, definition, style, icon, where used, UDP, NOTES etc. The
information that you fill will explain about entity properties.
In the physical view: when you right click and view table properties for table 'country', you
can see tabs like table options, general, partitions, supplemental logging, validation,
materialized view log, style, icon, synonym comment, object creation order, where used,
UDP, Notes etc. If you are an expert, then you can fill relevant details in the above mentioned
tabs so that it will be useful while creating scripts. If you are not an expert, you can discuss
with DBAs, get relevant information and fill details.
Click menu 'edit'. Navigate to 'selection' and click 'select all'. Objects bank and country will
be highlighted.
Click the 'forward engineer schema generation' icon in the 'database' tool bar. A new Wizard
appears.
There are two boxes. On the left side box, you can several database objects. On the right side
box, you can see different options for each object.
Click preview. You can see the sql code generated by Erwin data modeler tool.
In the following section, a simple example with a step by step procedure to create a logical
data model with two entities and their relationship are explained in detail.
1: Open All Fusion Erwin Data Modeler software.
2: Select the view as "Logical" from the drop-down list. By default, logical will be your
workplace.
3: Click New from File menu. Select the option "Logical/Physical" from the displayed
wizard. Click Ok.
4: To create an Entity, click the icon "Entity" and drop it on the workplace. By default E/1
will be displayed as the entity name. Change it to "Country".
5: To create an Attribute, Place the cursor on the entity "Country" and right click it. From
the displayed menu, click attributes which will take you to the attribute wizard. Click "New"
button on the wizard and type attribute name as "Country Code". Select the data type as
"String" and click OK. Select the option Primary Key to identify attribute "Country Code"
as the primary key. Follow the same approach and create another attribute "Country Name"
without selecting the primary key option. Click ok, and now you will be having 2 attributes
Country Code, and Country Name under the entity "Country" in the current logical
workplace.
6: Create another entity "Bank" with two attributes namely Bank Code and Bank Name by
following steps 4 and 5.
7: In order to relate these two tables country, bank, a Foreign Key relationship must be
created. To create a Foreign Key relationship, follow these steps.
(a) Click the symbol "Non Identifying Relationship".
(b) Place the cursor on the entity "Country".
(c) Place the cursor on the entity "Bank". Now you can see the relationship(a line drawn from
Bank to Country) between "Country" and "Bank". Double click on that relationship line to
open "Relationships wizard" and change the option from "Nulls Allowed" to "No Nulls"
since bank should have a country code.
The Logical Data Model created by following the above steps looks similar to the following
diagram.