SQL Developer Data Modeler (SDDM) is a full function data modeling tool provided for FREE by Oracle. It has many features built in that can be leveraged to capture the design of an existing (probably undocumented) database, retrofit it to a logical model, re-engineer it to multiple physical models (including multi-dimensional), and even apply standards, then generate revised DDL to implement your newly standardized design. You can even use one logical model to develop multiple physical models that can be deployed to different RDBMS. The presentation will provide step-by-step instructions on how to do all this so the attendees can go back to the office and quickly create diagrams of all their existing databases (Oracle and non-Oracle!). See more content like this by following my blog http://kentgraziano.com or follow me on twitter @kentgraziano.
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Reverse Engineering an Existing Database Using Oracle SQL Developer Data Modeler
1. Data Warrior LLC
Reverse Engineering (and Re-Engineer) an
Existing Database Using Oracle SQL
Developer Data Modeler
Kent Graziano
Data Warrior LLC
http://kentgraziano.com #Kscope
2. Data Warrior LLC
Agenda
Bio
Reverse Engineering
Logical Model
Forward Engineer Changes
Generate DDL
Multidimensional Model
Cool Features
Demo, demo, demo
http://kentgraziano.com #Kscope
3. Data Warrior LLC
My Bio
Oracle ACE (BI/DW)
Certified Data Vault Master
Data Architecture and Data Warehouse Specialist
Co-Author of
● The Business of Data Vault Modeling (2008)
● The Data Model Resource Book (1st Edition)
● Oracle Designer: A Template for Developing an Enterprise Standards
Document
Past-President of ODTUG and Rocky Mountain Oracle User
Group
Co-Chair BIDW SIG for ODTUG
KScope12 Fitness Guru
http://kentgraziano.com #Kscope
4. Data Warrior LLC
Install
Mui Easy!
Download, unzip, execute!
● http://www.oracle.com/technetwork/developer-
tools/datamodeler/overview/index.html
The best part – it is Free!
http://kentgraziano.com #Kscope
5. Data Warrior LLC
Reverse Engineering
Called Import
● From Data Dictionary
● From DDL files
http://kentgraziano.com #Kscope
6. Data Warrior LLC
Importing a Model (Reverse Engineering)
http://kentgraziano.com #Kscope
7. Data Warrior LLC
Importing from DDL
Select Import -> DDL
Click green “+” to add a file to import
Pick text file with DDL from browser
Click OK
Specify what DB the DDL came from
Navigate the Merge wizard to select what to
import
● Press Merge button
http://kentgraziano.com #Kscope
8. Data Warrior LLC
Supported Databases to Import
http://kentgraziano.com #Kscope
9. Data Warrior LLC
Merging the Import
http://kentgraziano.com #Kscope
11. Data Warrior LLC
Adding in FKs
Many times existing DBs have no FKs
● Use the NEW “Discover Foreign Keys”
● Or draw them in by hand
Automatically tries to generate a new
migrating column in the target table
● Will only show candidate columns with exact
data type and size match
● If you select an existing column, it will not
save the generated column
http://kentgraziano.com #Kscope
12. Data Warrior LLC
Discover FKs (New Feature)
http://kentgraziano.com #Kscope
14. Data Warrior LLC
Creating the Logical Model
One button push!
● Creates entities
● All upper case
● Creates Attributes
● Retains case like relational model
http://kentgraziano.com #Kscope
15. Data Warrior LLC
Creating the Logical Model
http://kentgraziano.com #Kscope
16. Data Warrior LLC
Creating the Logical Model
● Creates relationships
● Using Barker Notation
● Drops inherited PK columns
● Drops inherited FK column
● Using Bachman Notation or Information
Engineering
● Displays inherited attributes
● Can change notation on the fly with right mouse
menu
● Keeps layout of physical model!
http://kentgraziano.com #Kscope
17. Data Warrior LLC
Logical Model - Barker
http://kentgraziano.com #Kscope
18. Data Warrior LLC
Logical Model - Bachman
http://kentgraziano.com #Kscope
19. Data Warrior LLC
Forward Engineering Changes
Edit the Logical
● Add relationship names
● Change or add attributes
● Add new entities
● Add new relationships
Press the ‘engineer to relational model’ button
● Check dialog for changes
● Uncheck any unwanted changes
http://kentgraziano.com #Kscope
20. Data Warrior LLC
Engineer to Relational
http://kentgraziano.com #Kscope
21. Data Warrior LLC
Generating New DDL
Use the new Reconcile button to sync the
database and the model
● Get Compare dialog to select what to change
Will generate alters if appropriate
● New columns
● Change in mandatory setting
Will generate a complete replacement script
that copies existing data
● Change in data type or precision
http://kentgraziano.com #Kscope
22. Data Warrior LLC
Generate Sync Changes
http://kentgraziano.com #Kscope
23. Data Warrior LLC
Sync DDL (Alter)
ALTER TABLE HR.COUNTRIES
MODIFY ( COUNTRY_NAME NOT NULL )
;
ALTER TABLE HR.COUNTRIES ADD
( Country_Abbreviation VARCHAR2 (4) NOT NULL )
;
ALTER TABLE HR.JOBS
MODIFY ( MIN_SALARY NOT NULL )
;
ALTER TABLE HR.REGIONS
MODIFY ( REGION_NAME NOT NULL )
;
http://kentgraziano.com #Kscope
24. Data Warrior LLC
Sync DDL (Recreate)
ALTER TABLE HR.JOBS RENAME TO bcp_JOBS
;
CREATE TABLE HR.JOBS
(
JOB_ID VARCHAR2 (10 BYTE) NOT NULL ,
JOB_TITLE VARCHAR2 (35 BYTE)
CONSTRAINT JOB_TITLE_NN NOT NULL ,
MIN_SALARY NUMBER (20) NOT NULL ,
MAX_SALARY NUMBER (6)
)
;
INSERT INTO HR.JOBS
(JOB_ID , JOB_TITLE , MIN_SALARY , MAX_SALARY )
SELECT
JOB_ID , JOB_TITLE , MIN_SALARY , MAX_SALARY
FROM
bcp_JOBS
;
http://kentgraziano.com #Kscope
25. Data Warrior LLC
Building a Multidimensional Model
Create from 3NF Logical
Model
● Right mouse – New MDD
● Create Dimensions,
Levels, Hierarchies, Cubes
using MDD diagramming
icons
http://kentgraziano.com #Kscope
26. Data Warrior LLC
Build a Dimension (from Entity)
Create Dim container
Create Level or Levels
● Pick Entity to base Level on
● Pick Level Key and Attributes
Link 1st Level to Dimension
Link other levels together to build hierarchies
Dim levels can be from different entities
Right mouse option to Engineer to Oracle
Model
● Creates Oracle Dimensions in physical model
http://kentgraziano.com #Kscope
27. Data Warrior LLC
Build a Dimension
http://kentgraziano.com #Kscope
28. Data Warrior LLC
Cool Multidimensional Diagram!
http://kentgraziano.com #Kscope
29. Data Warrior LLC
Convert to Tables
http://kentgraziano.com #Kscope
30. Data Warrior LLC
Other Cool Features
Can have
● Multiple Relational Models
● From one logical
● Multiple Physical Designs
● Different database implementations from one relational
● Multiple dimensional models
Cool visual query builder for views
Real time view query tester
And much more….
http://kentgraziano.com #Kscope
31. Data Warrior LLC
Other Cool Features
Standards Enforcement
● Can define and apply design rules
● One button to check the whole model and all rules
● Rules checked when generating DDL
● Vary by RDBMS and version
● Even with errors it generates the code
http://kentgraziano.com #Kscope
33. Data Warrior LLC
The Good News
It’s FREE!
Easy to learn
● You can easily be productive in a few hours
Just read the dialog boxes to see all the
properties
Bonus: There is a also a process modeler
that does data flow diagrams!
Plus lots of other business related meta data
http://kentgraziano.com #Kscope
36. Data Warrior LLC
Contact Information
Kent Graziano
The Oracle Data Warrior
Data Warrior LLC
Kent.graziano@att.net
Visit my blog at
http://kentgraziano.com
http://kentgraziano.com #Kscope