Post on 18-Nov-2014
description
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2
Oracle SQL Developer Data Modeler 3.3/4.0 New FeaturesPhilip Stoyanov Senior Software Development Manager
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
Legal
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
Agenda
Search, report and edit
References between relational models
Logical model – surrogate keys, relationships
Logical model – sub-typing
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
Agenda
DDL Generation - demo
DB Synchronization - demo
View definitions and Query Builder - demo
Next generation of Oracle Database – identity column
Next generation of Oracle Database - masking
Q/A
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
Search functionality – simple search
Simple and Advanced search :
Simple search:
• Just type the word you are looking for and all searchable
properties of all objects are checked for match; dynamic
properties are also checked
• Content of the property is checked, if property is another object
(Domain, Structured type, …) then the name of that object is
checked
• The name of the property is checked if content is “true”, “yes”, “y”
– using “partit” as search pattern on physical model will return all
partitioned tables
• Search could be triggered in two ways – set in preferences; could
be slow for large and complete designs
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
Search functionality – advanced search
Advanced search:
• Narrowed to specific object type and properties
• AND/OR expressions can be constructed
• Available at model level
Regular expressions can be used in both modes
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
Search functionality – global search
Global search:
• Spans all open designs and models
• Only simple search is available
• Located at top right corner in standalone version
• Available through menu “View>Data Modeler>Global
Search” in SQL Developer (with DM 3.3)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
Search functionality – global search
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
Search functionality – model level
Model level search:
Searches through the whole model not just current diagram
For relational model – searches through all open physical
models
Activated using “Find” icon on tool bar (or Ctrl-F on diagram)
or “Find” in context menu for the model in browser
Advanced mode can be used to search on specific
properties
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
Search functionality – result
Search result(model level) can be pinned, another window will appear on next
search
Search conditions can be saved and reused later
Search result can be filtered by model (in global search) and object type
Double click on a row in search result will bring up properties editor for that object
Selecting a row in result list will show diagrams where that object (or its container)
is used – double click on diagram will focus on object on that diagram
Filtering on model and object type will unlock another functionality – “Properties”
(setting common properties on objects) and “Reports”
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
Search functionality – result
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
Search functionality – setting common properties “Old Value” shows if there are common
properties set, empty otherwise
Three types of data – String (text), boolean
(true/false) and object (domain, schema/user,
tablespace …) – additional dialog appear to
select related object
More than one properties can be set at once
Data type can be only one of domain, logical
type, distinct type, structured type or collection
type
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
Search functionality – setting common properties
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
Search functionality – custom reports
Custom reports can contain only one type of objects –
columns, tables, entities, sequences… ; this is the
reason they are available only when search result is
filtered by model and object type
Report templates can be created for each type of object
Optimization on boolean values – true and false can be
replaced with provided constants
Supported formats – HTML, PDF, RTF and Excel (XLS,
XLSX)
Standard report can be generated on search result if
there is a standard report for objects in search result
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
Search functionality – custom reports, templates Up to 30 properties can be
included, properties in red are
read-only, those in blue could
be read-only when edited in
Excel
Order of columns and custom
names can be set
Sort order can be defined – by
Entity and Name in example
Column width is for HTML
reports
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
Search functionality – custom reports
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
Search functionality – custom reports, Excel file
Reports in XLS and XLSX format can be
edited in Excel
Read-only properties will remain read-only in
Excel
Properties that represent object (in blue in
template – domain, schema/user, tablespace
…) will be presented with look up field
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19
Search functionality – custom reports, Excel file Updated Excel file can be returned back to the
source model – context menu for the model in
browser
Verification that file is for the same model
Log will be generated for updates done during
import
Be aware that changes in data type of FK
column/attribute won’t be applied because they
inherit data type from referred column/attribute
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20
Engineering to relational model – surrogate keys
Default settings in preferences used when new
entity or relationship is created
Can be reset in entity/relationship dialog
Can be set on group of entities using search and set
common properties functionality
Table will get surrogate primary key in following
cases:– Set to related entity
– Set to relationship to use surrogate key
– Entity doesn’t have PK and relationship is referring that entity
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21
Engineering to relational model – surrogate keys
Default data type for
surrogate key column is
logical data type Numeric
without precision set.
Precision can be set in
preferences or domain can
be set to be used as column
data type
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22
Relationships
Can be bound to specific unique
identifier
Or set to use surrogate key – FK
attributes are not maintained in
this case
Added “transferable” property to
each relationship end
Delete rule is transferred to
foreign key in relational model as
it’s set
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23
Relationships, attributes
M:N relationship – attributes
become columns of intersection
table
1:N relationship attributes
become columns of child table;
for optional relationship -
additional constraint is required to
assure proper existence of these
columns; mandatory attributes
will be transformed into optional
columns
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24
Relationships, attributes
Dependent columns constraint is created
for start_date column; definition is also
manageable in column dialog
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25
Foreign key, DDL for dependent columns constraint – DM 4.0
ALTER TABLE employee ADD CHECK
(
( department_department_ID IS NULL AND start_date IS NULL) OR
(
department_department_ID IS NOT NULL AND start_date IS NOT NULL
)
)
;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26
Logical model – sub-typing and engineering to RM
Setting of engineering strategy in
entity dialog is removed –
“engineering strategy” property is
not used any more.
“Engineer to” property is used to
define which entity from hierarchy
will be transformed to table.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27
Logical model – sub-typing and engineering to RM
New page is added to
entity dialog with 3
sections:– for quick reset of “engineer
to“ property of current edited entity and its subtypes;
– for subtypes implementation;
– settings related to generation of discriminator column;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28
Logical model – sub-typing and engineering to RM“Sub-tree generation” has 4 options:
“Do not preset” – “engineer to” property won’t be changed when apply
/ok button is pressed
“Single” table” – “engineer to” property of current entity will be set to
selected and it’ll be cleared for all subtypes in current entity sub tree
"Table per child” - only leaves entities in current sub tree will be
selected for engineering, ‘engineer to” property for other entities will
be cleared
“Table for each entity” – all entities in current sub tree will be selected
for engineering
“Apply to model” - allow changes to “engineer to” property to be applied
for all relational models or to specific model
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29
Logical model – sub-typing and engineering to RMSubtypes implementation - defines additional
details on implementation of entity hierarchy
References:
None - no foreign keys are created
between tables
Arc implementation - optional foreign keys
(in arc ) from super-type to subtypes are
created. Arc is mandatory if subtypes
hierarchy is complete
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30
Logical model – sub-typing and engineering to RM
References:
Identifying - identifying foreign keys are
created from subtypes tables to super-
type table.
Reverse arc is created showing that
record in only one child table can exist
for each record in super-type table.
Arc is mandatory if subtypes hierarchy is
complete
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31
Logical model – sub-typing and engineering to RMMixed settings for references
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32
Logical model – sub-typing and engineering to RMDiscriminator column related settings
“Generate discriminator” - Discriminator column is generated if property is set
“Use attribute” - Allow existing attribute to be set to use as discriminator column
“Column name” - Defines the name of generated discriminator column. Name template is
used if name is not set Not used if discriminator attribute is set.
“Discriminator value” - Defines the value that is related to current entity and can exist in
discriminator column. Entity short name or entity name is used if not defined
“Complete subtypes” - Defines the list of subtypes as complete. Has impact on generated
arcs and list of possible values for discriminator column. If the list of subtypes is not complete
then optional arcs are generated and value for current entity is included in permitted list of
values for discriminator column.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33
Entity hierarchy – single table implementation
Mandatory attributes in sub-types become optional columns, existence dependency constraint is
generated in addition to LOV constraint generated for discriminator column
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34
Table – LOV constraint
ALTER TABLE TITLE ADD CONSTRAINT
CH_INH_TTE CHECK
(
TTE_TYPE IN ('MO', 'OF', 'ON’)
)
;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35
Table - existence dependency constraint, “single statement” level of DDL
ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep
CHECK ( (TTE_TYPE = 'MO' AND offg_oflg1 IS NULL AND GME_CATEGORY IS NULL AND GME_MEDIUM
IS NULL AND GME_MINIMUM_MEMORY IS NULL AND onlg_og1 IS NULL AND MVE_CATEGORY IS NOT
NULL AND MVE_DURATION IS NOT NULL AND MVE_MONOCHROME IS NOT NULL)
OR (TTE_TYPE = 'OF' AND GME_CATEGORY IS NOT NULL AND GME_MEDIUM IS NOT NULL AND
onlg_og1 IS NULL AND MVE_CATEGORY IS NULL AND MVE_AGE_RATING IS NULL AND MVE_DURATION
IS NULL AND MVE_MONOCHROME IS NULL AND MVE_AUDIO IS NULL AND MVE_PREVIEW IS NULL)
OR (TTE_TYPE = 'ON' AND offg_oflg1 IS NULL AND GME_CATEGORY IS NOT NULL AND GME_MEDIUM IS
NOT NULL AND MVE_CATEGORY IS NULL AND MVE_AGE_RATING IS NULL AND MVE_DURATION IS
NULL AND MVE_MONOCHROME IS NULL AND MVE_AUDIO IS NULL AND MVE_PREVIEW IS NULL)) ;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36
Table - existence dependency constraint
Three levels of
generation:
Single statement-
difficult to find what
is wrong if constraint
is violated (DDL on
previous page)
Discriminator value
Column
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37
Table - existence dependency constraint, “column” level of DDL ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep1
CHECK ( TTE_TYPE != 'MO' OR offg_oflg1 IS NULL )
;
ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep2
CHECK ( TTE_TYPE != 'MO' OR GME_CATEGORY IS NULL )
;
…………..
ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep26
CHECK ( TTE_TYPE != 'ON' OR MVE_PREVIEW IS NULL )
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38
Table - existence dependency constraint, “discriminator value” level of DDL ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep1
CHECK ( TTE_TYPE != 'MO'
OR ( offg_oflg1 IS NULL AND GME_CATEGORY IS NULL AND GME_MEDIUM IS NULL AND GME_MINIMUM_MEMORY
IS NULL AND onlg_og1 IS NULL AND MVE_CATEGORY IS NOT NULL AND MVE_DURATION IS NOT NULL AND
MVE_MONOCHROME IS NOT NULL)) ;
ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep2
CHECK ( TTE_TYPE != 'OF'
OR ( GME_CATEGORY IS NOT NULL AND GME_MEDIUM IS NOT NULL AND onlg_og1 IS NULL AND MVE_CATEGORY
IS NULL AND MVE_AGE_RATING IS NULL AND MVE_DURATION IS NULL AND MVE_MONOCHROME IS NULL AND
MVE_AUDIO IS NULL AND MVE_PREVIEW IS NULL)) ;
ALTER TABLE TITLE
ADD CONSTRAINT TTE_ExDep3
CHECK ( TTE_TYPE != 'ON'
OR ( offg_oflg1 IS NULL AND GME_CATEGORY IS NOT NULL AND GME_MEDIUM IS NOT NULL AND
MVE_CATEGORY IS NULL AND MVE_AGE_RATING IS NULL AND MVE_DURATION IS NULL AND
MVE_MONOCHROME IS NULL AND MVE_AUDIO IS NULL AND MVE_PREVIEW IS NULL)) ;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39
Next generation of Oracle Database – identity column DM supports identity (auto increment) columns in Oracle Database 11g through usage of
sequence and trigger and that’s a viable option. Native support for identity column at database
side just brings another option to consider
DM 4.0 will provide enough options to utilize new features of Oracle Database or stay with
sequence trigger approach
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40
Next generation of Oracle Database – identity column, Trigger – that’s the approach used before DM 4.0
CREATE TABLE Course
(
Course_ID NUMBER NOT NULL
) ;
ALTER TABLE Course
ADD CONSTRAINT Course_PK PRIMARY KEY ( Course_ID ) ;
CREATE SEQUENCE Course_Course_ID_SEQ
START WITH 1
NOCACHE
ORDER ;
CREATE OR REPLACE TRIGGER Course_Course_ID_TRG
BEFORE INSERT ON Course
FOR EACH ROW
WHEN (NEW.Course_ID IS NULL)
BEGIN
:NEW.Course_ID := Course_Course_ID_SEQ.NEXTVAL;
END;
/
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41
Next generation of Oracle Database – identity column – identity clause
CREATE TABLE Course
(
Course_ID NUMBER GENERATED BY DEFAULT AS IDENTITY
( START WITH 1 NOCACHE ORDER ) NOT NULL
)
;
ALTER TABLE Course
ADD CONSTRAINT Course_PK PRIMARY KEY ( Course_ID ) ;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42
Next generation of Oracle Database – identity column, default clauseCREATE SEQUENCE Course_Course_ID_SEQ
START WITH 1
NOCACHE
ORDER ;
CREATE TABLE Course
(
Course_ID NUMBER DEFAULT Course_Course_ID_SEQ.NEXTVAL NOT NULL
) ;
ALTER TABLE Course
ADD CONSTRAINT Course_PK PRIMARY KEY ( Course_ID ) ;
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43
Who’s looking at my sensitive data?
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44
Next generation of Oracle Database - masking
DM 4.0 will support 2 way of masking extending current support for defining and visualizing of
sensitive data
REDACTION policies - each redaction policy can operate only over one table providing
masking definition(s) and condition when it's applied for one or more columns belonging to
that table.
TSDP (Transparent Sensitive Data Protection) policies - TSDP policy can protect multiple
columns belonging to multiple tables, and more than one TSDP policies can be used to
protect columns belonging to one table. However it's important to note that TSDP policies
are implemented using Redaction policies and therefore it's not possible to have
Redaction policy and TSDP policy protecting one and the same table.
Implementation on both approaches starts with masking templates
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45
Redaction
Enables to mask (redact) data that is returned from the queries issued by low
privileged users or application Part of Oracle data security
Real-time works well in dynamic production environment
All referential-integrity of back-end data is preserved during the redaction process
Different masking styles through different policies
To comply with industry regulations Payment Card Industry Data Security Standard (PCI-DSS) Sarbanes-Oxley Act
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46
Oracle Data RedactionPartial
Before
After
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47
Masking Templates
Masking templates for Character, Numeric and Date columns can be defined
“Tools>Masking Templates Administration”
Used in Redaction and TSDP policies
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48
Redaction policy
Definition of masking type and masking template at column level
Only masking template related to column data type (Character, Numeric
and Date) are available for particular column
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.49
Redaction policy
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.50
TSDP policy
Following steps are required
1. Templates
2. To create sensitive type - sensitive types appear as kind of classification for associated with
them columns. Sensitive types are not "sensitive" to data type of columns associated to them.
3. Associate columns to sensitive type – directly from sensitive type dialog or through domain
defined as “sensitive”
4. To create TSDP policy
5. Associate sensitive types to TSDP policy
Templates, Sensitive types and TSDP policies can be used in all designs
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51
TSDP policy, sensitive type
Can be created in the browser
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.52
TSDP policy, sensitive type
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.53
TSDP policy, sensitive domain
Domain can be associated with “sensitive type” and later assigned to columns/attributes
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.54
TSDP policy, create
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.55
TSDP policy, sub-policies
It’s a collection of sub-policies – can be restricted to specific schema, table, data type
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.56
TSDP policy, sensitive types
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.57
Learn More.. SQL Developer Data Modeler on OTN - http://
www.oracle.com/technetwork/developer-tools/datamodeler SQL Developer Data Modeler forum https://
forums.oracle.com/forums/forum.jspa?forumID=1317 Oracle Learning Library
http://apex.oracle.com/pls/apex/f?p=44785:2:0:FORCE_QUERY::2,RIR,CIR:P2_TAGS:Data%20Modeler
Jeff Smith http://www.thatjeffsmith.com/ Ashley Chen http://oracletoolsgirl.blogspot.co.uk/ Kris Rice http://krisrice.blogspot.co.uk/
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.58
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.59