Sharing tables between relational models
Can I share (not copy) table between two relational models in SQL Developer Data Modeler? Something like sharing tables between application systems in Oracle Designer. I have one database schema for reusable kernel of many applications and I want to have one relational model for it. And I need to use tables from kertnel in other applications (database schemas). I need for example to make FK between application and kernel table. How can I do it?
Hi,
you can use drag&drop from browser to diagram of target model in order to do that. Table becomes read-only in target model. You can use "Synchronize remote objects" to get actual status of such "remote" table
Philip
Similar Messages
-
External table to relational model
Hi,
During a data dictionary import, tables, views, mat views and sequences are "propagated" up to the relational model level, but external tables do not. I think it would be useful if external tables could also be "brought up" to the relational level since an external table is only a different kind of physical structure.
Regards,
GellértI am seconding the request to be able to use External tables in the same manner that tables can be used within the Data Modeler. they can be imported into the Physical model, but not in the relational models.
-
Data Modeler - applying naming standards to relational model
Hi,
first of all thanks for the new data modeler build (584) - it really fixed some issues (e.g. unique keys with non mandatory referenced ids are now persistent) ...
BUT ... why is there an option to disable foreign key names when applying naming rule although it does not work?
I like my primary key names etc. to follow some naming rules, but I don't like foreign keys to follow rules, just because neither "Benutzer_Id3" follows the company internal naming rules nor is it very easy to understand at all.
Steps taken:
* logical model is complete
* generate relational model
* foreign key names are as intended (e.g. "User_Id_Modifier")
* right click the relational model
* click "Apply Naming Standards ..."
* remove the check mark from "Column Foreign Key"
* click "OK"
The foreign key column is changed regardless of checkbox state :-( - even deselecting all check boxes still applies naming rules to the foreign key columns.
Is there a fix/workaround for that or need I to go back to build 570?
Thanks god I still have my 570 compatible model ins SVN
regards stuecklHi,
unfortunately that functionality for all tables in relational model is broken - you still can use it at table level - "Naming rules" button in table dialog.
Philip -
how can i import tables from a different schema into the existing relational model... to add these tables in the existing relational/logical model? plss help
note; I already have the relational/logical model ready from one schema... and I need to add few more tables to this relational/logical model
can I import the same way as I did previously??
but even if I do the same how can I add it in the model?? as the logical model has already been engineered..
please help ...
thanksHi,
Before you start, you should probably take a backup copy of your design (the .dmd file and associated folder), in case the update does not work out as you had hoped.
You need to use Import > Data Dictionary again, to start the Data Dictionary Import Wizard.
In step 1 use a suitable database connection that can access the relevant table definitions.
In step 2 select the schema (or schemas) to import. The "Import to" field in the lower left part of the main panel allows you to select which existing Relational Model to import into (or to specify that a new Relational Model is to be created).
In step 3 select the tables to import. (Note that if there are an Foreign Key constraints between the new tables and any tables you had previously imported, you should also include the previous tables, otherwise the Foreign Key constraints will not be imported.)
After the import itself has completed, the "Compare Models" dialog is displayed. This shows the differences between the model being imported and the previous state of the model, and allows you to select which changes are to be applied.
Just selecting the Merge button should apply all the additions and changes in the new import.
Having updated your Relational Model, you can then update your Logical Model. To do this you repeat the "Engineer to Logical Model". This displays the "Engineer to Logical Model" dialog, which shows the changes which will be applied to the Logical Model, and allows you to select which changes are to be applied.
Just selecting the Engineer button should apply all the additions and changes.
I hope this helps you achieve what you want.
David -
Engineer between Logical Model and Relational Model
I am trying to update changes from one model to the other but there are dublicate entries generated instead of updates.
The Logical Model was imported from Oracle Designer, the Relational Model was imported from data dictionary.
Our rule is, that the name of Entities/Tables and Attribute/Columns are identical.
So I changed the Naming Standard of the Logical Model in Preferences
from Separator = Space to Separator = Character with char = Underline.
If the entity is not existing, it is created with the correct name.
If the entity exists, a new entity is created with Namev1.
The same happens when I try to update changes in the other direction.
How can I achieve that the existing entity (or table) is updated and not a new one is created?
Or in other words, is there a way to link entities to corresponding tables?
WalterHi Walter,
The Logical Model was imported from Oracle Designer, the Relational Model was imported from data dictionaryit's good to import entities and related tables from Designer repository together. Data Modeler will import the link between them and use that link in synchronization between logical and relational model. After that you can import details for physical model from database.
If you don't have tables in Designer repository and keep the same names for entities, attributes, tables and columns then you can engineer logical model to relational and import details from database.
Philip -
How to find the level of each child table in a relational model?
Earthlings,
I need your help and I know that, 'yes, we can change'. Change this thread to a answered question.
So: How to find the level of each child table in a relational model?
I have a relacional database (9.2), all right?!
O /* This is a child who makes N references to each of the follow N parent tables (here: three), and so on. */
/↑\ Fks
O"O O" <-- level 2 for first table (circle)
/↑\ Fks
"o"o"o" <-- level 1 for middle table (circle)
↑ Fk
"º"Tips:
- each circle represents a table;
- red tables no have foreign key
- the table in first line of tree, for example, has level 3, but when 3 becomes N? How much is N? This's the question.
I started thinking about the following:
First I have to know how to take the children:
select distinct child.table_name child
from all_cons_columns father
join all_cons_columns child
using (owner, position)
join (select child.owner,
child.constraint_name fk,
child.table_name child,
child.r_constraint_name pk,
father.table_name father
from all_constraints father, all_constraints child
where child.r_owner = father.owner
and child.r_constraint_name = father.constraint_name
and father.constraint_type in ('P', 'U')
and child.constraint_type = 'R'
and child.owner = 'OWNER') aux
using (owner)
where child.constraint_name = aux.fk
and child.table_name = aux.child
and father.constraint_name = aux.pk
and father.table_name = aux.father;Thinking...
Let's Share!
My thanks in advance,
Philips
Edited by: BluShadow on 01-Apr-2011 15:08
formatted the code and the hierarchy for readbilityJustin,
Understood.
Nocycle not work in 9.2 and, even that would work, would not be appropriate.
With your help, I decided a much simpler way (but there is still a small problem, <font color=red>IN RED</font>):
-- 1
declare
type udt_roles is table of varchar2(30) index by pls_integer;
cRoles udt_roles;
begin
execute immediate 'create user philips
identified by philips';
select granted_role bulk collect
into cRoles
from user_role_privs
where username = user;
for i in cRoles.first .. cRoles.count loop
execute immediate 'grant ' || cRoles(i) || ' to philips';
end loop;
end;
-- 2
create table philips.root1(root1_id number,
constraint root1_id_pk primary key(root1_id)
enable);
grant all on philips.root1 to philips;
create or replace trigger philips.tgr_root1
before delete or insert or update on philips.root1
begin
null;
end;
create table philips.root2(root2_id number,
constraint root2_id_pk primary key(root2_id)
enable);
grant all on philips.root2 to philips;
create or replace trigger philips.tgr_root2
before delete or insert or update on philips.root2
begin
null;
end;
create table philips.node1(node1_id number,
root1_id number,
node2_id number,
node4_id number,
constraint node1_id_pk primary key(node1_id)
enable,
constraint n1_r1_id_fk foreign key(root1_id)
references philips.root1(root1_id) enable,
constraint n1_n2_id_fk foreign key(node2_id)
references philips.node2(node2_id) enable,
constraint n1_n4_id_fk foreign key(node4_id)
references philips.node4(node4_id) enable);
grant all on philips.node1 to philips;
create or replace trigger philips.tgr_node1
before delete or insert or update on philips.node1
begin
null;
end;
create table philips.node2(node2_id number,
root1_id number,
node3_id number,
constraint node2_id_pk primary key(node2_id)
enable,
constraint n2_r1_id_fk foreign key(root1_id)
references philips.root1(root1_id) enable,
constraint n2_n3_id_fk foreign key(node3_id)
references philips.node3(node3_id) enable);
grant all on philips.node2 to philips;
create or replace trigger philips.tgr_node2
before delete or insert or update on philips.node2
begin
null;
end;
create table philips.node3(node3_id number,
root2_id number,
constraint node3_id_pk primary key(node3_id)
enable,
constraint n3_r2_id_fk foreign key(root2_id)
references philips.root2(root2_id) enable);
grant all on philips.node3 to philips;
create or replace trigger philips.tgr_node3
before delete or insert or update on philips.node3
begin
null;
end;
create table philips.node4(node4_id number,
node2_id number,
constraint node4_id_pk primary key(node4_id)
enable,
constraint n4_n2_id_fk foreign key(node2_id)
references philips.node2(node2_id) enable);
grant all on philips.node4 to philips;
create or replace trigger philips.tgr_node4
before delete or insert or update on philips.node4
begin
null;
end;
-- out of the relational model
create table philips.node5(node5_id number,
constraint node5_id_pk primary key(node5_id)
enable);
grant all on philips.node5 to philips;
create or replace trigger philips.tgr_node5
before delete or insert or update on philips.node5
begin
null;
end;
-- 3
create table philips.dictionary(table_name varchar2(30));
insert into philips.dictionary values ('ROOT1');
insert into philips.dictionary values ('ROOT2');
insert into philips.dictionary values ('NODE1');
insert into philips.dictionary values ('NODE2');
insert into philips.dictionary values ('NODE3');
insert into philips.dictionary values ('NODE4');
insert into philips.dictionary values ('NODE5');
--4
create or replace package body philips.pck_restore_philips as
procedure sp_select_tables is
aExportTablesPhilips utl_file.file_type := null; -- file to write DDL of tables
aExportReferencesPhilips utl_file.file_type := null; -- file to write DDL of references
aExportIndexesPhilips utl_file.file_type := null; -- file to write DDL of indexes
aExportGrantsPhilips utl_file.file_type := null; -- file to write DDL of grants
aExportTriggersPhilips utl_file.file_type := null; -- file to write DDL of triggers
sDirectory varchar2(100) := '/app/oracle/admin/tace/utlfile'; -- directory \\bmduhom01or02
cTables udt_tables; -- collection to store table names for the relational depth
begin
-- omits all referential constraints:
dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'REF_CONSTRAINTS', false);
-- omits segment attributes (physical attributes, storage attributes, tablespace, logging):
dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SEGMENT_ATTRIBUTES', false);
-- append a SQL terminator (; or /) to each DDL statement:
dbms_metadata.set_transform_param(dbms_metadata.session_transform, 'SQLTERMINATOR', true);
-- create/open files for export DDL:
aExportTablesPhilips := utl_file.fopen(sDirectory, 'DDLTablesPhilips.pdc', 'w', 32767);
aExportReferencesPhilips := utl_file.fopen(sDirectory, 'DDLReferencesPhilips.pdc', 'w', 32767);
aExportIndexesPhilips := utl_file.fopen(sDirectory, 'DDLIndexesPhilips.pdc', 'w', 32767);
aExportGrantsPhilips := utl_file.fopen(sDirectory, 'DDLGrantsPhilips.pdc', 'w', 32767);
aExportTriggersPhilips := utl_file.fopen(sDirectory, 'DDLTriggersPhilips.pdc', 'w', 32767);
select d.table_name bulk collect
into cTables -- collection with the names of tables in the schema philips
from all_tables t, philips.dictionary d
where owner = 'PHILIPS'
and t.table_name = d.table_name;
-- execution
sp_seeks_ddl(aExportTablesPhilips,
aExportReferencesPhilips,
aExportIndexesPhilips,
aExportGrantsPhilips,
aExportTriggersPhilips,
cTables);
-- closes all files
utl_file.fclose_all;
end sp_select_tables;
procedure sp_seeks_ddl(aExportTablesPhilips in utl_file.file_type,
aExportReferencesPhilips in utl_file.file_type,
aExportIndexesPhilips in utl_file.file_type,
aExportGrantsPhilips in utl_file.file_type,
aExportTriggersPhilips in utl_file.file_type,
cTables in out nocopy udt_tables) is
cDDL clob := null; -- colletion to save DDL
plIndex pls_integer := null;
sTableName varchar(30) := null;
begin
for i in cTables.first .. cTables.count loop
plIndex := i;
sTableName := cTables(plIndex);
* Retrieves the DDL and the dependent DDL into cDDL clob *
* for the selected table in the collection, and writes to file.*
begin
cDDL := dbms_metadata.get_ddl('TABLE', sTableName, 'PHILIPS');
sp_writes_ddl(aExportTablesPHILIPS, cDDL);
exception
when dbms_metadata.object_not_found then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('REF_CONSTRAINT', sTableName, 'PHILIPS');
sp_writes_ddl(aExportReferencesPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('INDEX', sTableName, 'PHILIPS');
sp_writes_ddl(aExportIndexesPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('OBJECT_GRANT', sTableName, 'PHILIPS');
sp_writes_ddl(aExportGrantsPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
begin
cDDL := dbms_metadata.get_dependent_ddl('TRIGGER', sTableName, 'PHILIPS');
sp_writes_ddl(aExportTriggersPhilips, cDDL);
exception
when dbms_metadata.object_not_found2 then
null;
end;
end loop;
end sp_seeks_ddl;
procedure sp_writes_ddl(aExport in utl_file.file_type,
cDDL in out nocopy clob) is
pLengthDDL pls_integer := length(cDDL);
plQuotient pls_integer := null;
plRemainder pls_integer := null;
begin
* Register variables to control the amount of lines needed *
* for each DDL and the remaining characters to the last row. *
select trunc(pLengthDDL / 32766), mod(pLengthDDL, 32766)
into plQuotient, plRemainder
from dual;
* Join DDL in the export file. *
* ps. 32766 characters + 1 character for each line break. *
-- if the size of the DDL is greater than or equal to limit the line ...
if plQuotient >= 1 then
-- loops for substring (lines of 32766 characters + 1 break character):
for i in 1 .. plQuotient loop
utl_file.put_line(aExport, substr(cDDL, 1, 32766));
-- removes the last line, of clob, recorded in the buffer:
cDDL := substr(cDDL, 32767, length(cDDL) - 32766);
end loop;
end if;
* If any remains or the number of characters is less than the threshold (quotient = 0), *
* no need to substring. *
if plRemainder > 0 then
utl_file.put_line(aExport, cDDL);
end if;
-- record DDL buffered in the export file:
utl_file.fflush(aExport);
end sp_writes_ddl;
begin
-- executes main procedure:
sp_select_tables;
end pck_restore_philips;<font color="red">The problem is that I still have ...
When creating the primary key index is created and this is repeated in the file indexes.
How to avoid?</font> -
DM3.0 EA2: Filter engineering changes between logical and relational model
Hi,
when I am engineering changes between logial and relational model there are some issues at filter handling for me:
- When the filter "Show Modified Objects" is activated, the filter works only on the first level, e.g. on Entity level. On attribute level all attributes are displayed, not only the attributes which have really been modified. It is possible, to show on every level only the really modified objects?
- I think, selecting a Filter condition is circuitous. All filter conditions except "Show All Objects" keeps activated when I choose another condition. So I have to deactivate "Show Deleted Objects" when I want to see only the modified objects. It is possible to choose another control element for filtering, e.g. disjunctive radio buttons?
I am running Data Modeler on Windows XP with german localization and the JDK 1.6.0_11 from Oracle SQL Developer.I logged bug for that.
Philip -
Table properties doesn't propagate from Relational Model to physical model
Hi all,
I have a relationnal model with several tables and several schema.
When i create a new table in the relational model with a specified schema, the table is created on the physicla model, but the schema is not prapagate.
Is there a way to do this automatically ?
Or do i have to specify the schema on the relationnal and on the physical.
Thank youHi,
schema object in relational model needs to be implemented in physical model - user is the implementation of schema in Oracle physical model. User has property "implements schema". You also can omit this redirection and can assign directly user to table but in this case you'll lose the flexibility.
Here is how DDL is impacted using different option (schema_1 and table_1 in relational model):
1) physical model is not open - no implementation details
CREATE TABLE Schema_1.TABLE_1
Column_1 NUMBER
;2) physical model is open - Schema_1 is not implemented
CREATE TABLE TABLE_1
Column_1 NUMBER
) LOGGING
;3) physical model is open - Schema_1 is implemented by User1
CREATE TABLE User1.TABLE_1
Column_1 NUMBER
) LOGGING
;4) physical model is open - Schema_1 is implemented by User1; Table_1 is directly assigned to User2 in physical model
CREATE TABLE User2.TABLE_1
Column_1 NUMBER
) LOGGING
;Philip -
Table for relation between WIP and Production Order
Dear All,
Please provide me table having relation between Production Order Number and WIP for it.
Regards,
Sachinhttp://www.sap-img.com/
Free ABAP eBook Download
SAP MM, SD, FI, PS, PP, PM, HR, System Tables
Regards,
Rajesh Banka -
Sql datamodeler: Engineer to relational model: General Options
Hello
When you engineer your logical model to a relational model you get a wizard. In lower part of this wizard byou have several tabs, one of the tabs is called general.
On this general tab you have check box: Apply Name Translation
The corresponding help text:
Apply Name Translation: Controls whether formal names are translated to abbreviated names when the logical model is forward engineered to a relational model, and whether abbreviated names are translated to format names when a relational model is reverse engineered to the logical model. Name translation is applied only for valid names. In addition, translations between the words entity/attribute/key and table/column/index are performed.
Does anybody have a clue what is meant here?
Regards ErikErik,
you have to create glossary (tools>Glossary editor) with words permitted for usage in names in logical model. For each word you can define abbreviation that will be used in transformation process.
Example:
Employee - EMP
Salary - SAL
Attribute "Employee Salary" will be transformed to column "EMP_SAL".
You can define preferred abbreviation for entities and attributes and it can be used instead of glossary definitions.
You also have to set your glossary in "Tools>General Options>Naming standards>Glossary"
Best regards,
Philip -
Bridge Table between two fact tables
Hello everybody,
From what I have read on the BI Administration tool help and on this forum, bridge tables are used to define many-to-many relations between dimension sand fact tables. Is it possible to have a bridge table defining a many-to-many relation between two fact tables?
Here is my senario:
1. We have a fact table called fact_Orders describing orders for some products.
2. We have a fact table called fact_Sales describing sales og these products.
3. We have a table describing the transformation from order lines to sales lines which is a many-to-many relation, because it is possible to transform an order in more than two steps.
I was thinking of connecting the two fact tables with a bridge table.
If bridge tables are inappropriate for this case, what could be a better model for my senario?
Thanks for your time.Hi,
Well a conformed dimension is a bridge table between two facts, so not sure why you need anything else. If there is a one to many from D1 to F1 and a one to many from D1 to F2 then effectively there is a many to many join from F1 to F2 through the D1 dimension.
Sounds to me like all you need is an order dimension table, rows in the orders fact table will join to this dimension and so will rows in the sales fact table. You can then do calculations like number of sales per order, total sales revenue per order, # of order items per order etc etc.
Regards,
Matt -
Fwd engineering entity name changes to relational model?
I changed an entity name in my logical model after generating a relational model. But, I cannot figure out how to have SDDM (3.0.0.665) propagate this change to the relational model.
In the Engineer To Relational Model screen, if I select the changed entity from the tree view, in the Details pane there is a "Selected" check box next to the Name property (this line shows the discrepancy between logical name and relational name) but I can't check it. Under the Compare/Copy Options tab in that same dialog, the check box next to Name is checked. But, when I forward engineer the name is not changed.BTW I just noticed that if I enable "Name Translation" then it seems to work. This is not at all intuitive or obvious, nor does it seem to be explained in the documentation.
According to the help:
Apply Name Translation: Controls whether formal names are translated to abbreviated names when the logical model is forward engineered to a relational model, and whether abbreviated names are translated to format names when a relational model is reverse engineered to the logical model. Name translation is applied only for valid names. In addition, translations between the words entity/attribute/key and table/column/index are performed. -
Bridge table between fact/dim table
My requirement is to create a relationship between fact (service request) and dim (timesheet) table.
Many rows of dim table is related to a record in Service request. Hence i created a bridge table to join them.
I imported the bridge table into physical layer. Then created two foreign key between the bridge table, dim/fact tables.
Then pulled the bridge table into the dimension logical table source. Then created a new logical join between the fact and dimension table.
When i want to count the nbr of service request, my query is not hitting the service request fact.
Is there any step missed to create the relationship between the fact and dimension for introduction bridge table.
Pls any one provide the step by step for this process. This is little urgent.
ThanksJust continue on Marks blog...he put it all together nicely:
http://www.rittmanmead.com/2007/06/19/obiee-data-modeling-tips-1-integrating-1-1-and-1-many-source-tables/
and
http://www.rittmanmead.com/2007/09/16/obiee-dimension-data-modeling-redux/
Cheers,
C. -
Changing relationship cardinality in relational model
Using SDDM 3.3.0.747.
When a foreign key relationship is defined between two tables in the relational model, the cardinality symbol displays as one-to-many by default.
Is there a way to specify that the relationship, and therefore the cardinality symbol, should be something different, such as one-to-one?Kent and Philip, thank you. That's exactly what I was looking for. "Correct" answer to Philip because it worked and he replied first. "Helpful" points to Kent.
And Kent, that's all I needed. Thank you for going further and asking. -
Select schemas from relational model on import from data dictionary option
Hi All,
I have one relational model with 3 diferent schemas,
I want to compare one of my schemas with the data dictionary I have in a database,
I select the import option in the general file menu, select from data dictionary option,
select the connection from my database,swap target model checked,select a physical model and select the objects i want to compare from the database,
My problem is that the result is the comparison between all the objects in my model and the objects in the database that I have selected,
what I really want is to compare a list of objects in my model to a list of objects in my database,
this could be possible? or always need to compare all the objects of the model?
Thanks in advanceHi jbellver,
there is no any development in DM 3.1.0.691 on that problem. In production release you'll be able to compare objects in subview with database or just to select several objects and compare them with database. And of course "generate in DDl" filtering still can be used - it works at "Compare dialog" level.
Philip
Maybe you are looking for
-
hi experts how can i find out what is the meaning of the message numbers in batch input operation, and what is the meaning of the message type. thanks amit
-
Using method MB_DOCUMENT_UPDATE of MB_DOCUMENT_BADI
Hello dear friends! I 'm trying to use the method MB_DOCUMENT_UPDATE for MB1B, but this method is not acessed when I'm using the transaction. I've tried to debug but it only pass in the code of the method MB_DOCUMENT_BEFORE_UPDATE. I need to create a
-
Significance of Partitions in sensor imaging
What are these partitions, how do they differ?? a) Application Partition b) Recovery Partition c) System Images.
-
Adding new hard drive for Flash recovery area
i am adding new hard drive for flash recovery area. How i can make single directory on that flash recovery area & how i can test that i am accessing that rightly , to that directory & flash back recovery area disk?
-
Hi Experts, In our process the currency of finished item is in GBP and the currency of child item is in INR. Now at the time of production order(closed) the journal remark of that finished item is not creating and actual component