• About Heli

HeliFromFinland

~ Heli's thoughts on Database Designing, Oracle SQL Developer Data Modeler, User Groups etc.

HeliFromFinland

Category Archives: Data Modeler

Oracle SQL Developer Data Modeler

Where are my domains?

12 Thursday Oct 2017

Posted by Helifromfinland in Data Modeler, Database design

≈ Leave a comment

I just upgraded Data Modeler to the latest release/installed Data Modeler to a new computer but all my domains are gone. Is there any way to get them back or do I need to define them manually again? Of course there is a way!

Select File, Import, Domains.

Domains1

Then find the file your domains are saved to using Open Domain File.

Domains2

Import.

Domains3

Go and check the domains.

Domains4

And there they are.

P.S. You might be interested in this too: helifromfinland.blog/2017/10/13/default-system-types-directory/

 

How can I change the table/column names to uppercase?

11 Wednesday Oct 2017

Posted by Helifromfinland in Data Modeler, Database design

≈ 6 Comments

When I desing the ER model I want to use mixed case naming but in my tables I want to have all the names uppercase. Is there a way to automatically change the names uppercase? YES!

Upper1

These are my tables and as you can see the names of the tables and some of the columns are very mixed cased notation. What I need now is a Transformation Script:

Upper11

In the Custom Trasformation Scripts I can find a script called Tables to upper case – Rhino.

Upper15

I press Apply. And this is what I get:

Upper2

 

How can I create triggers automatically for the journaling columns?

11 Wednesday Oct 2017

Posted by Helifromfinland in Data Modeler, Database design

≈ 6 Comments

Every single table in our database has columns USER_CREATED, USER_MODIFIED, DATE_CREATED, DATE_MODIFIED. Is there a way to get Data Modeler to create the triggers for inserting data to those columns? YES!

The thing you need is Table DDL Transformation:

TableDDL1

 

Define a new Table DDL Transformation Script set (in my example Trigger_for_Technical_Column):

TableDDL2

Define a After Create script and write something like this to it (thank you Marko Helskyaho 🙂 ):

/*
variable ddlStatementsList should be used to return the list with DDL statements
that are created by script – as shown below:
ddlStatementsList.add(new java.lang.String(ddl));
other available variables:
– model – relational model instance
– pModel – physical model instance
– table – the table in relational model
– tableProxy – table definition in physical model
*/
var ddl;
var lname;
// trigger name prefix
trgPre = “BIU_”;
// trigger name suffix
trgSuf = “_TRG”;
prompt = model.getAppView().getSettings().isIncludePromptInDDL();
useSchema = model.getAppView().getSettings().isIncludeSchemaInDDL();
if(model.getStorageDesign().isOpen()){
if(useSchema){
lname = tableProxy.getLongName();
}else{
lname = tableProxy.getName();
}
}else{
if(useSchema){
lname = table.getLongName();
}else{
lname = table.getName();
}
}

if(prompt){
ddl= “\nPROMPT Creating Trigger for ‘”+lname+”‘;\n”;
}else{
ddl = “\n”;
}
ddl = ddl +
“CREATE OR REPLACE TRIGGER “+trgPre+lname+trgSuf +”\n”+
” BEFORE \n” +
” INSERT OR \n” +
” UPDATE ON “+lname+” FOR EACH ROW \n” +
” BEGIN \n” +
” IF INSERTING THEN \n” +
” :NEW.DATE_CREATED := SYSDATE; \n” +
” :NEW.USER_CREATED := NVL(WWV_FLOW.G_USER,USER); \n” +
” END IF; \n” +
” :NEW.DATE_MODIFIED := SYSDATE; \n” +
” :NEW.USER_MODIFIED := NVL(WWV_FLOW.G_USER,USER); \n” +
” END; \n” +
” /”
ddlStatementsList.add(new java.lang.String(ddl));

You can immediatelly test it. Select one of your tables as Table To Test (in my example Isa) and press Test. This is what I got:

TableDDL3

Looks what I wanted but how can I use this script?

When generating DDLs select Include Table DDL Scripts tab. Then select the script from Active Script Set list and select those tables you want to execute it:

TableDDL4

OK. And this is what I got:

CREATE TABLE isa (
avain_uusi NUMBER(16) NOT NULL,
jokumuu VARCHAR2(50 CHAR) NOT NULL,
user_created VARCHAR2(50 CHAR) NOT NULL,
user_modified VARCHAR2(50 CHAR),
date_created DATE NOT NULL,
date_modified DATE
);

ALTER TABLE isa ADD CONSTRAINT isa_pk PRIMARY KEY ( avain_uusi );

CREATE OR REPLACE TRIGGER BIU_Isa_TRG
BEFORE
INSERT OR
UPDATE ON Isa FOR EACH ROW
BEGIN
IF INSERTING THEN
:NEW.DATE_CREATED := SYSDATE;
:NEW.USER_CREATED := NVL(WWV_FLOW.G_USER,USER);
END IF;
:NEW.DATE_MODIFIED := SYSDATE;
:NEW.USER_MODIFIED := NVL(WWV_FLOW.G_USER,USER);
END;
/

CREATE TABLE lapsi (
avainlapsi NUMBER(16) NOT NULL,
lisatieto VARCHAR2(50 CHAR) NOT NULL,
avain_uusi NUMBER(16) NOT NULL,
user_created VARCHAR2(50 CHAR) NOT NULL,
user_modified VARCHAR2(50 CHAR),
date_created DATE NOT NULL,
date_modified DATE
);

ALTER TABLE lapsi ADD CONSTRAINT lapsi_pk PRIMARY KEY ( avainlapsi,avain_uusi );

CREATE OR REPLACE TRIGGER BIU_lapsi_TRG
BEFORE
INSERT OR
UPDATE ON lapsi FOR EACH ROW
BEGIN
IF INSERTING THEN
:NEW.DATE_CREATED := SYSDATE;
:NEW.USER_CREATED := NVL(WWV_FLOW.G_USER,USER);
END IF;
:NEW.DATE_MODIFIED := SYSDATE;
:NEW.USER_MODIFIED := NVL(WWV_FLOW.G_USER,USER);
END;
/

ALTER TABLE lapsi
ADD CONSTRAINT lapsi_isa_fk FOREIGN KEY ( avain_uusi )
REFERENCES isa ( avain_uusi );

 

 

How can I get technical columns to the relational model?

11 Wednesday Oct 2017

Posted by Helifromfinland in Data Modeler, Database design

≈ Leave a comment

I always define columns like USER_CREATED, USER_MODIFIED, DATE_CREATED, DATE_MODIFIED for my tables but I would not like to design them in the logical model. Is there a way to get them automatically to the relational model? YES!

Here’s my logical model. None of my entities has those attributes defined.

TempTable0

 

First design a table that only has those technical columns, nothing else. In my example a table is called TempTable:

TempTable1

 

Then when Engineering to Relational Model select General Options, Use Template Table and select this table from the list:

TempTable2

Engineer.

Now all the tables you just generated to a relational model has these columns:

TempTable3

 

 

 

 

Version 17.2 is out

12 Wednesday Jul 2017

Posted by Helifromfinland in Data Modeler, SQL Developer

≈ 2 Comments

The new versioning systems now applies to SQL Developer and Data Modeler too. A new version comes out about four times a year and the version number is created using the last two digits of the year and the number of the quarter. So version 17.2 is out for both of them and can be downloaded here:

Data Modeler

http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html

Bugs fixed:

26280295 – MISSING ; FOR AUTOMATICALLY GENERATED INDEXES FOR PK, UK AND FK CONSTRAINTS
22145935 – DOMAIN ADMINISTRATION SHOWS MULTIPLE SAME DATA TYPE
26285068 – DDL ALTER TABLE NOT INCLUDING SCHEMA NAME FOR FOREIGN KEYS FOR SQL SERVER
25896354 – DB2 ASSOCIATION DATABASE-STORAGE GROUP & TABLESPACE-STORAGE TEMPLATE NOT WORKING
26090903 – UNABLE TO SELECT MULTIPLE ATTRIBUTES/COLUMNS IN ENTITY/TABLE WITH SHIFT/CTRL KEY
26006706 – ERRORS FOR THE FOREIGN KEY INDEX WITH THE SAME NAME AS THE FOREIGN KEY
26120866 – PHYSICAL MODEL, TABLE PARTITIONING SETTINGS LOST ON LOAD MODEL-SINGLE FILE
25888833 – SINGLE QUOTES IN DOMAIN CONSTRAINT ARE NOT PROCESSED PROPERLY DURING SAVE OPEN
22662213 – SAVED SEARCHES NOT OVERWRITING
25777203 – ERROR ON EXCEL REPORTS WITH COLUMN UDP
25923812 – NPE DURING IMPORT FROM DATABASE WHEN TARGET IS “NEW RELATIONAL MODEL”
25813010 – DOMAINS IN REMOTE TABLE ARE NOT SYNCHRONIZED PROPERLY WHEN REMOTE DESIGN IS OPEN

SQL Developer

http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html

Bugs fixed:

 25956060 – CONNECTION DISCONNECT ON TAB SWITCHES
 26275211 – PREVENTED POSSIBLE REGRESSION ON DIVISION EXPRESSION
 25735609 – : OPERATORS ARE NOT SUPPORTED
 26041444 – DRAG AND DROP MULTI TABLES JOIN FAILED
 26103385 – BUG IN CONNECTIONS ORDS NAVIGATOR 3.0.10.
 26229132 – ORDS SEARCH CODE FAILS DUE TO THE METADATA TABLE NOT VISIBLE
 25773801 – CARET POSITIONED AT BEGINNING OF FIELD WHEN EDIT STARTED BY KEYSTONES
 25777168 – TABLE COLUMN ARE ALL REMOVED WHEN ONE COLUMN REMOVED
 25966899 – RUN PL/SQL DIALOG AND PARAMETERS FOR DOUBLE QUOTED PROCEDURE/PACKAGES MISSING.
 26107832 – COMMIT AND ROLLBACK FAIL TO TRANSLATE
 25962766 – : CODE OUTLINE REGRESSION, CODE POSITION NOT REFLECTED IN THE TREE
 25986304 – SQL CODE HAVING COMMENTS WITH SEMICOLON AT THE END WILL CAUSE ERRORS JIRA: SQLDEV-350
 26177821 – VIEW-REST DATA SERVICES – DEVELOPMENT DOES NOT DISPLAY RESTFUL SERVICES
 25735609 – : OPERATORS ARE NOT SUPPORTED
 26200926 – INSERT INTO FORMAT SHOWN NOT RIGHT WHEN FORMAT ON WORKSHEET
 26200893 – FUNCTION FORMAT SHOWN NOT RIGHT AFTER FORMAT ON WORKSHEET
 26202027 – WORKSHEET FORMAT FOR ‘||’ SHOWN NOT RIGHT
 26150496 – : LONG LINE IS WRAPPED WITH BLANK EXTRA LINE
 26121270 – : PARSER BUG FOR XMLTABLE
 26108903 – NO BREAK AT THE END OF SELECT CLAUSE WITH CERTAIN OPTIONS
 26086483 – SQLCL INPUT DO NOT WANDER AROUND SCREEN E.G. ACCEPT/CONNECT SQLDEV-385
 25976240 – SET ERROR LOGGING NOT SUPPORTED IN THE SCRIPTRUNNER
 25689058 – SQLCL NOT ABLE TO CONNECT TO DB WHEN USING SECURE PASS STORE BUG SQLDEV-82
 25952884 – PARSER DOESN’T LIKE SELECT WITH (PLSQL) SQLDEV-340 -check in on 17.2 side
 25875722 – SQLCL: PARSE ERROR WHILE USING FORMAT COMMAND FOR A VALID SQL FILE
 25519246 – FORMATTER DOESN’T UNDERSTAND $IF $ELSIF $ELSE
 25707227 – THE EXAMPLE URL WHEN SPECIFY TEMPLATE SHOULD INCLUDE SCHEMA NAME AND HOST NAME
 25931871 – : AFTER FORMATTING EDITOR SELECTED TEXT CURSOR JUMPS TO LINE 1
 25911214 – : FORMAT OPTIONS ARE BLANK
 25860843 – SQLCL: DDL WHEN REDISPLAYED ELIMINATES BLANK LINES

 

Data Modeler 4.2

18 Tuesday Apr 2017

Posted by Helifromfinland in Data Modeler

≈ 2 Comments

The 4.2 version of Data Modeler is out: http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/index.html

New features (http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/dm-newfeatures-42-3220396.html):

Import from Oracle Database

  •  Support for Oracle Database 12c Release 2
  •  Performance and filtering enhancements
  •  Ability to define Oracle Client for thick connections
  •  View and materialized view driving query and columns now parsed and validated during import

General

    •  Better management of change requests
    •  Design rules can be invoked directly on Subview or selection of objects
    •  More formats are supported in export/import functionality for glossaries
    •  Improvements in performance
    •  New models are shown as a single node in pending changes window

 

Diagrams

    •  Print diagrams to SVG and HTML/SVG file – for logical and relational model diagrams
    •  Better handling of labels in Logical model diagrams

 

Versioning

    •  Improvements in performance
    •  Removed usage of SVN properties as additional metadata layer
    •  Git supported for design repository via ‘git svn’ – Modeler will use SVN calls against your Git repository

 

Reporting

  •  PDF diagrams can be embed into PDF report
  •  SVG diagrams can be embed in HTML reports
  •  External CSS file is used for formatting

Bugs fixed (http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/dm-bugsfixed-42-3418891.html):

25407455 – DDL GENERATION CREATES WRONG FILENAMES FOR SPECIFIC OBJECTS
25427960 – COLOR SETTING FOR TRANSPARENCY IS LOST AFTER MODEL IS RELOADED
25428000 – COLOR SETTING FOR FK LINE ARE LOST WHEN THAT FK HAS PRESENTATION IN SUBVIEW
25461330 – COMPARE MODELS DIALOG DOESN’T RETAIN SELECTION AFTER REFRESH TREE PRESSED
25584892 – VIEW HEADER COLUMNS LIST DROPPED AFTER VALIDATING VIEW
25590365 – CLASSCASTEXCEPTION WHEN USING “MAC OS X” LOOK AND FEEL
25610620 – DM DOES NOT MARK FOREIGN KEYS AS CHANGED BUT AS NEW

Defining the tablespace for several objects at the same time

15 Wednesday Feb 2017

Posted by Helifromfinland in Data Modeler

≈ 1 Comment

I have hundreds of indexes and I need to define the tablespace for them. Do I need to do it manually, one by one? No 🙂

 

First define the tablespace you want to set for the indexes:

prop1

Then select one of the indexes and set the Tablespace Property:

prop2

Press Apply.

Press Propagate Properties.

prop3

In the Properties section press Deselect All. Select Tablespace.

In the Object section press Select All.

prop4

Press OK.

 

Now the tablespace for all indexes has been set as Index_Tablespace1.

 

 

 

 

How to define an identity column?

02 Thursday Feb 2017

Posted by Helifromfinland in Data Modeler

≈ 3 Comments

I want to define an identity column and set the Auto Increment properties. How can I do that?

This definition can be made in the relational model. Select the primary key column and go to the Column Properties (the XYZ and a pen icon).

identity_1

In General tab select Indentity Column and Auto Increment.

Then select the Auto Increment tab:

identoty_column2

And set the properties as wanted.

Now if you generate the DDL this is what you get:

identity_2

Table DDL Transformations, DDL File Editor shows blank

16 Monday Jan 2017

Posted by Helifromfinland in Data Modeler

≈ Leave a comment

If the DDL File Editor shows blank while you are trying to use a Table DDL Transformations script you have written yourself, you might have hit a known bug.

Workaround: Go back to Table DDL Transformations and select the script. Select After Create, type a space, remove it and save the script again.

 

P.S. The bug is fixed in DM 4.2 EA2.

 

 

EA2 for both Oracle SQL Developer and Data Modeler 4.2

22 Thursday Dec 2016

Posted by Helifromfinland in Data Modeler

≈ Leave a comment

Early Adopter 2 for version 4.2 was relesed for both Oracle SQL Developer

http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-ea-42-3211401.html

and Oracle SQL Developer Data Modeler

http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/dm-ea-42-3215768.html

These releases are mostly bug fixes for EA 4.2.

Here is very briefly what is new in SQL Developer 4.2:

http://www.oracle.com/technetwork/developer-tools/sql-developer/sqldev-newfeatures-v42-3211987.html

and in Data Modeler 4.2:

http://www.oracle.com/technetwork/developer-tools/datamodeler/downloads/dm-newfeatures-42-3220396.html

You can learn more about the new features in Data Modeler 4.2 by reading my previous posts about the topic :

https://helifromfinland.blog/2016/09/27/whats-new-in-data-modeler-ea4-2-part-1-design-rules/

https://helifromfinland.blog/2016/09/28/whats-new-in-data-modeler-ea4-2-part-2-change-requests/

https://helifromfinland.blog/2016/09/29/whats-new-in-data-modeler-4-2ea-part-3-a-view-and-a-query/

https://helifromfinland.blog/2016/09/30/whats-new-in-data-modeler-4-2ea-part-4-new-preferences-for-reporting/

https://helifromfinland.blog/2016/10/01/whats-new-in-data-modeler-4-2ea-part-5-generate-html-report-toc-in-separate-file/

https://helifromfinland.blog/2016/10/02/whats-new-in-data-modeler-4-2ea-part-6-include-select-statement-in-views-reports/

https://helifromfinland.blog/2016/10/04/whats-new-in-data-modeler-4-2ea-part-7-embed-diagrams-htmlpdf/

https://helifromfinland.blog/2016/10/05/whats-new-in-data-modeler-4-2ea-part-8-group-objects-by-schema/

https://helifromfinland.blog/2016/10/09/whats-new-in-data-modeler-4-2ea-part-9-end-of-the-serie/

https://helifromfinland.blog/2016/12/10/new-reports-in-data-modeler-4-2ea/

Go and Download!

 

P.S. APEX 5.1 is also out!

http://www.oracle.com/technetwork/developer-tools/apex/downloads/download-085147.html

 

 

← Older posts
Newer posts →

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • October 2022
  • October 2021
  • April 2020
  • October 2019
  • October 2018
  • June 2018
  • December 2017
  • October 2017
  • September 2017
  • July 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • June 2014
  • May 2014
  • April 2014
  • January 2014
  • December 2013
  • November 2013

Categories

  • Data Modeler
  • Database design
  • Events
  • General
  • Oracle
  • SQL Developer

Meta

  • Register
  • Log in

Blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • HeliFromFinland
    • Join 48 other followers
    • Already have a WordPress.com account? Log in now.
    • HeliFromFinland
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...