views:

93

answers:

1

Hi,

I've been searching the web for two days and still cannot find a way to generate DDL code with public synonyms. Would be very grateful for an advice.

+1  A: 

I think you are dealing with two different and distinct uses of the term "synonym":

1) In logical (entity) modelling, synonyms are alternative business names for an entity, e.g. the entity CUSTOMER may have synonyms PURCHASER and CLIENT.

2) In the physical (database) model, public synonyms are used to remove the need to specify the schema that owns a table. Commonly, the synonym and table name are the same e.g. "CREATE PUBLIC SYNONYM customers for MYSCHEMA.CUSTOMERS;"

It would be very unusual to want public synonyms generated in the database for the business synonyms defined in the logical model.

Tony Andrews
AH, now I see. And what's the use of this feature? Does somebody create separate entities for the same object, creates synonyms for each of them and gets really surprised when Data Modeler says I THINK THOSE ENTITIES SHOULD BE MERGED CAUSE THEY HAVE A NAME/SYNONYM IN COMMON? I can only admit it useful if we are dealing with a big-big schema
unb
The point is that logical modelling is about understanding the *business*. If one part of the organisation talks about `Customers` and another part talks about 'Clients' then it is useful to know that. However we would expect to see only one entity in the model.
APC
Whereas the point about synonyms is that I as a bog standard user can refer to the EMP table owned by SCOTT as `EMP` instead of `SCOTT.EMP`.
APC