Download presentation
Presentation is loading. Please wait.
Published byIsabel Bell Modified over 9 years ago
1
Copyright Oracle Corporation, 1999. All rights reserved. 5 CMIS 570 - Powell Oracle Designer: Design Editor and Building the Database and Table API CMIS 570 - Powell
2
8-2 Copyright Oracle Corporation, 1999. All rights reserved. Overview Design Editor – Purpose – Navigator + Work Surface – Modifying Properties Generating the Database Generating the Table API Design Editor – Purpose – Navigator + Work Surface – Modifying Properties Generating the Database Generating the Table API
3
8-3 Copyright Oracle Corporation, 1999. All rights reserved. Design Editor After you TRANSFORM your analysis models, use Design Editor to: – Refine the design of your database and your application modules – Generate the database and application modules After you TRANSFORM your analysis models, use Design Editor to: – Refine the design of your database and your application modules – Generate the database and application modules
4
8-4 Copyright Oracle Corporation, 1999. All rights reserved. Design Editor Format of the Design Editor tool: – Navigator – Work Surface Format of the Design Editor tool: – Navigator – Work Surface
5
8-5 Copyright Oracle Corporation, 1999. All rights reserved. The Navigator Server ModelModulesDB AdminDistribution APPLICATION[1] Relational Table Definitions View Definitions Snapshot Definitions Sequence Definitions Cluster Definitions PL/SQL Definitions Domains Data Diagram Navigator - Server Model Server ModelModulesDB AdminDistribution Database design and build Application design and build
6
8-6 Copyright Oracle Corporation, 1999. All rights reserved. Design Editor - SPEEDY[1] Navigator - Server Model Table Definitions CUSTOMERS ORDERS The Work Surface Create diagrams using drag and drop DSD1 EMPLOYEES DEPARTMENTS LASTNAME FIRSTNAME EMPNO EMPLOYEES_LOCATION EMPLOYEES_DEPTNAME LOCATION DEPTNAME DEPARTMENTS_EMPNO EMP_DEPT_FK ODR_CTR_FK CUSTOMERS ORDERS
7
8-7 Copyright Oracle Corporation, 1999. All rights reserved. The Server Model Diagram How to read it Making modifications to it prior to generating the database – Modifying table definitions – Setting a column default value How to read it Making modifications to it prior to generating the database – Modifying table definitions – Setting a column default value
8
8-8 Copyright Oracle Corporation, 1999. All rights reserved. The Server Model Diagram ITM_ODR_FK Table Foreign key ITEMS *QUANTITY oDISCOUNT *ODR_ID ORDERS # *ID oDELIVERED_TIME Primary key Column
9
8-9 Copyright Oracle Corporation, 1999. All rights reserved. PRODUCTS DESCRIPTION DISCOUNT_DAY PRODUCT_TYPE ID PHOTO *o**o*o**o Reading a Server Model Diagram Primary key Optionality Allowable values Datatype Sequence Domain
10
8-10 Copyright Oracle Corporation, 1999. All rights reserved. Modifying Design Properties To modify design properties, you can use either: – Property dialog box –Shows you the commonly used properties for the type of object selected – Property palette –Shows ALL the properties for the selected object Icon to toggle between dialog box vs. palette display To modify design properties, you can use either: – Property dialog box –Shows you the commonly used properties for the type of object selected – Property palette –Shows ALL the properties for the selected object Icon to toggle between dialog box vs. palette display
11
8-11 Copyright Oracle Corporation, 1999. All rights reserved. Property Dialog vs. Palette Commonly used properties All properties Use dialog boxUse palette Display properties
12
8-12 Copyright Oracle Corporation, 1999. All rights reserved. Setting a Default Value Column Properties Definition Default ValuePIZZA INSERT 101PIZZA Product TypeID
13
8-13 Copyright Oracle Corporation, 1999. All rights reserved. Setting a Default to SYSDATE To have a field default to the current date, in the properties palette: Set Default to SYSDATE Set Derivation Expression Type to “Function Call” Set Server Derived to “Yes” SAVE! To have a field default to the current date, in the properties palette: Set Default to SYSDATE Set Derivation Expression Type to “Function Call” Set Server Derived to “Yes” SAVE!
14
8-14 Copyright Oracle Corporation, 1999. All rights reserved. Practice 1 Use the Design Editor to view your HOLLYWOOD database design (server) model: Use property palette AND property dialog box to examine properties of the COPIES table Use property palette AND property dialog box to examine properties of a field in the COPIES table Get comfortable with the toggle between these two property displays Use the Design Editor to view your HOLLYWOOD database design (server) model: Use property palette AND property dialog box to examine properties of the COPIES table Use property palette AND property dialog box to examine properties of a field in the COPIES table Get comfortable with the toggle between these two property displays
15
8-15 Copyright Oracle Corporation, 1999. All rights reserved. Practice 2 Use Design Editor to make the following modifications to your HOLLYWOOD server model: Re-order fields to be in this order... – # primary key fields – * mandatory fields – o optional fields... By using the table properties dialog box, Columns tab, select a column name and use the screen arrows Use Design Editor to make the following modifications to your HOLLYWOOD server model: Re-order fields to be in this order... – # primary key fields – * mandatory fields – o optional fields... By using the table properties dialog box, Columns tab, select a column name and use the screen arrows
16
8-16 Copyright Oracle Corporation, 1999. All rights reserved. Practice 2 Set the ACQUIRE_DATE field of table COPIES to default to current date Save your Server Model Set the ACQUIRE_DATE field of table COPIES to default to current date Save your Server Model
17
8-17 Copyright Oracle Corporation, 1999. All rights reserved. Database Generation Preparing for generation Generating database objects Viewing online database objects Generating the Table API Preparing for generation Generating database objects Viewing online database objects Generating the Table API
18
8-18 Copyright Oracle Corporation, 1999. All rights reserved. The Results Tables CUSTOMERS LAST_NAME FIRST_NAME Constraints Indexes
19
8-19 Copyright Oracle Corporation, 1999. All rights reserved. Generating the Database Target DDL files Database ODBC Start... Direct connection Other Database
20
8-20 Copyright Oracle Corporation, 1999. All rights reserved. DO NOT DO THIS NOW !!! How We Generate The Database DO NOT DO THIS NOW !!! 1. Within Design Editor, view your Server Model 2. From the Generate pull-down menu, select “Generate Database from Server Model” 3. In the Target tab, set the “Target for Generation” radio button to “Database” and fill in your userid-password-connect as you do at logon 1. Within Design Editor, view your Server Model 2. From the Generate pull-down menu, select “Generate Database from Server Model” 3. In the Target tab, set the “Target for Generation” radio button to “Database” and fill in your userid-password-connect as you do at logon
21
8-21 Copyright Oracle Corporation, 1999. All rights reserved. How We Generate The Database (continued) 4. Fill in the directory with c:\temp 5. Select the Objects tab, and copy all the objects over to the right side (i.e., generate all objects) 6. Click the Start button 7. At pop-up, select “Execute DDL” 8. Look for message that there were no errors 4. Fill in the directory with c:\temp 5. Select the Objects tab, and copy all the objects over to the right side (i.e., generate all objects) 6. Click the Start button 7. At pop-up, select “Execute DDL” 8. Look for message that there were no errors
22
8-22 Copyright Oracle Corporation, 1999. All rights reserved. Viewing the Database After Generation Specify database connection holly@dev dev holly Tables CUSTOMERS ITEMS ORDERS PRODUCTS Views Snapshots Sequences Clusters Functions Packages holly@dev - Database Navigator File View Navigator Utilities View objects and properties View Tools Database Navigator
23
8-23 Copyright Oracle Corporation, 1999. All rights reserved. Practice 3 Generating the Database: ONE BY ONE !!! Generate the database through direct connection – Pass the “stress dollar” View resulting objects by using Tools Database Navigator Generating the Database: ONE BY ONE !!! Generate the database through direct connection – Pass the “stress dollar” View resulting objects by using Tools Database Navigator
24
8-24 Copyright Oracle Corporation, 1999. All rights reserved. Table API By generating the Table API: We generate needed procedures and triggers to go with the database, e.g.: – PL/SQL logic in the server that processes and validates data before inserts, updates, and deletes are executed on database tables –i.e., Logic to enforce referential integrity – Code to operationalize “server-derived” fields By generating the Table API: We generate needed procedures and triggers to go with the database, e.g.: – PL/SQL logic in the server that processes and validates data before inserts, updates, and deletes are executed on database tables –i.e., Logic to enforce referential integrity – Code to operationalize “server-derived” fields
25
8-25 Copyright Oracle Corporation, 1999. All rights reserved. Table API is Server-Side Logic Keeps the client applications “thin” Minimizes maintenance because logic is in one place Keeps the client applications “thin” Minimizes maintenance because logic is in one place Table API Tables Client Applications
26
8-26 Copyright Oracle Corporation, 1999. All rights reserved. Generating Table API Invoke from Design Editor Generates packages and triggers for tables Invoke from Design Editor Generates packages and triggers for tables Generate Tools Options Generate Module... Generate Module As... Generate Module... Generate Module As... Generate Table API... Captue Design Of Generate Database from Server Model... Generate Database Administration Objects... Generate Reference Code Tables... Generate Module Component API… Capture Application Logic...
27
8-27 Copyright Oracle Corporation, 1999. All rights reserved. How We Generate Table API 1. Still within Design Editor, select 1 or more table definitions 2. From the Generate pull-down menu, select “Generate Table API” 3. In the Target tab, select the “Database” radio button and enter your logon password 4. Click the Objects tab 5. Make sure all tables are moved to the right side. 1. Still within Design Editor, select 1 or more table definitions 2. From the Generate pull-down menu, select “Generate Table API” 3. In the Target tab, select the “Database” radio button and enter your logon password 4. Click the Objects tab 5. Make sure all tables are moved to the right side.
28
8-28 Copyright Oracle Corporation, 1999. All rights reserved. How We Generate Table API 6. Click the Start button 7. Look for message that says zero errors (you may have warning-level messages) 6. Click the Start button 7. Look for message that says zero errors (you may have warning-level messages)
29
8-29 Copyright Oracle Corporation, 1999. All rights reserved. The Generate Table API Dialog Box Generate Table API Objects Target Target for Generation File Oracle File Prefix Username Password Connect Username Password Connect Oracle8 Browse... Stop on error Stop on warning Generate Table API Triggers File Prefix Directory
30
8-30 Copyright Oracle Corporation, 1999. All rights reserved. Practice 4 ONE BY ONE !!! (pass the “Stress $”) – Generate your Table API – Use Design Editor option Tools Database Navigator to note the “Packages” and “Procedures” generated ONE BY ONE !!! (pass the “Stress $”) – Generate your Table API – Use Design Editor option Tools Database Navigator to note the “Packages” and “Procedures” generated
31
8-31 Copyright Oracle Corporation, 1999. All rights reserved. Summary To build the physical database from the server model: Use Server Generator to generate database objects View results thru Design Editor pull-down option Tools Database Navigator Generate the Table API To build the physical database from the server model: Use Server Generator to generate database objects View results thru Design Editor pull-down option Tools Database Navigator Generate the Table API
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.