Generate DDL script tailoring

I would like to know how to tailor the sql script generated by JDev
(11.1.1.0.0) - offline database source).
I've reversed engineered a schema and modified a number of tables (in
10g). I would now want to generate a complete "create script", but
without any of the storage clause (so it can be ran in another schema in another tablespace, for example).
I would also like to tag on some tables a number of DML
statements. Could I add 'pre' or 'post' scripts attached to db objects/tables?
I would appreciate any help either on how to do it, or where I could
look to find more info on doing this.

I would like to know how to tailor the sql script generated by JDev
(11.1.1.0.0) - offline database source).
I've reversed engineered a schema and modified a number of tables (in
10g). I would now want to generate a complete "create script", but
without any of the storage clause (so it can be ran in another schema in another tablespace, for example).
I would also like to tag on some tables a number of DML
statements. Could I add 'pre' or 'post' scripts attached to db objects/tables?
I would appreciate any help either on how to do it, or where I could
look to find more info on doing this.

Similar Messages

  • 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

  • Generating ddl script in oracle

    Hi ,
    i ned a script to generate ddl's for all the objects in a particular schema.
    i used the DBMS package dbms_metadata.get_ddl
    SELECT 'select dbms_metadata.get_ddl('''||OBJECT_TYPE||''','''||OBJECT_NAME||''','''||OWNER||''') from dual;' FROM DBA_OBJECTS WHERE OWNER='RSEXT' AND OBJECT_TYPE='TABLE'
    by using the above script i am not getting the complete script.
    how can i get the complete script.
    can anyone suggest me.
    thanks in advance.

    Hi,
    two different way:
    a) write a small shell-script around the sql script an execute the shell-script from the scheduler.
    b) writh a pl/sql procedure which executes the ddl-statements using "execute immediate"
    Torsten

  • DDl script generatin

    Is there procedure/package/command in Oracle which will generate DDL script for existing objects, like
    CREATE TABLE table_name
    (col1 NUMBER(15,0) NOT NULL,
    col3 VARCHAR2(12))
    PCTFREE 10
    PCTUSED 40
    INITRANS 1
    MAXTRANS 255
    ALTER TABLE table_name
    ADD PRIMARY KEY (col1)
    USING INDEX
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    CREATE UNIQUE INDEX idx_c001 ON table_name
    col1 ASC
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    Thanks

    This Q&A covers using export/import to get DDL:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:439019911488
    This covers the exp/imp method but also includes an example from someone that provides cleaner DDL:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1464804639878

  • Validate Rules on Generating DDL

    Hello,
    What to do to create custom rules to be validated at the moment of generating DDLs ?
    Regards
    Nelson Antonio Alberti da Rosa

    Hi Nelson,
    Maybe I misunderstand, but I think you're missing something. Purpose of the design rules is to check your model (logical, relational, and process models) before generating DDL script. So there are only two places that you can apply some (all) rule:
    1. From the menu tools->Design Rules->Design Rules
    2. From DDL Generation Options screen, there is 'Design Rules' button at the bottom
    DDL generation will not stop if some of the design rule is not met. If there is design rule error it will not go in DDL script.
    So, everything you did is fine. If the rule works from above two places - it's Okay.
    Please elaborate if I misunderstood.

  • How to generate the DDL script of all the schema objects.

    Hi All,
    I just wanted to make centralized repository for Oracle database and to create a base version, I need to create the DDL scripts of all the database objects so that i can check in the same ddl scripts (sql) files in to my central repository.
    I need do this schedule job which will generate the ddl scripts once in a month(This should be automated process)
    Please help me out about this.
    Oracle version - 9i
    Thanks in advance.
    Thanks,
    Santosh
    Edited by: Santosh_Oracle on Feb 23, 2011 10:26 PM

    It is definitely possible to revise the script.
    Look at it, you already have 80 percent of it for free, and you didn't even need to Google.
    Just ask a FAQ in a forum loaded with FAQs!
    And Toad can save everything to one script per object.
    Sybrand Bakker
    Senior Oracle DBA

  • 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

  • Changes in the value of the Arc property "Include in DDL Script" is not being saved.

    I have arcs in my design that I want that the automatic DDL code not being generated because the FK are compound and the code generated for the validation of the arc in these more complex cases is not correct, so I created an explicit constraint on the table for this validation.
    But the problem is that the Arc property "Include into DDL Script" is not being saved into the design.
    If I unchecked the option for the arc and generate or preview the DDL  the arc code is not generated.
    But when I save the project, close and reopen the arcs have this option enabled again.
    I've been checking the xml files for the arcs and this property is not being included, then by default generates always.
    Thanks!

    This problem is fixed in Data Modeler version 4.0 EA3 which is now available to download.
    David

  • Error When trying to import a DDL Script

    Hi all
    I want to move my table definitions in one schema to another. So I used
    Home>SQL Workshop>SQL Scripts>Utilities-> Generate DDL and saved teh schma I want to copy as a script.
    Now I am trying to import the script into the required workspace.
    At this time I am getting this error
    ORA-20001: GET_BLOCK Error. ORA-20001: GET_STMT error. ORA-20001: Execution of the statement was unsuccessful. ORA-01403: no data found <pre>-------------------------------<br>--<br>begin<br> wwv_flow_api.g_varchar2_table := wwv_flow_api.empty_varchar2_table;<br> wwv_flow_api.g_varchar2_table(1) := '435245415445205441424C4520202244454D4F5F435553544F4D45525322200A202020280922435553544F4D45525F494422
    Unable to list script names.
    Can anyone Pls help me?
    Thanks
    Ravi Kumar

    Hi Scott
    I am using the navigation
    Home>SQL Workshop>SQL Scripts>Import Scripts to import the sql file, that I created using Generate DDL.
    Regarding APEX version, I am using the online service
    http://htmldb.oracle.com/pls/otn/
    Please let me know if you ned anymore info.
    Thanks
    Ravi Kumar

  • Generate DDL - change is a new column and I want to generate a alter table

    Morning all,
    I have searched and looked all over the data modeler and I cannot find this option ... yet I did find it easily in Designer.
    I hope you can help me.
    SQL Developer Data Modeler v3.0.0.665.
    I have added a new column to a table and when I generate the DDL I would like it to be an alter table add column rather than a create table.
    This feature is in Designer so I would think it would be in data modeler.
    Just incase my description is not clear here are the high level steps so it is clear.
    1. create the logical model
    2. create the relational from the logical.
    3. create the physical from the relational.
    4. generate DDL and run in database. At this point I go to production with my system and all is well.
    5. At this point we have an enhancement request. For the model it will be a new column in a table.
    6. update logical model.
    7. update relational from logical
    8. update physical from relational
    9. generate DDL. Here I would like to have the generate be aware the it needs only to generate an alter table add column and not create the table.
    This is something I do alot as all my models are in production. I cannot find how to do this step of getting data modeler to generate the alter.
    Designer does this exceptionally well.
    Quite often it is more than a single column. The changes can be many and made over time and at the time of generating the DDL you may not recall every single change you made. To have the tool discover those changes for you and generate the appropriate DDL is a feature I regard as very high.
    I hope this is clear and you can help me.
    Cheers
    Chris ....

    Hi Chris,
    you need to compare your model against database - import from database into same relational model and use "swap target" option - in this case "alter statements" against database will be generated.
    You can look at demonstrations here http://www.oracle.com/technetwork/developer-tools/datamodeler/demonstrations-224554.html
    Probably this particular one will be most helpful http://download.oracle.com/otn_hosted_doc/sqldev/importddl/importddl.html
    Soon or later your changes will require table to be recreated and you'll need to backup your data - you can consider usage of "Advanced DDL" option - script will be generated that will unload the content of your table (including LOBs) to file system accessible from database and restore it after changes. Well don't try it directly on production system :).
    Philip

  • FOR XML to generate dynamic script to drop multiple tables

    Log_Table has a column named Col1 where we have table names
    Col1
    TableA1
    TableA2
    TableA3
    TableB1
    TableC1
    TableC2
    Generate dynamic script to drop tables that are in Log_Table and starts with TableA.
    Instead of using the loop, use For XML

    Thanks Visakh16 [+1],
    you are right there was typo mistake :-) I forgot the variable in the end, and Thanks Naomi [+1],
    this is true and better to use quotename or just add brackets. Actually I will not choose this approach since we chould use schema as well. the DDL in the OP is not something that I will create probably.
    In any case, here is the fixed query (current approach):
    declare @SQLString NVARCHAR(MAX)
    SELECT
    @SQLString = (select
    N'IF OBJECT_ID (N''' + CAST([Col1] AS VARCHAR(MAX)) + N''') IS NOT NULL drop table [' + CAST([Col1] AS VARCHAR(MAX)) + N']; '
    FROM Log_Table
    WHERE (Col1 like 'TableA%')
    FOR XML PATH (''))
    --print @SQLString
    EXECUTE sp_executesql @SQLString
    GO
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How to view the DDL script prior to object deployment in OWB 10g R2?

    How to view the DDL script prior to object deployment in OWB 10g R2?
    Here is what I' looking for: in 10gR2, let's say I've built dimension X, but it's not deployed yet. I've selected one of the deployment options, let's say: "Deploy to Catalog only". Now, I'd like to see a DDL script that will be executed at the deployment time. Where can I find this script? What screen? What menu?
    Thanks,
    vr

    Viewing the Scripts
    After you have generated scripts for your target objects, you can open the scripts and
    view the code. Warehouse Builder generates the following types of scripts:
    ■ DDL scripts: Creates or drops database objects.
    ■ SQL*Loader control files: Extracts and transports data from file sources.
    ■ ABAP scripts: Extracts and loads data from SAP systems.
    To view the generated scripts:
    1. From the Generation Results window, select an object in the navigation tree on the
    left of the Generation Results dialog.
    2. Select the Scripts tab on the right of this dialog.
    The Scripts tab contains a list of the generated scripts for the object you selected.
    3. Select a specific script and click the View Code button.
    Regards,
    Marcos

  • Error when Exporting DDL script for whole schema

    When I right click connection, Select "Export" then "DDL Script", the following error occur (Exception Stack Trace)
    java.lang.ClassNotFoundException: oracle.dbtools.raptor.dialogs.actions.UserDDLExport
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at oracle.ideimpl.IdeClassLoader.loadClass(IdeClassLoader.java:140)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:164)
         at oracle.dbtools.raptor.dialogs.BasicObjectModifier.launch(BasicObjectModifier.java:142)
         at oracle.dbtools.raptor.dialogs.BasicObjectModifier.handleEvent(BasicObjectModifier.java:210)
         at oracle.dbtools.raptor.dialogs.actions.XMLBasedObjectAction$DefaultController.handleEvent(XMLBasedObjectAction.java:265)
         at oracle.ide.controller.IdeAction.performAction(IdeAction.java:530)
         at oracle.ide.controller.IdeAction$1.run(IdeAction.java:785)
         at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:804)
         at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:499)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    This is actually in our release notes as not implemented yet.
    The following capabilities are currently planned to be added by the production release:
    Tools > Export - Will be a DDL generator.
    I will mention in the release notes when this function is operational. The menu item is just there now as a placeholder.
    -- Sharon

  • SQL Data Modeler - Generate DDL Versioning

    Is it have any option to generate version changes DDL scripts between two version of a model?

    Hi,
    you need to check out the design at revisions you want to compare and then to compare models.
    Philip

Maybe you are looking for

  • Saving pdf from webpages

    I read a lot of PDF documents on several research web sites. On these particular websites, the PDFs load in the page only. I can right-click and select "Open in Preview" which is great, because then I can quickly skim the article and see if I want to

  • Performance tuning--- Automatic workload repository  (AWR &ADDM)

    hi all, i am in need of some kind of demo or step-by-step procedure to implement Oracle 10G Automated workload repository and ADDM.................... atleast Point me metalink note should work fine .... actually i need real time implementation detai

  • Planned order type

    Dear All, Can someone please explain me what are the planned order types and the use use of each types. Are they specific to any order types or is there any relation exists between two..? Regards A

  • I wanna find out how can i upload imovie in instagram

    how can i upload imovie clip in instragram

  • New HD does not spin up in

    Hello, I replaced the orginal 6 GB HD with a 30 GB drive (both from Maxtor). The problem is, that the new drive does not spin up and the on/off button on the iMac keeps yellow and not green. If I only connect the power cable but not the IDE cable the