Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright  Oracle Corporation, 1999. All rights reserved. 4 CMIS 570 - Powell Oracle Designer: Creating the Database Design CMIS 570 - Powell.

Similar presentations


Presentation on theme: "Copyright  Oracle Corporation, 1999. All rights reserved. 4 CMIS 570 - Powell Oracle Designer: Creating the Database Design CMIS 570 - Powell."— Presentation transcript:

1 Copyright  Oracle Corporation, 1999. All rights reserved. 4 CMIS 570 - Powell Oracle Designer: Creating the Database Design CMIS 570 - Powell

2 7-2 Copyright  Oracle Corporation, 1999. All rights reserved. Setting the Scene Surely, we must be ready to begin the database design. You’re right. Let’s begin. We don’t have to do this by hand, do we?

3 7-3 Copyright  Oracle Corporation, 1999. All rights reserved. Overview Final checks are important! Data model transformation – Entities and attributes – Relationships Primary and foreign key constraints Benefits of automating the process The Database Design Transformer (DDT) Final checks are important! Data model transformation – Entities and attributes – Relationships Primary and foreign key constraints Benefits of automating the process The Database Design Transformer (DDT)

4 7-4 Copyright  Oracle Corporation, 1999. All rights reserved. Final Checks! Check each Entity: – Should have a set of attributes – Should be in at least one relationship – Should have a primary key – Should be used by at least one function Check each Entity: – Should have a set of attributes – Should be in at least one relationship – Should have a primary key – Should be used by at least one function

5 7-5 Copyright  Oracle Corporation, 1999. All rights reserved. Final Checks! Check each Attribute: – Should have at least format, length, and optionality specified Check each Relationship: – Should be accurate in its degree and optionality Check each Attribute: – Should have at least format, length, and optionality specified Check each Relationship: – Should be accurate in its degree and optionality

6 7-6 Copyright  Oracle Corporation, 1999. All rights reserved. Repository Reports for Final Checks “Quality” Reports: Entity Completeness Checks Function Completeness Checks “E/R Modeling” Reports: Entity Definition Attribute Definition Attributes in a Domain

7 7-7 Copyright  Oracle Corporation, 1999. All rights reserved. Final Checks! Based on the checklist, we need to: – Add a unique identifier to the COPY entity Let’s call it COPY NUMBER and set it as: Mandatory, Primary, VARCHAR2 length of 6 – Add a unique identifier to the SUPPLIER entity Let’s call it SUPPLIER ID and set it as: Mandatory, Primary, VARCHAR2 length of 6 Let’s do it now... Based on the checklist, we need to: – Add a unique identifier to the COPY entity Let’s call it COPY NUMBER and set it as: Mandatory, Primary, VARCHAR2 length of 6 – Add a unique identifier to the SUPPLIER entity Let’s call it SUPPLIER ID and set it as: Mandatory, Primary, VARCHAR2 length of 6 Let’s do it now...

8 7-8 Copyright  Oracle Corporation, 1999. All rights reserved. Where We Have Come From CUSTOMER # ID * LAST NAME... ORDER # ID * ORDER DATE... originator of for

9 7-9 Copyright  Oracle Corporation, 1999. All rights reserved. Where We Are Going CUSTOMERS # * ID * LAST_NAME... ORDERS # * ID * ORDER_DATE... * CTR_ID Table Primary key column Columns Foreign key Foreign key column

10 7-10 Copyright  Oracle Corporation, 1999. All rights reserved. The Data Design Model DDT does not generate SQL Data Design Model consists of table definitions Table definitions are later input to the Database Generator to create the SQL to define the physical database DDT does not generate SQL Data Design Model consists of table definitions Table definitions are later input to the Database Generator to create the SQL to define the physical database ERD Analysis Model ERD Analysis Model Data Design Model Data Design Model DDT

11 7-11 Copyright  Oracle Corporation, 1999. All rights reserved. Transforming Entities and Attributes Analysis Model Design Model + Entity + CUSTOMER + Attributes + LAST NAME + Unique Identifier + Table + CUSTOMERS + Columns + Primary Key + LAST_NAME CUSTOMERS #* ID *LAST_NAME *STREET oPOSTAL_CODE CUSTOMER #ID * LAST NAME *STREET oPOSTAL CODE

12 7-12 Copyright  Oracle Corporation, 1999. All rights reserved. Transforming Relationships CUSTOMER ORDER # ID... originator of for CUSTOMERS ORDERS # * ID * CTR_ID... # ID... Mandatory Not Null ORD_CTR_FK

13 7-13 Copyright  Oracle Corporation, 1999. All rights reserved. Transforming a Foreign Key A foreign key column is created in the “many” table – Matches the primary key of the referenced table – Foreign key column is named: _ A foreign key constraint is created and associated with the new foreign key column – Constraint object is named: _ _FK A foreign key column is created in the “many” table – Matches the primary key of the referenced table – Foreign key column is named: _ A foreign key constraint is created and associated with the new foreign key column – Constraint object is named: _ _FK

14 7-14 Copyright  Oracle Corporation, 1999. All rights reserved. Transforming a Foreign Key CUSTOMERS ID # * ID * LAST_NAME... ID is a primary key column: – Identifies a customer uniquely – Cannot be null ORDERS CTR_ID # * ID... CTR_ID CTR_ID is a foreign key column: – Same size and type as CUSTOMERS.ID CTR_ID is a foreign key column: – Same size and type as CUSTOMERS.ID ORD_CTR_FK is the foreign key constraint

15 7-15 Copyright  Oracle Corporation, 1999. All rights reserved. Benefits of an Automated Tool Enforces standards – Naming conventions – Standard results Saves development time Eliminates repetitive work Eliminates careless errors Allows for changes in analysis Enforces standards – Naming conventions – Standard results Saves development time Eliminates repetitive work Eliminates careless errors Allows for changes in analysis

16 7-16 Copyright  Oracle Corporation, 1999. All rights reserved. Selecting Entities to Transform Entities 5 Tables (Mapped) All entities Selected entities ERD Front panel ITEM * ORDER #

17 7-17 Copyright  Oracle Corporation, 1999. All rights reserved. Using the Tool Customize the Database Design Transformer Settings Run the Transformer in Default Mode Mode Run Help Show Run Set Selected entities All entities Customize the Database Design Transformer Run options Settings that rarely change Modes for entity selection Summary of run set 0 Entities 5 Tables (Mapped) Run options

18 7-18 Copyright  Oracle Corporation, 1999. All rights reserved. How We Will Run The DDT Initiate from the Designer launchpad Select “Default Mode” and “All Entities” Click “Run” to initiate the DDT When DDT has finished processing: – Close the “Output” window – Select “Customize the DDT” to access the “Table Mappings” and “Other Mappings” tabs –Here, you can see the detailed results of the DDT run Initiate from the Designer launchpad Select “Default Mode” and “All Entities” Click “Run” to initiate the DDT When DDT has finished processing: – Close the “Output” window – Select “Customize the DDT” to access the “Table Mappings” and “Other Mappings” tabs –Here, you can see the detailed results of the DDT run

19 7-19 Copyright  Oracle Corporation, 1999. All rights reserved. Viewing the Results Output Window Mappings tabs ITEMS PRICED_PRODU Table Mappings Entity PRODUCT PRICED PRODUCT ORDER ITEM ORDERS PRODUCTS PRICED_PRODU ITEMS CUSTOMER CUSTOMERS Other Mappings committing changes… committed successfully updating dialog… Loading Tables from the Reposi CUSTOMERS ITEMS ORDERS PRICED_PRODUCT PRODUCTS ----------------------------------------- …………………………………... …………………………………... Waiting for Close to be pressed.. committing changes… committed successfully updating dialog… Loading Tables from the Reposi CUSTOMERS ITEMS ORDERS PRICED_PRODUCT PRODUCTS ----------------------------------------- …………………………………... …………………………………... Waiting for Close to be pressed..

20 7-20 Copyright  Oracle Corporation, 1999. All rights reserved. Summary Transform the analysis data model into a data design (i.e. table definitions) DDT automates the process Transform the analysis data model into a data design (i.e. table definitions) DDT automates the process EntityUIDAttributeRelationshipTable Primary or unique key Column Foreign key column and constraint

21 7-21 Copyright  Oracle Corporation, 1999. All rights reserved. Practice 1 1.View the entity relationship model 2.Write down your expected DDT results using Design Editor... 3.After running the DDT, examine the result – using Design Editor... 1.View the entity relationship model 2.Write down your expected DDT results using Design Editor... 3.After running the DDT, examine the result – using Design Editor...

22 7-22 Copyright  Oracle Corporation, 1999. All rights reserved. Intro to the Design Editor Tool 1.Initiate Design Editor from the Designer launchpad 2.Select “Server Model” (the default) and UN-check “Use a Guide” 3.Expand “Relational Table Definitions” 4.Use the shift key to select all 3 tables 5.Drag them to the “work surface” at right 6.Maximize the work surface window to study your model 7.Print this model out if you want to 1.Initiate Design Editor from the Designer launchpad 2.Select “Server Model” (the default) and UN-check “Use a Guide” 3.Expand “Relational Table Definitions” 4.Use the shift key to select all 3 tables 5.Drag them to the “work surface” at right 6.Maximize the work surface window to study your model 7.Print this model out if you want to


Download ppt "Copyright  Oracle Corporation, 1999. All rights reserved. 4 CMIS 570 - Powell Oracle Designer: Creating the Database Design CMIS 570 - Powell."

Similar presentations


Ads by Google