Extract DDL

how to extract the DDL of a database object in oracle 9201?
Thankx in advance for help...

Hi,
how to extract the DDL of a database object in oracle 9201?Well, I think GET_DDL would do the job for you:
SQL> set pagesize 0
SQL> set long 90000
SQL> set feedback off
SQL> set echo off
SQL> select DBMS_METADATA.GET_DDL('TABLE', 'SMALL_TABLE', 'REPLICA') from dual;
CREATE TABLE "REPLICA"."SMALL_TABLE"
( "ID" NUMBER NOT NULL ENABLE,
"NAME" VARCHAR2(4000),
"AGE" NUMBER,
PRIMARY KEY ("ID")
USING INDEX PCTFREE 0 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 204800 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "INDX" ENABLE
) PCTFREE 15 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 204800 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS"
SQL>
Cheers,
Marcello M.

Similar Messages

  • Extract DDL for Partitioned tables in Oracle 8i

    Hi
    I am currently working on an Oracle 8i database. I have a need to extract the DDL of the existing tables & indexes. Dont need a schema level DDL extract, i just need it for a couple of tables and the corresponding indexes. I am currently using PL/SQL Developer a third party tool which is okay for extracting DDL for Non Partitioned tables, but when it comes to getting the DDL for PARTITIONED tables, it doesnt give me the partition information nor the tablespace information. We dont have a license for Toad or any other tools to get the DDL's. I also dont have the export/import privs on the DB. I need a free ware that can give me the DDL for the existing partitioned tables or atleast a query that I can run against the regular DBA views, which can give me the DDL along with Storage clause, the tablespace, indexes, grants & constraints.
    Thanks in Advance
    Chandra

    I also dont have the export/import privs on the DB. I need a
    free ware that can give me the DDL for the existing
    partitioned tables or atleast a query that I can run
    against the regular DBA views, which can give me the
    DDL along with Storage clause, the tablespace,
    indexes, grants & constraints.But you (or the owner or the tables you connect with) should have export/import privs on its on tables (i.e the two tables). So use the User Views instead of DBA Views.
    USER_TABLES, USER_TAB_PARTITIONS etc

  • Oracle Golden Gate - Extract DDL only

    Hi.  We are working on a golden gate proof of concept.  The way our configuration is set up, we want to pull changes from our standby to keep load low on the primary.  This will require us to extract ddl changes from the primary, so my current plan is to put the dml on a 5 minute delay, and get the ddl immediately from the primary.  I am running into two issues, one I cannot figure out the setting to get DDL only from the primary (right now I am getting both ddl and dml from the primary), and 2, I get the following error  when retrieving data from the standby:  2015-04-16 20:08:40 ERROR OGG-00303 Oracle GoldenGate Capture for Oracle, ext1.prm: Invalid destination "+DATA/dgdemo/archivelog" specified for TRANLOGOPTION ALTARCHIVELOGDEST option, and I also get an error when I do do specify an archivelog destination.  Can anyone point me to the appropriate settings.  Below is the parameter file:
    extract ext1
    userid ggate password ggate
    --TRANLOGOPTIONS ASMUSER sys@ASM ASMPASSWORD password
    TRANLOGOPTIONS DBLOGREADER
    TRANLOGOPTIONS DBLOGREADERBUFSIZE 2597152,ASMBUFSIZE 28000
    TRANLOGOPTIONS ARCHIVEDLOGONLY
    TRANLOGOPTIONS ALTARCHIVELOGDEST primary "+DATA/dgdemo/archivelog" RECURSIVE
    discardfile ./dirrpt/ext1.dsc,purge
    reportcount every 15 minutes, rate
    exttrail ./dirdat/t1
    table SCOTT.*;

    OGG does not support ALTARCHIVELOGDEST parameter in ALO mode till OGG version 12c.
    Does GoldenGate Parameter ALTARCHIVELOGDEST Support ASM Diskgroups ? (Doc ID 1393059.1)
    Also In order to run Extract in the ALO mode when archived logs are stored in ASM,  the original database configuration must have complete file specification  in  log_archive_dest_n setting. Incomplete file specification leads ASM to ignore  log_archive_format. An Incomplete file spec only contain the diskgroup name  like +ASMDISK1.
    Users should ensure log_archive_dest is set using complete file  specification. In that case, log_archive_format is honored by ASM, and  Extract will work correctly.
    For example:
    alter diskgroup asmdisk2 add directory '+ASMDISK2/archivedir';

  • How to extract ddl

    Hi, someone to know how to extract ddl database oracle lite, using some tool or program native.
    Thanks
    Fabrício

    Hi Frabricio,
    Oracle Lite does not provide any tools to extract DDL, but you can use your own sql script by using the Oracle Lite Dictionary tables:
    Section 5.1, "ALL_COL_COMMENTS"
    Section 5.2, "ALL_CONSTRAINTS"
    Section 5.3, "ALL_CONS_COLUMNS"
    Section 5.4, "ALL_INDEXES"
    Section 5.5, "ALL_IND_COLUMNS"
    Section 5.6, "ALL_OBJECTS"
    Section 5.7, "ALL_SEQUENCES"
    Section 5.8, "ALL_SYNONYMS"
    Section 5.9, "ALL_TABLES"
    Section 5.10, "ALL_TAB_COLUMNS"
    Section 5.11, "ALL_TAB_COMMENTS"
    Section 5.12, "ALL_USERS"
    Section 5.13, "ALL_VIEWS"
    Section 5.14, "CAT"
    Section 5.15, "COLUMN_PRIVILEGES"
    Section 5.16, "DATABASE_PARAMETERS"
    Section 5.17, "DUAL"
    Section 5.18, "TABLE_PRIVILEGES"
    Section 5.19, "USER_OBJECTS"
    Regards.
    Marc

  • Extract DDL - types null pointer

    version 1.1.2.25.79 - tried to extract DDL types - just generated an empty file
    upgraded to 1.2.0.2998 - SqlDeveloper in loop (showing error message box) - forced to kill it. Also, am able click on each object type and will show the create statement. Really need to do all (to many to do one by one). Is this a known issue with the current release?

    OK, thanks for the detail. I am unable to replicate your error. (My types export OK)
    As you say, you can see the DDL, using the Code tab for the individual type selected in the Connection Navigator, so an alternative, is to select all types in the Types node and right -click for the context menu and select Export DDL.( you can export to file or the worksheet)
    Your Export DDL dialog issue is something else. Can you post more detail about your exception here and let's look into it.
    Sue

  • Extract DDL from an exp dmp file

    One feature I would find handy is the ability to read an exp dmp file to extract DDL statements from it. Are there any plans to include such a tool?

    I assume you are using traditional export/import.
    So run the import with show=Y and it will write all the DDLs in the logfile.
    Amardeep Sidhu

  • Oracle datapump extracting ddl for create user

    Hi All, I do have 11gr1 database on linux. I do have the full expdp dump of the source database I just need to extract the sql ddl for all the users(mroe than 10000) . . how can i extract ddl for create user statement from this dump file.

    user9074365 wrote:
    Hi All, I do have 11gr1 database on linux. I do have the full expdp dump of the source database I just need to extract the sql ddl for all the users(mroe than 10000) . . how can i extract ddl for create user statement from this dump file.impdp help=yes
    your desired option is listed

  • Extract DDL from Database

    Hi all,
    I am trying to extract the DDL statements for my database indexes. I am using Oracle 8i. The two option:
    (1) You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.
    (2) DBMS_METADATA.GET_DDL but it is only available for Oracle 9i and above. So it does me not good.
    Are there any other option beside (1) that I can use in Oracle 8i. Any suggestion would be appreciated.
    Thanks,
    Ravi

    You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.You haven't mentioned the OS.
    you can create the indexfile(ddl file) and remove the quoted strings using global replacement and you would have a clean SQL file with DDL's.

  • Extract DDL for all objects separately !

    Hi All
    I have a huge DB having 3000 tables (having indexes,triggers,synonym), 1200 functions/procedures, 1000 views etc.
    I need to extract only metadata and put into a version control repository.
    I need to extract all objects (tables,procs,functions,views) in separate files, with the grants for each procs/func/table/view in the respective procs/func/table/view file only.
    Indexes should be in respective table file only. Each object (procs/func/table/view etc) should have DROP command in the beginning.
    I tried sql developer, but it gives separate files for grants,indexes,triggers,drops etc and also gives option to generate one script for all tables, one for all views, one for all indexes and so on, so doesn't satisfy my requirement.
    Please suggest me a good tool (preferably FREE one) to extract the metadata in said fashion.
    Thanks.

    AnkitV wrote:
    Hi All
    I have a huge DB having 3000 tables (having indexes,triggers,synonym), 1200 functions/procedures, 1000 views etc.
    I need to extract only metadata and put into a version control repository.
    I need to extract all objects (tables,procs,functions,views) in separate files, with the grants for each procs/func/table/view in the respective procs/func/table/view file only.
    Indexes should be in respective table file only. Each object (procs/func/table/view etc) should have DROP command in the beginning.The hard part is the requirement of separating the items into different files.
    sb2075's answers are your best option. Write a PL/SQL script on the server to use DBMS_METADATA.GET_DDL or whatevever equivalent extraction routine will work for you. Loop through the objects you need from the data dictionary and writing the data using UTL_FILE. The simplified logic should look something like
    foreach table
      get the ddl
      generate filename
      open file
      write ddl
      close file>
    I tried sql developer, but it gives separate files for grants,indexes,triggers,drops etc and also gives option to generate one script for all tables, one for all views, one for all indexes and so on, so doesn't satisfy my requirement.You don't want to manually use SQL*Developer to do 3000 extractions anyways. The script should do it all for you.

  • Extract DDL for MV

    I used this script to extract the DDL of a materialized view
    select dbms_metadata.get_ddl('TABLE','PTC.NUM_CALL_MV') FROM DUAL;
    I am getting the error below
    object "PTC.NUM_CALL_MV" of type TABLE not found in schema "SYSTEM"
    Where i am wrong?
    Thankx

    dbms_metadata.get_ddl('TABLE','PTC.NUM_CALL_MV') FROM
    DUAL;Actually the problem is that get_ddl has argument schema. So if you want from another schema you supply it as third argument not <schema>.<object_name>
    BTW MVs have their according tables as well so works both of them:
    SQL> select dbms_metadata.get_ddl('TABLE', 'TEST_CNT') from dual;
    DBMS_METADATA.GET_DDL('TABLE','TEST_CNT')
      CREATE TABLE "GINTS"."TEST_CNT"
       (    "COUNT(*)" NUMBER
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
    SQL> select dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'TEST_CNT') from dual;
    DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW','TEST_CNT')
      CREATE MATERIALIZED VIEW "GINTS"."TEST_CNT"
      ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOG
    GING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"
      BUILD IMMEDIATE
      USING INDEX
      REFRESH COMPLETE ON DEMAND
      USING DEFAULT LOCAL ROLLBACK SEGMENT
      ENABLE QUERY REWRITE
      AS select count(*) from testGints Plivna
    http://www.gplivna.eu

  • Extract DDL ONLY !

    Does somone know what parameter needs to be added to extract to enable DDL ONLY ?
    I don't wan't and DML's extracted.
    Thanks a lot !

    DDL for whom or what? In other words, what scope?
    http://docs.oracle.com/cd/E35209_01/doc.1121/e29797.pdf
    Look for Understanding DDL scopes

  • Early Adopter release : Extract DDL for tables does not work

    Hi,
    just had a look at Raptor - really nice tool - easy install - could be a replacement for SQLnavigator for us. One or two things I noticed though ...
    1)
    Export->DDL for tables does not work throws following error
    java.lang.ClassNotFoundException: oracle.dbtools.raptor.dialogs.actions.TableDMLExport
         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)
    and 2)
    when I click on a package body - I get "loading ..." below it but it never puts the
    procedure names in and the "loading ..."message stays in the tree view - however you do get to see the packages in the source window.
    Realise this is very much a work in progress and am grateful to see an early release such as this. Looking forward to the production release.
    Best regards,
    David.

    OK thanks for looking ....you've obviously got the fixes on your to do lists
    Noticed that the SQL tab when you select an object works fine - displays the
    DDL for the object
    Do you think you'll have functionality so you can select many objects (shift left click) and
    then create a DDL script for them? It looks like you can do this for all objects in a schema but
    the ability to select a subset of objects in a schema would be very useful for our DBA's.
    Couldn't see any good reason for keeping using SQLNavigator
    Many congratulations on producing such a useful tool.
    Kind regards,
    David.

  • SQLDeveloper - Extract DDL without doublequote around Objects

    Hello,
    I'm using SQLDeveloper (v 1.5.3) and I'm trying to export DDL from my packages, but i don't want any doublequote surrounding objects on the output!
    Is there something I can do about it ?
    best regards,

    Hi Keith,
    The real lesson to learn is that SQL Developer offers a great Filter dialog. I learned to use a filter on public synonyms for even a small database. Just right-click on the object type node in the Connections view and choose the Apply Filter... option.
    Regards,
    Gary
    SQL Developer Team

  • Oracle_Datapump extracting table/columns ddl from pumpfile

    LS,
    Can I extract the xml-like information from the header of an existing datapump-file?
    Or can I create an external table (meant to read the datapump-file) without knowing at forehand how the table in the datapump-file is constructed, such as "Create my_ext_table As 'read the header' "?
    Using dynamic SQL, I would like to be able to compare the structure of an given datapump-file to the expected structure (comparison on columns, datatype etc.).
    Regards,
    André Klück

    user9074365 wrote:
    Hi All, I do have 11gr1 database on linux. I do have the full expdp dump of the source database I just need to extract the sql ddl for all the users(mroe than 10000) . . how can i extract ddl for create user statement from this dump file.impdp help=yes
    your desired option is listed

  • Extract all DDL of all dbms_jobs

    Hi ,
    We did export and import of all the schemas , But it didnt import all the dbms_jobs.
    So we have to do it manually , Is there any simple way to extract DDL of all the Jobs.
    Regards
    Kumar

    And your Oracle version number is?
    Define "DDL of all dbms_jobs."
    Do you mean the job definitions (dba_jobs.what) or the procedural code executed by those jobs?

Maybe you are looking for

  • Can't import shared libary into Itunes on Win 7 64 bit

    I have installed itunes 9 onto win7 64 bit and have turned on home sharing. I can see the library from my macbook pro. However, I cannot drag the any content from my mac shared library to my library on my windows pc. How can I solve this issue? HELP!

  • Firefox won't open; I get the msg. "Cannot open file or DLL C:\WINDOWS\system32\USP10.dll - what's up?

    I've tried uninstalling Firefox, re-downloading it (various versions and sites), and re-installing; I just get the same reference to "USP10.dll" in directory C:\WINDOWS\ system32 ... so wha' happen? I don't think I did anything (install or whatever)

  • Userid in forms after query

    I have a form that allows a supervisor to do an automatic query in a form by selecting a "job number". Once the supervisor selects that number, the fields of the form are populated with the existing data in the database. I currently have a trigger th

  • Pass XML in argument tag in JNLP file

    Is there a way to pass an xml string in the <argument> tag. I tried to do it but I get xml parsing error. It seems that the xml becomes the child node when I pass that to the arguments tag. the CDATA also does not work. Has anyone done this successfu

  • Storing Files and backups

    Hi, I have a timecapsule and would like to use it to 1)store files to be accessed anywhere on the net (im guessing this means using it with backtomymac?) and 2) use it for the timemachine backups These processes are each used by a different user (one