Previous | Table of Contents | Next

Page 546

Figure 20.12.
First window
displayed by Genera-
tion Wizard.

Figure 20.13.
Sending DDL
statements to a file.

At this point, you can click Finish to generate the SQL file. If no errors occurred, a dialog window will indicate that no processing errors occurred. On the progress meter, click Done to proceed (see Figure 20.15).

Page 547

Figure 20.14.
Specifying the
database objects to be
generated.

Figure 20.15.
Progress meter
displayed by Genera-
tion Wizard.

If you look on the Taskbar, you will see that Database Designer has opened the Notepad with the generated SQL file (see Listing 20.1).

Listing 20.1. SQL file generated by Generation Wizard.

-- C:\TYO\TYO.SQL
--
-- Generated for Oracle 7 on 12/5/1997 17:47:07 by Oracle Database
ÂDesigner v1.00
/* Source Diagram Details:
 * Name C:\TYO\TYO.ODD  created 6/4/1997 18:55:25
 * Last modified 11/5/1997 22:51:13
 */


CREATE TABLE DEPARTMENT
 (DEPARTMENT_ID  VARCHAR2(20) NOT NULL
 ,DESCRIPTION  VARCHAR2(25)
 );

CREATE TABLE INSTRUCTOR
 (INSTRUCTOR_ID  VARCHAR2(20) NOT NULL
 ,LAST_NAME  VARCHAR2(25) NOT NULL

                                                              continues

Page 548

Listing 20.1. continued

 ,FIRST_NAME  VARCHAR2(25)
 ,MI  VARCHAR2(1)
 ,POSITION  VARCHAR2(25) NOT NULL
 ,TELEPHONE  VARCHAR2(10)
 ,FAX  VARCHAR2(10)
 ,EMAIL  VARCHAR2(100)
 ,DEPARTMENT_ID  VARCHAR2(20) NOT NULL
 );

ALTER TABLE DEPARTMENT
 ADD CONSTRAINT DEPARTMENT_PK PRIMARY KEY
  (DEPARTMENT_ID) ;

ALTER TABLE INSTRUCTOR
 ADD CONSTRAINT INSTRUCTOR_PK PRIMARY KEY
  (INSTRUCTOR_ID) ;

ALTER TABLE INSTRUCTOR
 ADD CONSTRAINT DEPARTMENT_FK
 FOREIGN KEY
  (DEPARTMENT_ID)
 REFERENCES DEPARTMENT
  (DEPARTMENT_ID)
;

Using Database Designer to Reverse
Engineer an Oracle Database

Database Designer will also reverse engineer a data model from several sources—an SQL file containing DDL statements, an ODBC data source, or an Oracle database. The capability to reverse engineer a data model is sometimes necessary. As a developer, you may be provided with a legacy database without any accompanying documentation. By reverse engineering the legacy database, Database Designer can construct a diagram that will aid you in your understanding the legacy data model. You are then able to reengineer the model—perhaps adding additional entities and attributes—by using the legacy data model as a baseline. Let's go through the steps that are needed to reverse engineer a data model from an SQL file.

  1. To invoke the Reverse Engineer Wizard, select Tools | Reverse Engineer Wizard from the menu.
  2. On the window that appears, you can select the source to be used for reverse engineering:

Page 549

  1. By default, the Reverse Engineer Wizard assumes that you want to reverse engineer a data model using an SQL file as the source. To select a particular SQL file, you can enter the filename directly or use Browse to select the SQL file.
  2. As you can see in Figure 20.16, the Reverse Engineer Wizard also assumes that the source reflects an Oracle7 database—in other words, the DDL statements in the SQL file were intended to be applied against an Oracle7 database.

Figure 20.16.
Reverse Engineer
Wizard prompts for
the source to be used
to reverse engineer a
data model.

  1. After you have specified an SQL file, click Finish to proceed with the reverse-engineering process.
  2. A progress meter will appear, displaying messages about the objects that it is constructing from the SQL file. If there are no errors during the reverse- engineering process, a window will notify you that there were no processing errors.
  3. To view the data model, click Done on the progress meter.

TIP
As you can see in Figure 20.17, the Reverse Engineer Wizard will construct the objects based on the objects referenced in the SQL file. However, you may need to rearrange some of the objects; some of them may be overlapping, making it difficult to read the diagram. You may want to print the diagram to see all the objects and their relationships.

Page 550

Figure 20.17.
Diagram constructed
by Reverse Engineer
Wizard.

The Basics of Designer/2000

The components of Designer/2000 can be grouped into these categories:

Let's discuss the role that some of these components play in the application-development process. To initially create a new application, you use the Repository Object Navigator and select File | New from the menu. A new application is created, which is named Flugle (see Figure 20.18).

Page 551

Figure 20.18.
Creating a new
application with the
Repository Object
Navigator.

Process Modeller

Process Modeller is a tool that enables you to graphically describe the business processes that you are interested in modeling. Initially, Process Modeller is used to understand the processes as they currently exist. The tool is able to animate a process, making the dynamics more easily understood. From an understanding of the current processes, the processes can be redesigned to reduce cycle time or eliminate unnecessary steps.

Entity Relationship Diagrammer

Entity Relationship Diagrammer is similar to Database Designer but offers more features. Specifically, Entity Relationship Diagrammer distinguishes between the logical data model—composed of entities, attributes, domains, and relationships—and the physical database design—composed of tables, columns, views, constraints, and other objects. Like Database Designer, Entity Relationship Diagrammer enables the designer to graphically depict the data model. Like the other components of Designer/2000, Entity Relationship Diagrammer uses the Designer/2000 Repository for storing the data models for each application.

Function Hierarchy Diagrammer

You use the Function Hierarchy Diagrammer to graphically describe the hierarchy of business functions performed by an organization. For example, at the highest level, you might describe a function named Manage Human Resources. Within that function, there are lower-level functions such as Recruit New Instructors, Hire New Instructors, and so on. With the

Previous | Table of Contents | Next

Используются технологии uCoz