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

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 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

  • 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.

  • 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.

  • Get DDL for uncrypted packages using DBMS_METADATA

    Hi all,
    i was wondering if i could extract DDL sources for only uncrypted packages in my database using DBMS_METADATA?
    i have a lot of crypted packages stored in the DB.
    thank you in advance for your help

    dodi wrote:
    mmm so there is no way i can do that :( too bad!What about something like this (note untested)?
    DECLARE
    BEGIN
            FOR r IN
                    SELECT  DISTINCT OWNER
                    ,       NAME
                    ,       TYPE
                    FROM    DBA_SOURCE WHERE
                    NOT REGEXP_LIKE(UPPER(TEXT),'(PROCEDURE|PACKAGE|PACKAGE BODY) (.*) WRAPPED')
                    AND OWNER NOT IN ('SYS','SYSTEM','SYSMAN') -- Or OWNER IN for a specific set of SCHEMAS
                    AND TYPE IN ('PROCEDURE','PACKAGE')
                    AND LINE = 1
            LOOP
                    /*EXECUTE IMMEDIATE 'SELECT DBMS_METADATA.GET_DDL(''' || r.TYPE || ''',''' || r.NAME || ''',''' || r.OWNER || ''') FROM DUAL';*/
                    DBMS_OUTPUT.PUT_LINE('SELECT DBMS_METADATA.GET_DDL(''' || r.TYPE || ''',''' || r.NAME || ''',''' || r.OWNER || ''') FROM DUAL');
            END LOOP;
    END;

  • 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';

  • 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

  • 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

  • DDL for any table

    Hallo,, all
    i want to set DDL for 2 table and other table not have DDL,
    How to use DDL parameter in extract group..?
    Thanks,
    Riyas

    Yes, i was used that..
    how to use 1 table include DDL and many table exclude DDL..
    DDL INCLUDE MAPPED OBJNAME <schema>.<table2>
    or
    DDL INCLUDE MAPPED OBJNAME <schema>.<table2> , EXCLUDE OBJNAME <schema>.<table2>
    this params not work..:(
    thanks,
    Riyas

  • Latest update of Muse is not installing on several tries,installation gets stuck at 43% and shows '' waiting'' at the  ''Extracting''  stage for 7-8 hours after which it does not progress

    latest update of Muse is not installing on several tries,installation gets stuck at 43% and shows '' waiting'' at the  ''Extracting''  stage for 7-8 hours after which it does not progress.

    Refer to EX11....
    Creative Cloud Error Codes (WIP) | Mylenium's Error Code Database
    Mylenium

  • Guidelines required to analyze the extraction process for 2LIS_02_SCL.

    Hi All,
    I have a problem here regarding the extraction process for the DataSource 2LIS_02_SCL. The values posted by date fields like
    Posting Date (0PSTNG_DATE)
    Schedule Line Delivery Date (0SCL_DELDAT)
    Statistics Date  (0STAT_DATE)
    In BW are suspected to be wrong values.
    So I am supposed to check the extraction process for PO Schedule Line (2LIS_02_SCL).
    So how can I proceed with this analysis in BW side as well as in SAP R/3.
    Can anyone please help with the process.
    Thanks in advance.

    Hi,
    In Bw thre is always confusion about following Dates.
    Posting Date (0PSTNG_DATE)
    Schedule Line Delivery Date (0SCL_DELDAT)
    Statistics Date (0STAT_DATE)
    So ask Functional Consultants and Business USers and Identify the corretc Date in ECC and then Change the Mapping In UPdate Rules in BW. i.e. What date USer is wanting and accordingly we nee dtgo change the mapping in UPdate Rules in Time Char Tab in UpdateRules.
    Thanks
    Reddy

  • How to analyze the extraction process for 2LIS_02_SCL both in R/3 & BW.

    Hi All,
    I have a problem here regarding the extraction process for the DataSource 2LIS_02_SCL. The values posted by date fields like
    Posting Date (0PSTNG_DATE)
    Schedule Line Delivery Date (0SCL_DELDAT)
    Statistics Date (0STAT_DATE)
    In BW are suspected to be wrong values.
    So I am supposed to check the extraction process for PO Schedule Line (2LIS_02_SCL).
    So how can I proceed with this analysis in BW side as well as in SAP R/3.
    Can anyone please help with the process.
    Thanks in advance.

    Hi,
    In Bw thre is always confusion about following Dates.
    Posting Date (0PSTNG_DATE)
    Schedule Line Delivery Date (0SCL_DELDAT)
    Statistics Date (0STAT_DATE)
    So ask Functional Consultants and Business USers and Identify the corretc Date in ECC and then Change the Mapping In UPdate Rules in BW. i.e. What date USer is wanting and accordingly we nee dtgo change the mapping in UPdate Rules in Time Char Tab in UpdateRules.
    Thanks
    Reddy

  • Standard Oracle DDL for W_PARTY_D

    Hi,
    Can someone please provide me the standard DDL for table W_PARTY_D w.r.t. Oracle Database 10g.
    I do not find it in any files in that are there in the following folders:
    c:/oraclebi/dwrep

    Do you want to know how to get the same without asking any one?
    Logon to Informatica designer->Target Designer
    Pull the table
    Menu->Target->Generate/Execute SQL...
    Check option at 'Generate options' and then click on 'Generate SQL file'
    and then 'Edit SQL file'
    If helps mark as correct
    Edited by: Srini VEERAVALLI on Mar 27, 2013 9:14 AM
    I would assume you would do this (as I said) in Informatica folder SILOS, since we go for custom folders for any customization and the
    OOB folders remain untouched and have OOB data definition.
    I dont think any other method would help you to get this.
    Edited by: Srini VEERAVALLI on Mar 27, 2013 11:32 AM

  • Error "No extraction structure for event I3" running set up 2LIS_17_I3HDR

    Hi, Experts:
    I am trying to activate and run set up datasource for PM 2LIS_17_I3HDR, so that data can be extracted from R/3 into BW 3.5 system.
    In R/3 environment, we have 2 clients. client 200 for configurations but has no data, and client 230 has data but can not change configurations.
    I have done the following in client 200:
    - Activated datasources for for PM 2LIS_17_I3HDR in RSA5.  
    - Made selection in RSA6.
    - Activated extract structures and datasource for application 17 in LBWE and also ran job control. Now I can see the extract structures for application 17 are active in client 200 only, but inactive in client 230. I tried to turn then active in client 230 but got error "Client 230 has status not modifiable".
    - I assume I should run set up tables in client 230 because it is the client with data in tables? But when run set up in OLIIBW, I got the error "
       No extraction structure for event I3: Messages active
       Message no. MCEX106
       Diagnosis
       You called the setup for the extractor structures of application '17' (Plant Maintenance). However no extractor structure is active for event I3 (messgaes).
       System Response
       Data for event I3 is not transferred to the BW interface.
       Procedure
       First activate the desired extractor structures for application '17' using the Customizing Cockpit and then start the setup again."
    - I can not manually activate extract structures in client 230 because it is not modifiable. I tried moving transports, the path is not set up. I see extract structures for other applications like 11, 13 are active. So I guess there may be other ways to activate the extract structures in client 230.
    - I also tried to run set up in client 200, which has extract structures for 17 in active status. But got the same error as client 230.
    Would anyone please help me with what to do to fix this?
    Thanks,
    Jenny
    Edited by: Jenny Chen on Oct 29, 2009 6:38 AM

    Hi, thanks for the reply!
    Just update for what we did to solve this. Both clients are for development. Client 200 is only for configuration but no data. Client 230 has data but not modifiable. Usually, when we create a structure, table, program, or active anything in 200. We will see it in 230 right away without transports. But this is not the case for activating extract structure for datasource from Business Content. We end up having Basis guy manually activate the structure for us directly in client 230 with transaction LBWE. That worked.
    Thanks,
    Jenny

Maybe you are looking for

  • Installing Oracle Access Manager - 11.1.1.5

    Hi I am very new to Identity Management and have been trying to set Oracle Access Manager in Windows XP. Downloaded ofm_iam_generic_11.1.1.5.0_disk1_1.zip from OTN. I cannot find the RCU for 11.1.1.5 version from the website directly. All I could see

  • Cloud automation testing feasibility using Coded UI 2013.

    Hi, I am unable to find any document which could explain whether automation testing for cloud application could be achieved using Coded UI 2013. In my project the plan is to move all applications to cloud network and as an automation tester I have au

  • Wi-fi disconnects

    My ITouch is constantly disconnecting from my wireless network. Signal strength is very good, but it usually disconnects within a minute or so. Since it is a secure network I have to keep plugging in my password. So (1) I could use a hint about keepi

  • Get the project name to use in a procedure?

    How to get the project name to use in a procedure? example <% = odiRef.getOption ("COMPATIBLE")%> - but the project name or your id? in ODI 11. thanks Edited by: user ODI Dev on 01/12/2010 16:42

  • Windows explorer 7 crashes after itunes update to 12.1.x

    I upgraded today 2/1/15 to the new iTunes.  It asked me to restart my computer and I cannot get beyond the Welcome screen.  I opened in safe mode and started iTunes.  I saw that 3 components had been updated including ITunes.  I tried to repair each