Você está na página 1de 3

INFO 607, Drexel University, Il-Yeol Song

Instructions for Using ERwin ERwin Facts


ERwin is a graphical data modeling tool that allows a Manufacturer: Computer Associates
modeler to use information requirements and business Current Version: 3.5.2
rules to create a logical and physical data model. First Release: 1990
Latest Release: August 1998
ERwin supports two modeling notations: Integration
Definition for Information Modeling (IDEF1X) and Information Engineering (IE).

Getting Started
The logical and physical models are tightly linked. Making a change in one model
affects the other and vice versa.

Default Settings

 The Option menu item is where you will find the setting for the modeling environment. This is where
you can set your model preferences.
 The menu items/icons are context sensitive depending on whether the program is in logical or
physical mode.
 The Option Menu contains settings related to the ERwin environment.
 IDEF1X is the default (logical and physical) methodology for new diagrams. The methodology can be
changed by clicking on Options-Preferences and selecting the Methodology tab.
 Diagram Display Options
o ERwin provides diagram display options, or different views of the same underlying model,
to be used for different presentation purposes. For example, the diagram shown to a
group of technical staff could (and should) be different than the diagram presented to
business people.
o To create different views, called Stored Displays in ERwin, click on Edit - Stored Display.
 You can save any model as a template to preserve its settings and contents for use in creating other
data models. To do this, select the Save As option and select ERwin Template (*.ert). When doing
this in the CRC, be sure to save your template to a disk or other removable media.

Tools

 The IDEF1X toolbars are shown at the right.


 ERwin works like graphic programs such as Corel or
Illustrator. First, you click on the tool and then create or logical physical
select an object by clicking.

Best Practice

 Use of color to impart meaning


o Keep background set to white
o Set the font for migrating foreign keys to red to make them easy to identify
o Use a common entity fill color to group entities together
o Avoid using color that does not impart meaning
o Put entity names in ALL CAPS

Entities/Tables
 The Independent Entity/Table Tool creates dependent entities in the logical model, and tables in the
physical model. An entity is independent or dependent depending on the type of relationships it has
with other entities. An entity is always independent when it is first created.

Page 1 of 1
INFO 607, Drexel University, Il-Yeol Song

 Entities are created by clicking on the Entity Tool and then clicking on the workspace.
 Entities are represented by rectangles
 Entities may be independent or dependent
o independent (sharp corners)
does not need information from
another entity to identify a unique
instance
o dependent (rounded corners)
must have information from
another entity to identify a unique
Representation of independent vs. dependent entities in
instance ERwin. Employee is independent. Dependent is dependent.

Relationships
 In ERwin, a relationship between two entities, or between an entity and itself, is one of the following
types:
o identifying relationship (FK is part of PK)
o non-identifying relationship (FK is not part of PK)
o subtype relationship
o many-to-many relationship
o recursive relationship
 The Identifying Relationship Tool is used to create a relationship between two entities in the logical
model, or two tables in the physical model.
o To create an identifying relationship, click the Identifying Relationship Tool in the ERwin
toolbox, click the parent, and then click the child. To edit the relationship, right-click the
relationship line to use the Relationship Editor.
 The Many-to-Many Relationship Tool is used to create a relationship between two entities in the
logical model only as many-to-many relationships are not currently supported by existing commercial
database systems. ERwin automatically creates an associative entity to resolve many-to-many
relationships when the model is changed from logical to physical mode.
 Use the Non-Identifying Relationship Tool to create a relationships between two entities in the logical
model and two tables in the physical model.
 Subtype relationships can be created using the Subtype Relationship Tool. Note that although
subtype notation is represented in a similar manner for IE and IDEF1X, there is a significant
difference in the definition of complete/incomplete and exclusive/inclusive. Refer to help for details.

Attributes & Primary Keys


 Attributes are created using the Attribute Editor.
 The Attribute Editor is invoked by double clicking on the entity or right clicking and choosing Attribute
Editor.
 The Attribute Editor is where the primary key is set.

Schema Generation
 Forward engineering/schema generation is a feature of ERwin. It can create the physical data
structures from the physical model, including tables, columns, triggers, stored procedures, and
platform specific database objects. You can connect ERwin to the target server and create the data
structures directly in the database. Or you can generate a Data Definition Language (DDL) script that
is run as a separate step on the server to create the data structures.

Page 2 of 2
INFO 607, Drexel University, Il-Yeol Song

 You can save the DDL script for your target server in a standard ASCII text file. When you click the
Report button on the Schema Generation Report Editor, ERwin displays the Generate <Database>
SQL Schema Report dialog.
 Type a name for the DDL script file in the File name text box. You can save the file with the default
.ers (ERwin SQL) extension or type the file name with the SQL extension if your target server or SQL
processor requires it.
 ERwin saves the schema as a text file. After ERwin saves the file, you can edit the file in a text editor
and run it against the database using a utility that interprets SQL scripts, such as SPUFI for DB2,
ISQL for SQL Server, SQL *DBA for ORACLE, or SQLTalk for SQLBase.
 ERwin creates a script file for Access, dBASE, FoxPro, Clipper, and Paradox using forward
engineering. Unlike SQL databases, however, you cannot use this script for reverse engineering.
These databases can be reverse engineered directly from the .mdb or .dbf database files.

Reverse Engineering
 ERwin can interpret the information in your database or script file and automatically create logical
and physical models.
 You can edit or enhance the resulting diagram as needed. You can reverse engineer all or part of an
existing database. The quality of a reverse-engineered logical model varies depending on the amount
of logical information carried in your logical schema.
 Physical database objects that are reverse-engineered include: tables, columns, datatype and length,
triggers, stored procedures, validation rules, and comments.
 It is important to remember that a reverse-engineered model is a physical model. The logical model
needs work. Logical names are abbreviated physical names, and physical comments for tables and
columns are often limited or absent.
 ERwin allows you to reverse engineer a diagram using the following methods: connecting to a
database, reading a script file, or opening a file. Note that you might need to enter a password to
connect to an Access database, even if a password was not specified. In such a case, use 'admin' as
the password.

Report Generation
ERwin has a robust set of reporting Department
capabilities. You can report on any object D#

class in a diagram. ERwin includes a set of DNAME

standard reports, and you can create custom


reports as well. You can select objects and
copy to the Windows clipboard for Employee Project
Dependent Works On
SSN P#
DEP_NUM
presentation purposes by selecting an entity SSN (FK) D# (FK)
SSN (FK)
P# (FK) D# (FK)
NAME PNAME
or entities, clicking on the Edit - Copy SEX
EMPLOYEE_TYPE HOURS INTERNAL_PROJ
FUNDED_PROJ
command and then choosing 'Picture'. The
pasted image can then be placed into Word,
and other software, as was done to create the diagram at the above right.

ERwin Resources:
The ERwin section of the CA Web Site (http://www.cai.com/products/alm/erwin.htm)

The ERwin Online Tutorial that is provided by ERwin Help

Data Modeling With ERwin, M. Carla DeAngelis, Sams Publishing 2000

Page 3 of 3

Você também pode gostar