Generating DDL from Server Model

I would like to generate DDL that matches ERDs from the server model in Designer. However, when selecting an application folder, and expanding Relational Tables, I see a lot of tables I don't recognize - they aren't entities in the ERD. I don't know where they came from, and some of the ERD entities aren't showing up in the server model. I just want to generate DDL that creates only the tables shown in the ERD. Any way to do this?

About your question for more complex constraints. That is not possible in Designer.
If you are using Headstart, you can achieve this by using CDM RuleFrame. This is a way to record all types of (complex) constraints (business rules).
see http://www.oracle.com/technology/products/headstart/index.html for more information.

Similar Messages

  • Possible to generate DDL from outside of JDeveloper?

    Hi:
    I was wondering if it is possible to have a build script somehow generate the DDL for a database from the model files that JDeveloper creates (in the same way one would run a SQL Plus script from the command line passing a .sql file for it). This is desirable because my project wants to keep a database schema under CM but not multiple files that have to be kept in sync (like the model files AND the DDL).
    Thanks.

    Got it! I was able to extend the "New Presentation" sample to allow users to save their newly-created presentations back to the BI catalog. Here's how:
    1) add a menu item for "Save"; add a listener for it
    m_mnuSave = new JMenuItem("Save...");
    m_mnuSave.setMnemonic('S');
    fileMenu.add(m_mnuSave, 4);
    m_mnuSave.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    mnuSave_ActionPerformed(e);
    2) in mnuNew_ActionPerformed, add code to save the presentation to a module-level variable
    Dataview dv = npw.getDataview();
    m_objPresentation = npw.getDataview(); // new code
    3) write the Save action handler
    void mnuSave_ActionPerformed(ActionEvent e) {
    String sName = "";
    int result = 0;
    if (m_objPresentation == null)
    JOptionPane.showMessageDialog(null, "No presentation to be saved");
    return;
    /* Create InitialPersistenceManager */
    InitialPersistenceManager pmRoot = (InitialPersistenceManager)getPersistenceManager();
    /* Create PersistenceObjectChooser */
    PersistenceObjectChooser dialog = new PersistenceObjectChooser(pmRoot);
    JFrame frame = new JFrame();
    result = dialog.showSaveDialog(frame);
    if (result == PersistenceObjectChooser.OK_OPTION)
    PersistenceManager pmCurrent = (PersistenceManager)dialog.getCurrentDirectory();
    sName = dialog.getSelectedObjectName();
    if (sName != null)
    try
    //if name is not bound, then rebind will bind it
    pmCurrent.rebind(sName, m_objPresentation);
    catch (Exception ex) {
    showExceptionDialog(this, ex);
    } // if sName != null
    }// if result == OK_OPTION  

  • Generating DDL from ResultSetMetaData

    Hi, I'm new to this forum although you can occasionally spot me on some of the other forums at java.sun.com. So if this is not the correct place for my question, I would appreciate a pointer to a more appropriate location.. -- Thanks
    I was wondering if anyone knew of a utility to create a DDL from a ResultSetMetaData. I'm sure I could develop one with some time, but it's for a one-off project. There is a huge Stored Procedure that someone else is going to analyze for performance. But it's speed is slowing down my testing, and I would like to create a temporary table with the results from that SP, but I don't want to manually format the hundreds of columns involved. The information needed to create the table is clearly stored in the ResultSetMetaData associated with a call to the StoredProcedure, but I don't know any way to convert that into some sort of script.
    Any suggestions?
    This is on SQL Server, and I'm not particularly familiar with it, so if anyone knows a native trick for this DBMS, that would be appreciated too.
    Thanks,
    -- Scott

    Never mind. I got it. When I came back to this after lunch, I realized both that this would likely not be a one-off, and that it shouldn't be too hard for my limited needs. The code I used is below. This is specific to SQL Server, and only to a limited number of data types, but it would be easy to extend to other's simple needs. I'm sure there are robust versions easily available, but I didn't find them. In the following code, rs is a ResultSet:
            ResultSetMetaData rsmd = rs.getMetaData();
            int colCount = rsmd.getColumnCount();
            System.out.println("IF EXISTS (SELECT * FROM dbo.sysobjects WHERE" +
                    " id = object_id(N'[dbo].["
                + tableName + "]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)");
            System.out.println("DROP TABLE [dbo].[" + tableName + "]");
            System.out.println("GO");
            System.out.println();
            System.out.println("CREATE TABLE [dbo].[" + tableName + "] (");
            for(int i = 1; i <= colCount; i++) {
                String type = rsmd.getColumnTypeName(i);
                System.out.print("\t" + ((i > 1) ? "[" : ""));
                System.out.print(rsmd.getColumnName(i) + ((i > 1) ? "]  [" : "  "));
                System.out.print(type + ((i > 1) ? "] " : " "));
                if (type.equals("varchar") || type.equals("char")) {
                    System.out.print("(" + rsmd.getPrecision(i) + ") ");
                } else if (type.equals("decimal")) {
                    System.out.print("(" + rsmd.getPrecision(i) + ", " + rsmd.getScale(i) + ") ");
                } else if (!(type.equals("uniqueidentifier")
                            || type.equals("datetime") || type.equals("int"))) {
                    throw new IllegalArgumentException(
                            "stupid DDL generator can't handle type \"" + type + "\".");
                int nullableInt = rsmd.isNullable(i);
                if (nullableInt == ResultSetMetaData.columnNoNulls) {
                    System.out.print("NOT NULL");
                } else if (nullableInt == ResultSetMetaData.columnNullable) {
                    System.out.print("NULL");
                if (i < colCount) {
                    System.out.print(" ,");
                System.out.println();
            System.out.println(")");
            System.out.println("GO");
            System.out.println();
            while(rs.next()) {
                System.out.print("INSERT INTO " + tableName + " VALUES (");
                for(int i = 1; i <= colCount; i++) {
                    String type = rsmd.getColumnTypeName(i);
                    boolean quoted = (type.equals("char") || type.equals("varchar") ||
                             type.equals("uniqueidentifier") || type.equals("datetime"));
                    if (i > 1) System.out.print(",");
                    Object temp = rs.getObject(i);
                    String value = (temp == null) ? "NULL" : temp.toString();
                    if (quoted && temp != null) {
                        System.out.print("'");
                    System.out.print(value);
                    if (quoted && temp != null) {
                        System.out.print("'");
                System.out.println(");");
            }I know this is far from elegant, and too specific to my small problem, but anyone who needs something similar should be able to modify it rather easily.
    -- Scott

  • Generating DDL from SQL Workshop

    I'm using the Database Cloud Service and am trying to see how I can generate DDL for my tables.
    I looked into the online help, which led me to this:
    http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35128/sql_utl.htm#AEUTL256
    Says to click SQL Workshop -> Utilities -> Generate DDL, but there is no Generate DDL option.  Has the option moved or the name changed?
    Thanks,
    Rick

    Hello Rick -
    The easiest way to get DDL for the tables in your Database Cloud Service is to go to the Cloud Management UI for your Service and click on the Data  Export tab. Click on the Export Data button and just do not check the box for exporting data.  This will give you DDL for your Service.
    Hope this helps.
    - Rick Greenwald

  • Generating DDL From Designer In a Set Order

    Hi,
    Designer Version is 10.1.2.0.2.
    Whenever I generate the schema/ddl creation scripts after making minor
    changes, I like to compare the new scripts against the last set just to
    make sure the changes are as I expect. The trouble is each time I
    regenerate, the order of the items is different each time, making
    comparisons difficult.
    I've tried looking for a setting in the preference sets but there isn't
    anything obvious . Anyone know how to tell it to set the order of the
    tables during generation?
    Regards
    Sandeep

    What has "Designer" got to do with SQL and PL/SQL? Please ask your question in the correct forum.

  • SQL*Developer 2.1 - Not Generating DDL for Different Users

    Using SQL*Developer Version 2.1.0.63 I get an error trying to generate DDL from another user, that has access to many other schemas. It looks to me like Sql Developer is calling the DBMS_METADATA package from within other PL/SQL.
    I am receiving the following error:
    ORA-31603: object "ACCOUNT_TYPE_LKP" of type TABLE not found in schema "POR_OWN"
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "SYS.DBMS_METADATA", line 3241
    ORA-06512: at "SYS.DBMS_METADATA", line 4812
    ORA-06512: at line 1
    I would receive these same errors in SQL Developer 1.5, but the DDL would still generated. It was picking something up, even though it had an error.
    Our DBA has not been able to provided a work around. He says you have to login directly as the owner of the objects to use dbms_metdata in this fashion.
    Is there any work around for this? I really need to be able to get DDL and I do not want to go back to 1.5 (I like the other new features of 2.1).
    Thanks,
    Tom

    We have several users currently using SQL Navigator and/or TOAD. We would like them to switch to SQL developer, but part of their job is to view the source of views in another schema. They have select privileges on the underlying tables and are able to see the source using other tools. Using SQL Developer, they receive on ORA-31603 because it's calling dbms_meta. Note ID 1185443.1 describes the issue and suggests granting the users the SELECT_CATALOG_ROLE.
    We are hesitant about granting this role to these users which allows access to ever 1,700 objects, plus execute privileges to 4 objects.
    Support indicated that Enhancement Request 8498115 addresses this issue.
    Is this something that may be addressed in the next release?
    Thanks,
    Paul

  • NVARCHAR2 table columns in server model generator

    Hi All,
    I am using designer version 9.0.2.4.
    Oracle 9.0.2.3. NLS_NCHAR_CHARACTERSET = UTF8
    I have table definition with column whose type is NVARCHAR2.
    I run generate server model definitions from table.
    If I run the generator second time (or any time when table is already present in db) the report gives me database value for column Max Length three times more than it is shown by DESC <table>.
    My guess is designer takes data_length not char_length from all_tab_columns or smth like this (when using utf8 the ratio is 3).
    Any ideas ?

    Just installed designer version 9.0.2.5. And this annoying feature is fixed.
    Thanks to all good people at Oracle.

  • How to delete the Generated files from application server(open hub)?

    hi experts,
    when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
    when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
    so to delete the generated file from application server, how to delete it for specific dates?
    Information on where terminated
    Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
    "START_ROUTINE".
    The main program was "RSBATCH_EXECUTE_PROZESS ".
    In the source code you have the termination point in line 2874
    of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
    The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
    and when i check the dump it is point out at below code
    " Populate the lookup table for 0STOR_LOC
    SELECT * from /BI0/TSTOR_LOC
    into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
    FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
    STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    but the programme is syntactically correct only.
    how to rectify the issue.
    regards
    venuscm
    Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PM

    hi experts,
    We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
    here is the code written in the Transformations
    In the global section
    Text for 0STOR_LOC
        DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
              WITH UNIQUE KEY stor_loc.
        DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
    and in the code to get the text
    " Populate the lookup table for 0STOR_LOC
        *SELECT * from /BI0/TSTOR_LOC*
          into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
          FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
                  STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
    thanks
    venuscm
    Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM

  • How to find server model from 11g OEM mgmt$ views

    How to find server model from 11g OEM mgmt$ views
    server model like Dell 710, DL380 G7 etc..,

    It is included in this query (run as user SYSMAN):
    SELECT t.target_name AS host_name,
    ecm_util.HOST_HOME_LIST (t.target_name, t.target_type) AS home_info,
    hw.vendor_name AS Vendor,
    hw.system_config AS System_Config,
    hw.machine_architecture Architecture,
    os.name AS os_name,
    os.base_version os_base_version,
    os.update_level os_update_level,
    os.address_length_in_bits os_address_length_in_bits
    FROM mgmt_targets t, mgmt_ecm_snapshot s, mgmt_hc_os_summary os, MGMT_HC_HARDWARE_MASTER hw
    WHERE t.target_type = 'host'
    AND t.target_name = s.target_name
    AND s.snapshot_type = 'host_configuration'
    AND s.target_type = 'host'
    AND s.is_current = 'Y'
    AND s.snapshot_guid = os.snapshot_guid
    AND hw.snapshot_guid = s.snapshot_guid
    ORDER by t.target_type
    The asked info is available in the view MGMT_HC_HARDWARE_MASTER, column: SYSTEM_CONFIG
    Eric

  • Problem with "Capture Server Model from the Database"

    I've installed Oracle-Developer-Suite 10g and Designer 9.0.4.5.6. The repository databse is Oracle 10g and the application database is Oracle 9i (about 700 tables for the application). After I started the Designer Editor, I got the follwoing message:
    "No network notification service has been configured for this Repository instance. A desktop-only notification has been started."
    What does it mean? What's wrong with the configuration? How can I avoid this problem?
    Then I tried to "Capture Server Model from the Database". It took hours to read the data from the database. After reading the data, the following message occurs:
    "138 overlaps could not be eliminated by AutoLayout as there is insufficient room to layout the items. Select a large area and retry"
    I can not save the uncommited data into the repository.

    1. Designer 9i was made to capture 9i DB functionality. So no it will not capture full 11 DB functionality.
    2. Yes I have had some problems capturing from an 11DB and have written a bug on it.
         Bug.7138247     (74) CANNOT DESIGN CAPTURE A TIMESTAMP(6) FROM 11G DB:
    this is fixed in Designer 10.1.2.5

  • How do I generate DDL for changes in model

    Hi
    I'm using SQL Developer 4 to mantain my logical and physical diagramas. I know how to generate the diagram and generate DDL. But how do I only generate the DDL changes?
    Regards,
    Néstor Boscán

    Basically you want to compare the model with the data dictionary, see the big arrow buttons up on the main toolbar.
    In depth answer here:
    http://www.thatjeffsmith.com/archive/2012/03/diffs-and-alter-scripts-via-oracle-sql-developer-data-modeler/

  • Including Schema owner when generating DDL scripts

    Designer 9.0.4.6
    How do i set the option to include the schema owner prefix in the DDL scripts being generate ("generate server model from database") in design editor?

    Generating from the DB Admin tab does not prefix the objects I am generating with the schema name. There isn't a generator preference (that I've found at least) to accomplish this. Has anyone been able to generate database objects prefixed with the schema name?
    Thanks,
    Wayne

  • Generate DDL formatting data incorrectly

    Greetings all,
    So I appear to have found the issue with my Generated DDL File. It is formatting the lines incorrectly and I have to manually go in and clean it up.
    For example:
    ALTER TRIGGER  "BI_MIMPBM_CA_GROUP_LKP" ENABLE;CREATE OR REPLACE TRIGGER  "BI_MIMPBM_CAT_LKP"
      before insert on "MIMPBM_CAT_LKP"              
      for each row 
    begin  
      if :NEW."CATID" is null then
        select "CAT_LKP_SEQ".nextval into :NEW."CATID" from dual;
      end if;
    end;Notice how the ENABLE;CREATE are on the same line. That throws an error. I am not sure why as I thought the ; ended a piece of code, but when I do a carriage return on it and then put it in, it works. I am using Application Express 4.0.2.00.07 and not sure if it is the application or something I am doing in the formatting of my code when I create anything.
    Is anyone else having this issue when generating DDL files? If so, is there a work around besides going through the whole script and adding carriage returns as necessary?
    Thanks
    Wally

    Is Page 5 of Data Modeling (How to generate DDL(sql) scripts to create a database) of any help?

  • Generating DDL to accept user input parameters

    I need generate DDL which will accept input parameters from user, for example, tablespace name for indexes. What is the best way to do it?
    At present, I’ve created tablespace with name ‘&INDEX_TS’ in physical model and using it to create indexes. Is this a correct way to do it?
    Also, &INDEX_TS appears within double quotes in generated DDL. Is there a way to get rid of double quotes?
    I'm using v3.1

    Hi,
    I have just found out that there is a "substitution variable" facility within SQL*Plus and SQL Developer which allows runtime substitution when applying DDL.
    Here are some extracts from the SQL Developer Help:
    Script Runner
    The SQL*Plus features available in the script runner include @, @@, CONNECT, EXIT, QUIT, UNDEFINE, WHENEVER, and substitution variables. For example, to run a script named c:\myscripts\mytest.sql, type @c:\myscripts\mytest in the Enter SQL Statement box, and click the drop-down next to the Execute Statement icon and select Run Script.
    The following considerations apply to using the SQL Developer script runner:
    For substitution variables, the syntax &&variable assigns a permanent variable value, and the syntax &variable assigns a temporary (not stored) variable value.
    So if the name starts with &&, it will only prompt for the actual name the first time it appears.
    Note that this still works if the name is presented as a quoted identifier, e.g.
    TABLESPACE "&&INDEX_TS"
    David

  • Generating XML from database

    I'm a total newbie in XML DB and need advice on generating XML from database.
    The situation is the following: there is a legacy web application which uses an XML document as a configuration file. This document conforms to some well-defined schema. For instance:
    <config>
         <title value="TITLE" />
         <subtitle value="SUBTITLE" />
         <style url="default.css" />
         <widgets>
              <widget id="1" opened="true" />
              <widget id="2" opened="false" />
         </widgets>
    </config>
    It contains portions of static data which are common for all users as well as dynamic personal data.
    Dynamic data comes from two sources:
    1) security considerations (for instance, not all widgets are available for some users) - thus the "master" configuration content must be filtered, but not otherwise modified;
    2) user preferences (for instance, user can set widget2 to be opened by default) - thus values of some attributes must be different for each user. When the user saves her preferences, the entire document with new values is posted back to server.
    We want to try to store user preferences, apply security and generate personalized configuration documents using XML DB.
    So we need advice on storage models and generation procedures - which should be more efficient and easy to support or extend.
    Please note, that there is no requirement to actually store data as XML.
    Thanks in advance!
    P.S.: Sorry for the incomplete initial post.
    Edited by: WxD on 27.09.2010 11:45

    Hi,
    See this link for more details
    http://www.stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10790/xdb13gen.htm

Maybe you are looking for