Generate the Sql Data model ER diagram

Hello

I want to use the Oracle Sql Developer Data Modeler to generate ER diagram for my schema. There are a lot of tables in this schema, so I would like to exclusively identify the tables that should be selected to generate my ER diagram.

Basically, I want these table that are related to other tables here. The reason being, if I select all the tables in the schema, and then I went to these tables in the ER diagram which have nothing to do with other tables.

Please can anyone suggest write queries that produce this data dictionary?

Thank you.

select uc1.constraint_name,
       uc1.table_name,
       uc1.constraint_type,
       uc2.constraint_name,
       uc2.table_name,
       uc2.constraint_type
from   user_constraints uc1,
       user_constraints uc2
where  uc1.constraint_type='R'
       and uc1.r_constraint_name=uc2.constraint_name

This gives you the relationship between the primary and foreign key

Tags: Database

Similar Questions

  • Problem with the two EA DEVELOPER SQL DATA MODELING 3.0.0.665 and 3.1

    I created a model of very large data using SQL Developer data 3.0.0.665 and 3.1 EA maker. Its having a lot of check constraints. Whenever I am the design of the fence and the DOF and reopening export to import the DDL file failure to import completely check constraints. It is important to check constraints, but without any range of values inside. Its very frustrating because whenever you open import ddl, you must manually add again all the details of data check range constraint.

    OS: Windows XP.
    Check in the two EA Developer SQL Data Modeler 3.0.0.665 and 3.1

    -------------------------------------------
    Here are the contents of the .dmd file.
    -------------------------------------------
    * <? XML version = "1.0" encoding = "UTF - 8"? > *.
    * < OSDM_Design class = "oracle.dbtools.crest.model.design.Design" name = 'Admin_Panel' id = "9BE18B0A-6C67-2E5B-00DE-BD8312189ECB" version = "3.41" > * "
    * < createdBy > administrator < / createdBy > *.
    * < Createduserid > 2011-10-17 08:32:18 UTC < / Createduserid > *.
    * < Admin_Panel ownerDesignName > < / ownerDesignName > *.
    * < false capitalNames > < / capitalNames > *.
    * < designId > 9BE18B0A-6C67-2E5B-00DE-BD8312189ECB < / designId > *.
    * < / OSDM_Design > *.

    -------------------------------------------------------------------------------
    An example how the check constraints to get dirty.
    -------------------------------------------------------------------------------
    Initial check constraint is as below:
    ======================
    ALTER TABLE test_table
    ADD CONSTRAINT Active_Flag_ck
    CHECK (Active_Flag IN ('A', 'I'))
    *;*

    Below how it occurs once I have imported the ddl and re-export:
    ============================================
    ALTER TABLE test_table
    ADD CONSTRAINT Active_Flag_ck
    (CHECK)
    *;*

    I'm in trouble as I already in the middle of the my development using SQL Developer Data Modeler.

    Please help me soon.

    Jean

    Hi John,.

    Every time I'm fence design and export the ddl and reopening through the import of the DDL file

    Why are you doing this? Once the DDL file is imported and then save the drawing and open simply saved design, no need to generate the DDL and import it every time that you start Modeler data.
    On the list of values - forced as this CHECK (Active_Flag IN ('A', 'I')) are imported as constraint check plain and not as a list of values.
    There are the more specific elements import of check constraint - they are defined as type database constraint that you select during the import. Accordingly if you import your DOF as Oracle 10 g DDL, then you will get forced correct check in DDL generated for Oracle 10 g and Oracle 11 g. Constraint of evil will be generated for Oracle 9i. You can move the constraint for Oracle 9i (in the check constraint dialog box) or generic if it can be treated as such constraint.

    I logged for DOF bad bug.

    Philippe

  • SQL Data Modeler

    Hi all

    I use sql schema from the schema generation datamodeller for my er. I generated on the guest design, but since I have 200 tables in design, it is not possible to print it, also when I create a PDF of it shows the file 200 KB but when I open it it is empty Adobe reader9.

    I want just the output I see in the designer in PDF or word format. Is it possible that I have to forward it to the development team.

    Thank you.

    Hello

    There is a forum for the tool space: SQL Developer Data Modeler

    Please mark this question as answered (so others know they can ignore it) and post again in the forum Data Modeler.

    Concerning

    Marcus

  • Could not add the instance VO in the AM data model

    Jdev version: 11.1.2.4

    Steps to follow:

    (1) created a VO based on the SQL query.

    (2) when you try to add the VO instance in the AM data model, "Add an Instance" arrow (right arrow) is disabled.

    Please advise.

    Found resolution - Metalink Note 1530486.1.

  • The Siebel data model with attribute mapping rule OPA?

    Hello

    Someone at - it has mapped siebel attribute of data model with the attribute rulefiles (rule of word doc file) (for example, p1, p2, p3... generated automatically)?

    I imported the siebel data model in OPM version 10.2. He created siebeldatmodel.xsrc file. all siebel attribute created with ID, model ID with the same name as the name attribute of siebel. but in the rulebook, we attributte with p1, p2, p3... names etc.

    The problem I am facing at I'm not able to map the attribute siebel generated with attribute (p1, p2, p3) rule book

    Any quick suggestions of experts will be very apperciable.


    Thank you

    There are a few simple rules for text attributes.

    1. unless the attribute belongs to the global level, the attribute must have the text of the entity included in its text. Thus, if the attribute belongs to the 'contact' it must understand that in its text. The possible options are:

    "* the contact work country."

    "the country of work of * the * contact."

    2. you cannot have two attributes with the same public name or the same text. So, you will get an error if you have two attributes with the same text "the country of work.

    Published by: frank.hampshire on July 27, 2011 13:50

    Published by: frank.hampshire on July 27, 2011 13:50

  • Returns a route with the network data model

    Hi all,

    I like to read (on Chapter 11 of "Pro Oracle Spatial for Oracle Database 11g" manual) is it possible to receive the direction of travel of the computation of the path more runs using the routing engine.

    I want to ask you: is possible to receive the sense of the market by using the network data model? (for example, by using the Java API).

    Thank you in advance.

    Hello

    NDM API manages only the paths to the topological level. i.e. path of nodes and links. It generates no routes since the paths.
    You must use information Street links to generate driving directions yourself. You may need to use the sign post information as well as information geometry (towers from left to right) for directions.

    You can also use (API XML that uses the NDM API as its scan engine!) of the motor routing service Oracle to generate your itineraries which will include directions.

    Jack

  • Can not see all the stored procedures in the Entity Data Model Wizard

    I hope it is a simple oversight on my part I try to use the new beta version of odp.net with entity framework support. I can open the Entity Data Model Wizard, give him my information database, and I can choose various tables to use successfully. But in the list where I select the tables, views and stored procedures, the wizard does not see my stored procs or my point of view.

    Does anyone know why he would see the tables but not views or stored procedures? My procs can be found under "packages" If that makes a difference. I tried to create a fictional stored procedure at the level above the title of 'procedures', but it is unclear whether.

    Is it possible for me to debug this from here? The log files, I could watch that would help me?

    Thank you
    Jim

    I belive your Oracle database 10 g such as 9iR2 predates.
    ODP/EF Beta does not list the stored procedures or functions when connect you to a database Oracle 10 g before.

    Readme.txt:
    4. the procedures are not compatible with the DB 9.2.
    Thus, there is no stored procedure listed by the EDM Wizard for 9.2 DBs.

  • Roads divided into the network data model

    Hello world

    I have a network model which consists of tables for the links and nodes of the city. The problem I have is that the links / roads are divided roads and some are not. As it is a partition in the middle to separate the road as on motorways and main roads.
    I can't seem to understand how the network data model which roads are divided and which are not. Also driving is supposed to be on the left side of the road.
    Please help and give your opinion,

    Thank you and best regards,
    Avinash

    Published by: avibooks on Sep 17, 2008 18:26

    Avinash,
    The function that you used in MapViewer is only for demonstration purposes. It does not contain the complete modeling and analysis of the model of network Spatial Oracle database functionality.
    I'm going to recommend that you use the Oracle Spatial NDM Java API (manual) instead.
    A workaround, you can try is to treat the physical barrier information yourself.
    As stated in my 1st approach, store this information in the table of links,.
    issuance of a JDBC query to the links table and check whether the link at the end of the path contains physical barriers.

    -Jack

  • [SOLVED] Export Oracle SQL Data Modeler is missing a PRIMARY KEY on the DDL script

    I use data 4.1.888 maker to create an ER diagram and generate a DDL her script.

    The diagram contains more than 40 paintings, most of them have a primary key defined.

    For some reason any there is a table that has a primary key defined, but which is ignored when I export the model to a DDL script.

    It is the "wrong" key (even if it is checked that it is not found on the generated DDL script):

    4faS5.png

    This is where the key is set:

    O5mPb.png

    And it is the preview of the DDL (Yes, primary key up there shows):

    SrwMu.png

    This is what happens if I try to generate the DDL for just this (still not generated primary key) table:

    MljUm.png

    Has anyone had the same problem? Any ideas on how to solve it?

    There is no error in the log file, but when I run the generated DDL script there, and then I realized that I was doing something wrong:

    The table MEMBERS had a mandatory foreign key from another table, which in turn had a mandatory key against MEMBERS himself.

    So even if I could generate this primary key on members myself, and then run the the constraint definition that returned an error on the DDL script, I could not perform an insert operation on any of these two tables because of the constraint.

    I revised my design and realized relationships was not mandatory. I unchecked the mandatory box on the definition of the constraint and everything went well.

    I could reproduce the problem and the solution on a diagram with only two tables, so I'm sure that's it.

    Anyway, the Data Modeler is "a failed" silently in this kind of situation. It should be fairly obvious to an experienced designer that I was doing something wrong, but it is not so obvious when you deal with dozens of tables and all their relations and this is your first time using the Modeler.

    Thanks for your reply :-)

  • The maximum size of the model in SQL Data Modeler?

    Hello

    The number of objects is the maximum value that can be used in a model in SQL data maker. I reverse engineered a scheme (see previous posts - thank you to all that helped) which contains 1000 + tables (a candidate for remanufacturing if ever I saw a!) but the Data Modeler is struggling to display them and performs very slowly. I can pull the same schema in the Oracle Designer and that works well, as ERwin-t - y at - it something I can do to improve the performance of the Data Modeler?

    Or people would recommend cutting the model into smaller pieces, which will be a little difficult because it's a bit of a rat's nest.

    John

    Hi John,.

    You can try to fix the memory usage - Re: problem of memory with large model

    And you may have better performance if divide you large diagram in subviews.

    Philippe

  • SQL Data Model 3.0 EA1 trying to create the primary key on OT

    Hello

    I am trying to change a primary key of a table of the object that has been reversed (imported) from an Oracle 11.2.x RDBMS and get the error message "the incomplete Index Definition. It is displayed in the window "columns transfer Index." I get to the window"properties of primary key 'by pressing the 'Properties' button on the 'table properties'-> 'Primary key'. If I try to change the expression, and then press Ok or apply buttons I get the error. With this be corrected in the production version? That we will be able to create a model in the SQL Developer Data Modeler, which generates a SQL statement similar to the following:

    ALTER TABLE x_flags
    ADD (CONSTRAINT x_flags_pk PRIMARY KEY (flags.id))

    ?

    Thank you
    Scott K

    Hi Scott,.

    I am trying to change a primary key of a table of the object that has been reversed (imported) from an Oracle 11.2.x RDBMS and get the error message "the incomplete Index Definition"... With this be corrected in the production version?

    Yes

    That we will be able to create a model in the SQL Developer Data Modeler, which generates a SQL statement similar to the following:

    ALTER TABLE x_flags
    ADD (CONSTRAINT x_flags_pk PRIMARY KEY (flags.id))

    I guess that 'flags' is the type of the object column and 'id' attribute of this type. I logged for this bug, there are however not for 3.0.

    Philippe

  • Retrieve data from PL/SQL block and generate the UNIX data file

    Hi all

    I comply the following Unix Shell Script code block. The following code was generated the file count_curdate.txt with all need info. The query gives the number of records, the partition_dt group

    ABC ='sqlplus-s < < of folklore > count_curdate.txt
    uname/paswd@ConnectString
    SET THE OFF POSITION;
    SELECT COUNT (*) | «, » || partition_dt of the XYZ group by partition_dt;
    "exit";
    END '

    But now I need to change the above code to use dbms_application_info.set_module in it. Could someone let me know how to generate the file using PL/SQL in Shell Script block. I have tried following written code, but it generates count_curdate.txt file with 0 bytes.

    ABC ='sqlplus-s < < of folklore > count_curdate.txt
    uname/paswd@ConnectString
    Set serveroutput on;
    SET THE OFF POSITION;
    Set feedback off;
    BEGIN
    DBMS_APPLICATION_INFO.set_module (' shm.ksh ',' get account per day ");
    FOR again IN (SELECT COUNT (*):) «, » || partition_dt as 'DCount"of the XYZ of partition_dt group);
    LOOP
    DBMS_OUTPUT. Put_line (reccur. DCount);
    END LOOP;
    end;
    /
    "exit";
    END '

    Hello, your PL/SQL is not successfully completed, i.e.,.

    This:

    ABC=`sqlplus -s < count_curdate.txt
    uname/paswd@connectstring
    set serveroutput on;
    SET HEADING OFF;
    set feedback off;
    BEGIN
    dbms_application_info.set_module ('shm.ksh','get count by day');
    FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt);
    LOOP
    DBMS_OUTPUT.PUT_LINE(reccur.dcount);
    END LOOP;
    end;
    /
    exit;
    END`
    

    Should be this:

    ABC=`sqlplus -s < count_curdate.txt
    uname/paswd@connectstring
    set serveroutput on;
    SET HEADING OFF;
    set feedback off;
    BEGIN
    dbms_application_info.set_module ('shm.ksh','get count by day');
    FOR reccur IN (SELECT COUNT(*)||','||partition_dt as "dcount" from XYZ group by partition_dt);
    LOOP
    DBMS_OUTPUT.PUT_LINE(reccur.dcount);
    END LOOP;
    end;
    /
    exit;
    EOF`
    
  • Between the SQL Dates

    Hello

    Can someone help, I need to generate a pivot table to aid between two dates and a Department. I am trying to achieve the following output:

    JAN-04 Feb-05 MAR-04 Apr-04 MAY-04 June-04 Jul-04 August-04 SEVEN-04 OCT - 04 etc.
    1 1 1 1 1 DEPT
    FC
    1 1 1 1 1 IF


    The SQL code is displayed as below:

    "PERSON_ID" "EFFECTIVE_START_DATE" "EFFECTIVE_END_DATE" "DEPT".
    1182 12 JANUARY 04 CF 7 MAY 04
    1182 17 JUNE 04 31 DECEMBER 12 IF

    Can someone help with the realization above PivotTable based on SQL results above

    Thank you
  • Filter KeywordFilterField customized for the tabular data model

    I am currently looking for the rows in the table that is filtered through the KeywordFilterField. The underlying data are in table form:

    Contact {name, phone, etc etc}

    The KeywordFilterField shows only what I pass to it (Contact.Name) by calling setSourceList() and filters that the channels in the list. So if I get the numbers, which will return a list empty, because none of the Contacts have numbers in their names.

    However, what I want to do is query the table, like a SQL query, retrieve lines that correspond to a part of Contact.Name or Contact.Phone. (Remember this application don't use SQLite.) I'm using RMS to persistent storage and I created my database and queries of base by hand.)

    Is there a way I could customize/override the filter query so that the KeywordFilterField calls my query functions rather than it's default filter String? It is a base with search CRUD application. I use KeywordFilterField because it's everything I need.

    Any help would be useful.

    It is possible with a text field and a list field, this way you can make your own personalized search for the keyword filter field does not search your data the way you want. In addition, I know that the keyword filter field is broken and that it was returning always completely incorrect search result for me.

    Here's an overview of what to do. Some things I can't tell you how for example to what is happening in the function "searchContacts" since it is up to you to write the code to do whatever custom search you want.

    class CustomKeywordFilterScreen extends MainScreen implements FieldChangeListener, ListFieldCallback
    {
        //just a slightly modified edit field for use in entering keywords
        private CustomKeywordField _filterEdit;
        //a standard list field
        private ListField _countryList;
    
        //temp variable to hold the last keyword searched so we don't search for it again
        //you'll see this used later on
        private String _previousFilterValue;
    
        //any other private vars you need to hold search results go here
        //we'll use an a Contact[] for illustration
        private Contact[] _contactResults;
    
        CustomKeywordFilterScreen()
        {
            super(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
    
            //initiaize to empty string
            _previousFilterValue = "";
    
            //searchContacts is whatever function you write to do the customized search you want,
        //in this example passing an empty string returns all contacts
            _contactResults = searchContacts(_previousFilterValue);
    
            //create the edit field and set it as the title of the screen so it's always visible,
        //even when you scroll the list
            _filterEdit = new CustomKeywordField();
            _filterEdit.setLabel("Search: ");
            _filterEdit.setChangeListener(this);
            setTitle(_filterEdit);
    
            //create the list for showing results
            _contactList = new ListField();
            _countryList.setRowHeight(-2);
            _contactList.setSize(_contactResults.length);
            _contactList.setCallback(this);
            add(_contactList);
        }
    
        protected boolean keyChar(char c, int status, int time)
        {
            if (c == Characters.ESCAPE)
            {
            //user pressed escape key, if there's something in the edit field clear it
            //otherwise handle it as closing the screen or whatever else you want
                if (_filterEdit.getTextLength() > 0)
                {
                    _filterEdit.setText("");
                }
                else
                {
                    //close the screen or do something else, it's your call
                    //maybe even do nothing, whatever you want
                }
                return (true);
            }
            else
            {
            //all other keystrokes set focus on the edit field
                _filterEdit.setFocus();
            }
            return (super.keyChar(c, status, time));
        }
    
        public void fieldChanged(Field field, int context)
        {
            if (field == _filterEdit)
            {
            //test the edit field's value against the previously searched value
            //if NOT the same then do a search and refresh results
                if (!_filterEdit.getText().equals(_previousFilterValue))
                {
                //cache the newest search keyword string
                    _previousFilterValue = _filterEdit.getText();
    
                    //search your data
                    _contactResults = searchContacts(_previousFilterValue);
            //update the list size to cause it to redraw
                    _contactList.setSize(_contactResults.length);
                }
            }
        }
    
        public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width)
        {
            if (listField == _contactList && index > -1 && index < _contactResults.length)
            {
                //draw your list field row as you want it to appear
            }
        }
    
        public Object get(ListField listField, int index)
        {
            if (listField == _contactList && index > -1 && index < _contactResults.length)
            {
                return (_contactResults[index]);
            }
            return (null);
        }
    
        public int getPreferredWidth(ListField listField)
        {
            return (Display.getWidth());
        }
    
        public int indexOfList(ListField listField, String prefix, int start)
        {
            return (-1);
        }
    }
    
    class CustomKeywordField extends EditField
    {
        CustomKeywordField()
        {
            super(USE_ALL_WIDTH | NO_LEARNING | NO_NEWLINE);
        }
    
        protected void paint(Graphics graphics)
        {
            super.paint(graphics);
    
            //Draw caret so the edit field always shows a cursor giving the user an indication they can type at anytime,
        //even when the focus is on the list field that is used in conjunction with this edit field to create a
        //keyword filter field replacement
            getFocusRect(new XYRect());
            drawFocus(graphics, true);
        }
    }
    
  • Help file XML generating the table data

    Hello, I am new to generate XML and tried a host of options, including using variants of XMLELEMENT, XMLGEN and XMLDOM, all to nothing does not. I need to write code that will generate an XML file that will produce results such as below. Data will be taken from a table called cmdb_formatted_test and number of lines may vary. The code below seems to work almost however I get an error "not enough values. The select works if I don't mean to put the clob data in the variable.

    [code]

    DECLARE

    l_file_name VARCHAR2 (30);

    l_file_path VARCHAR2 (200);

    l_xmldoc CLOB.

    BEGIN

    l_file_path: = 'cmdb_dir ';

    l_file_name: = 'TEST_XML.xml ';

    Select xmlelement ("xmlns:ns1 = 'CILoad' ns1:CIList'),

    XMLELEMENT ("ns1:ConfigurationItem", XMLATTRIBUTES (c.transactionID, c.action),

    XMLELEMENT ("ns1:RequiredElements",

    XMLELEMENT ("ns1:AssetTag", c.assettag)

    XMLELEMENT ("ns1:CIName", c.ciname)

    XMLELEMENT ("ns1:FdaStatus", c.fdastatus)

    XMLELEMENT ("ns1:OwnerGroup", c.ownergroup)

    XMLELEMENT ("ns1:OwnerPerson", c.ownerperson)

    XMLELEMENT ("ns1:SoxCritical", c.soxcritical)

    XMLELEMENT ("ns1:Status", c.status)

    XMLELEMENT ("ns1:Type", c.type)

    ) like"ADDITIONS".

    ). getclobval()

    in l_xmldoc

    of cmdb_formatted_test c;

    dbms_xslprocessor.clob2file (l_xmldoc, l_file_path, l_file_name, nls_charset_id ('UTF8'));

    END;

    /

    [/ code]

    Need for XML output is attached

    You don't have to try things at random, all of this is well documented, with examples:

    Generate XML from the database data

    Your query, although not correct, returns two columns. That's why Oracle is complaining when you try to search in a single variable.

    Not tested, but the following should be close to what you want:

    DECLARE
    
      l_file_name      varchar2(30) := 'TEST_XML.xml';
      l_file_path      varchar2(30) := 'CMDB_DIR'; -- you probably want uppercase here
      l_xmldoc         clob;
    
    BEGIN
    
      select '' ||
             xmlserialize(document
               xmlelement("ns1:CIList"
               , xmlattributes('CILoad' as "xmlns:ns1")
               , xmlagg(
                   xmlelement("ns1:ConfigurationItem"
                   , xmlattributes(
                       c.transactionID as "transactionID"
                     , c.action as "action"
                     )
                   , xmlelement("ns1:RequiredElements"
                     , xmlelement("ns1:AssetTag", c.assettag)
                     , xmlelement("ns1:CIName", c.ciname)
                     , xmlelement("ns1:FdaStatus", c.fdastatus)
                     , xmlelement("ns1:OwnerGroup", c.ownergroup)
                     , xmlelement("ns1:OwnerPerson", c.ownerperson)
                     , xmlelement("ns1:SoxCritical", c.soxcritical)
                     , xmlelement("ns1:Status", c.status)
                     , xmlelement("ns1:Type", c.type)
                     )
                   , xmlelement("ns1:OptionalElements", null)
                   )
                 )
               )
               as clob
             )
      into l_xmldoc
      from cmdb_formatted_test c ;
    
      dbms_xslprocessor.clob2file(l_xmldoc, l_file_path, l_file_name, nls_charset_id('AL32UTF8'));
    
    END;
    /
    

Maybe you are looking for