Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on May 28, 2018, 02:55:51 pm

Title: Oracle Reverse Engineer
Post by: Paolo F Cantoni on May 28, 2018, 02:55:51 pm
One of our users is trying to reverse engineer an Oracle DB.

We're usually a SQL Server shop, so I haven't done one of these for ages.  Using b1351, he seems to be doing all the right things on the Import from ODBC dialog.  Are there any "gotchas", "secret sauces" that we should be using?

The result is that after asking it to reverse engineer everything, for the tables, we get the table objects, no features or relationships - just empty boxes...

TIA,
Paolo
Title: Re: Oracle Reverse Engineer
Post by: Sunshine on May 28, 2018, 09:44:19 pm
Done a couple of oracle databases and never been able to get the relationships either. Fortunately the primary keys and foreign keys where named consistently that i wrote a script to create the relationships. Not ideal but i ended up with the desired result.
Title: Re: Oracle Reverse Engineer
Post by: Mauricio Moya (Arquesoft) on May 29, 2018, 05:00:57 am
Are you using legacy reverse engineering? Have you tried Database Builder?
Title: Re: Oracle Reverse Engineer
Post by: hd on May 29, 2018, 08:20:48 am
Make sure the ODBC driver is the Oracle driver and not the "Microsoft ODBC for Oracle" driver.
Title: Re: Oracle Reverse Engineer
Post by: Paolo F Cantoni on May 29, 2018, 09:45:08 am
Are you using legacy reverse engineering? Have you tried Database Builder?
Yes (I think so), I'll give it a go!

Paolo
[EDIT: I tried it, but it seems to me that the import DB Schema is the SAME dialog as the non-Database Builder route.  I tried an SQL Server DB (as my user isn't in yet) and both routes worked fine.]
Title: Re: Oracle Reverse Engineer
Post by: Paolo F Cantoni on May 29, 2018, 09:46:13 am
Make sure the ODBC driver is the Oracle driver and not the "Microsoft ODBC for Oracle" driver.
Will do, when I get in to work.

I should get both the columns AND the FK relationship, yes?

Paolo
Title: Re: Oracle Reverse Engineer
Post by: Glassboy on May 29, 2018, 01:17:16 pm
Make sure the ODBC driver is the Oracle driver and not the "Microsoft ODBC for Oracle" driver.
Will do, when I get in to work.

I should get both the columns AND the FK relationship, yes?

Paolo

It's been a few years since I reverse engineered an Oracle DB but I remember getting everything.
Title: Re: Oracle Reverse Engineer
Post by: Paolo F Cantoni on May 29, 2018, 04:39:25 pm
A combination of V14 and the DB Builder (we were using the Oracle ODBC drive - 11.0.2.1) did it.

We imported 2355 tables, 159 views etc...   However, we got a Resources Exceeded message and thought it might have damaged the FK Constraint import.  But it seems that this product hasn't got any FK Constraints!

Paolo
Title: Re: Oracle Reverse Engineer
Post by: Geert Bellekens on May 29, 2018, 04:58:27 pm
But it seems that this product hasn't got any FK Constraints!

Who in his right mind would design a database without FK constraints!  :o
Ohh, um, ... nevermind...  :-X

Geert
Title: Re: Oracle Reverse Engineer
Post by: Richard Freggi on May 29, 2018, 10:10:38 pm
I'm not an Oracle expert but any RDBMS should spit out the schema DDL code as a text file on request.  Then just run the DDL in EA to recreate the schema as a physical data model?
Title: Re: Oracle Reverse Engineer
Post by: qwerty on May 30, 2018, 12:00:01 am
Why do it the simple way if you can go through a variety of ODBC and native drivers instead?

q.
Title: Re: Oracle Reverse Engineer
Post by: Sunshine on May 30, 2018, 06:48:45 am
I'm not an Oracle expert but any RDBMS should spit out the schema DDL code as a text file on request.  Then just run the DDL in EA to recreate the schema as a physical data model?
Interesting I didn't know you could run DDL in EA to recreate the schema. I've search the help and can't find anything on that particular feature. Care to share a reference on how to access it?
Title: Re: Oracle Reverse Engineer
Post by: Sunshine on May 30, 2018, 06:50:48 am
Why do it the simple way if you can go through a variety of ODBC and native drivers instead?

q.
Probably because the help tells you to use ODBC drivers. Haven't found out how to run DDL in EA yet though. Still searching in the online help for that feature.
https://www.sparxsystems.com/downloads/resources/booklets/uml_code_engineering.pdf (https://www.sparxsystems.com/downloads/resources/booklets/uml_code_engineering.pdf)
Title: Re: Oracle Reverse Engineer
Post by: Eve on May 30, 2018, 08:56:23 am
EA can't reverse engineer a DB schema from a sql file.
Title: Re: Oracle Reverse Engineer
Post by: qwerty on May 30, 2018, 05:27:29 pm
Yes, I know that EA can't RE a DDL. Unfortunately there's no emphasis for irony/sarcasm in texts.

q.
Title: Re: Oracle Reverse Engineer
Post by: Geert Bellekens on May 30, 2018, 06:28:40 pm
We discussed that in the past.

The advantage of using ODBC is that it gets you a standardized interface for any database (given the ODBC driver is implemented correctly).
So in this case EA doesn't have to worry about the actual database type, as long as it conforms to the ODBC standard it can be imported.

Now in theory that should also work for importing DDL,'s since SQL is in fact an ANSI standard.
Unfortunately that doesn't work in the real world as each database vendor has invented his own SQL dialect.

So if EA was to implement such a feature it should cater for each and every different SQL dialect out there.

I too would like a DDL import feature, but I can understand why Sparx choose the ODBC option. I would probably do the same if I was in their shoes.

Geert

PS. For a client who needed to RE a DB2 database from the mainframe we have build our own DDL parser to correct the part that was imported via ODBC
Title: Re: Oracle Reverse Engineer
Post by: Richard Freggi on May 30, 2018, 06:34:07 pm
Yes, I know that EA can't RE a DDL. Unfortunately there's no emphasis for irony/sarcasm in texts.

q.

I didn't know that!  Not even the higher cost versions?  Don't open source tools like MySQLWorkbench do that already?  Me sees a feature request lurking somewhere......
Title: Re: Oracle Reverse Engineer
Post by: qwerty on May 30, 2018, 06:40:59 pm
EA can' parse DDL. Since it internally seems to have a SQL parser (the SQL you send from EA to a DB are mangled in the one or other way) there should be ways to get EA eating a DDL. However, times for seeing feature requests being implemented are no longer in the range of a couple of weeks.

q.
Title: Re: Oracle Reverse Engineer
Post by: Glassboy on May 31, 2018, 09:53:20 am
EA can' parse DDL. Since it internally seems to have a SQL parser (the SQL you send from EA to a DB are mangled in the one or other way) there should be ways to get EA eating a DDL. However, times for seeing feature requests being implemented are no longer in the range of a couple of weeks.

I think that this sort of functionality would be best community produced.  Sparx should be responsible for the parser and documentation about it and the community could craft for the particular database technology.
Title: Re: Oracle Reverse Engineer
Post by: Eve on May 31, 2018, 10:18:01 am
Yes qwerty, I understood your sarcasm. Unfortunately, not everyone in the thread seemed to realise.
Title: Re: Oracle Reverse Engineer
Post by: qwerty on May 31, 2018, 05:21:07 pm
Doh :-[

q.
Title: Re: Oracle Reverse Engineer
Post by: Sunshine on June 02, 2018, 11:33:04 am
Yes, I know that EA can't RE a DDL. Unfortunately there's no emphasis for irony/sarcasm in texts.

q.

Mmmh really? No smiley or emojicon then for sarcasm :o
Title: Re: Oracle Reverse Engineer
Post by: qwerty on June 02, 2018, 10:10:59 pm
Actually I can't interpret any of them as "sarcastic intention".  :o is shocked (as you can also read from the hovered note).

q.