Get the DDL for all tables in a schema;

Hello

I tried to get the DDL for all tables under my own diagram "A". Here are the steps I've tried, but in vain I
 1. logged in as a user A 
2. And the ran query 
          
SELECT DBMS_METADATA.get_ddl ('TABLE', 'XYZ')
FROM user_tables
      
o/p
(HugecloB)

{code}

Any idea how i can get the DDL for all the tables under my own schema ?


Thank you so much!

Edited by: user642297 on Feb 4, 2011 12:05 PM

Edited by: user642297 on Feb 4, 2011 12:05 PM

Edited by: user642297 on Feb 4, 2011 12:05 PM

Edited by: user642297 on Feb 4, 2011 12:07 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

Your idea is good, you missed only to use the correct table name:

SELECT DBMS_METADATA.get_ddl ('TABLE', table_name)
FROM user_tables;

Concerning

Tags: Database

Similar Questions

  • How to extract the ddl for all databases of links?

    DB: oracle11gr2

    Friends,

    I can get including db link the package DBMS ddl but could not able to find a way to extract the ddl for all the database link and the coil in a file recreate them in the future?

    Tried searching on OTN but no luck, if someone shares how them spool or point me to a particular forum that will be great.

    Thank you

    We may also use something simple, select as below to extract the ddl

    Select dbms_metadata.get_ddl ('DB_LINK', db_link, owner) vSQL of

    dba_db_links

    /

  • Can I get the videos for all of the concepts of photoshop learning?.

    I have an account paying adobe... Can I get the videos for all of the concepts of photoshop learning?.

    All I see is that links like

    CC Photoshop tutorials | Learn how to use Photoshop CC

    Above links are available even without an account.

    Should I have any extra advantage to access additional videos (as in lynda.com where they have the series of videos that explain how to do something with explanation of the concept)

    Originally, there was a selection of 'members only' videos on the Adobe Web site. But this project was abandoned and all content has been made public.

  • find the ddl for all index

    Hello
    on the 11g on Win 2008 R2

    How to find the ddl for all index built on MY_VW?
    Thank you.

    You can use DBMS_METADATA for this:

    SELECT DBMS_METADATA.GET_DDL
           ( 'INDEX'
           , index_name
           , owner
           )
    FROM   all_indexes
    WHERE  table_name  = ''
    AND    table_owner = ''
    ;
    
  • Retrieve the DDL for temporary Table existing global

    HI: I'm on 10.2.0.3.

    Anyone know how to recover the DDL for TWG? For an ordinary table, I select dbms_metadata.get_ddl ('TABLE', '< table_name >', '< OWNER >') of double;

    Does not work for GTT! TIA.

    Can you elaborate a bit on "does not work"? Are you an Oracle error, for example? If so, what is the error?

    Seems to work for me on 10.2.0.1

    SQL> select * from v$version;
    
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    SQL> create global temporary table gtt_foo (
      2  col1 number
      3  );
    
    Table created.
    
    SQL> select object_type from user_objects
      2  where object_name = 'GTT_FOO';
    
    OBJECT_TYPE
    -------------------
    TABLE
    
    SQL> select dbms_metadata.get_ddl( 'TABLE', 'GTT_FOO' )
      2    from dual;
    
    DBMS_METADATA.GET_DDL('TABLE','GTT_FOO')
    -----------------------------------------------------------
    
      CREATE GLOBAL TEMPORARY TABLE "SCOTT"."GTT_FOO"
       (    "COL1" NUMBER
       ) ON C
    

    Justin

  • ORA-31603 when you attempt to get the ddl for tablespace

    Running Oracle 11 g 2 on Oracle's Linux

    In my schema, I created a package that includes a procedure that will retrieve the DOF for a given tablespace.  However, the line ' DBMS_METADATA. GET_DDL ('TABLESPACE', '< target tablespace >') returns an ORA-31603 complain the tablespace is not in my diagram.  Specifically, "ORA-31603: object"< tablespace >"TABLESPACE type not found in the schema «< myschema >»»

    It is confusing because I thought no tablespaces were related to patterns.  I checked my pattern has all privileges such as SELECT_ANY_DICTIONARY and run it on DBMS_METADATA.  I can run this command directly in SQL Developer without problem.  It is only when I try to run the procedure that the error appears.  The package belongs my diagram and I try to run it from a SQL Developer session open in my diagram.

    I searched an ora-31603 and "tablespaces" in the center of knowledge and found nothing.

    Jim Wolfe

    Hello

    Documentation:

    DBMS_METADATA

    Security model

    The views of the subject of the Oracle metadata model implement the security as follows:

    • Unprivileged users can see the metadata only their own items.
    • SYSand users with SELECT_CATALOG_ROLE can see all objects.
    • Unprivileged users can also retrieve public synonyms, privileges granted system their and object privileges granted to them or by them to others. It also includes the privileges granted to the PUBLIC .
    • If callers request objects they are not privileged to retrieve, no exception is raised; quite simply, the object is not found.
    • If unprivileged users are granted some form of access to an object in another schema, they will be able to recover the grant through the metadata API specification, but not the actual metadata of the object.
    • Stored in the roles of packages definers-rights, procedures and functions (such as SELECT_CATALOG_ROLE ) are disabled. Therefore, such a PL/SQL program can only to search metadata for objects in its own schema. If you want to write a PL/SQL program that extracts the metadata for the objects in another schema (based on the possession of the appellant of SELECT_CATALOG_ROLE ), you must bring the emission rights Summoners.

    Kind regards

    Juan M

  • How can I get number of columns for all tables in a schema?


    Hello

    Can someone help me with the code to retrieve any of the columns in each table of a master plan? I'm sorry if it sounds simple. I'm a newbie...

    Thank you

    Maybe:

    Select table_name

    count (*) col_count

    of user_tab_cols

    Table_name group

    order of table_name;

  • get the ddl of the object in sqlplus

    Hello.

    How to get into the sqlplus to object ddl statement?

    as:

    Select the ddl from dba_objects where object_name = 'my_table ';

    Hello

    You can use the package which is displayed in the posts above else there are alternatives to get the DDL both
    For more than one table. You can go for export and import with Options by which you can get the DDL for all
    the objects in the schema according to your requirement.

    You can go for "dbms_metadata.get_ddl".
    next thing export and import with show options = 'Y '.

    -Pavan Kumar N

  • How to get the ddl of many paintings in a statement

    Hi all

    I have a scheme. It has 150 tables. I chose dbms_metadata.get_ddl ('TABLE', 'TABLE_NAME', 'SCHEMA') of double;
    It worked for me, but I have 150 paintings. There is a lot of time to do.

    Is there a faster way to do?

    Thank you!

    Dan.

    Duplicate - already replied to How to get the ddl from several tables in a statement

  • How to get the script to a table or view in SQL Developer?

    Dear friends/expert,

    Could you tell me how to get the script from a view or a table easily in SQL Developer as pressing F4 in TOAD?

    I found that I can press SHIFT + F4 to view in SQL Developer and get the script of the view in the Details tab. But how to move the script to the SQL worksheet to change? It is very easy to do in TOAD.

    And I have not found a way to get the script for a table up to now. Is it possible to do?

    Thanks in advance.

    Best regards
    Ning

    There are people a lot better out there to answer on this point than I am - but here's how I do it.

    I'm just in the browser/browser for interest table, choose the script on the right side tab (which shows all the SQL for the table) and then cut and paste what I want or need in my editor window.

  • How can I get the script to a Table?

    Hello world

    Greetings

    We can get the script from the procedure, function, package, and trigger data dictionary see user_source.

    Is he see everything in the script for the Table? If not possible how to get the script for a Table?

    IndiMinds wrote:

    Hello world

    Greetings

    We can get the script from the procedure, function, package, and trigger data dictionary see user_source.

    Is he see everything in the script for the Table? If not possible how to get the script for a Table?

    http://docs.Oracle.com/database/121/ARPLS/d_metada.htm

    DBMS_METADATA. GET_DDL

  • I have a little problem with my HP KU0841 keyboard I used to be able to hold two keyes to get the symbol for the pound sterling but it won´t work now all the ideas that I hit to stop this work?

    Can anyone help please.  I used to be able to get the symbol for the pound Sterling by pressing ALT and 0163 at the same time, maybe you'll know

    That's how you used to make the binary code on non-electric machines punch original card.  This will make me sound old?

    It's very frustrating that nothing bought here in Spain is not consistent with the rest of Europe, it is purely for the Spanish market.  I need to use this and other symbol that don't appear on my keyboard, but it is very - very sensitive touch and I think I must have hit another function key for stopping this work but can find nothing written on the computer and the manual was not in the box. as usual.

    Please let know us if possible thank you.

    Start > all programs > Accessories > system tools > character map

    http://symbolcodes.TLT.PSU.edu/accents/Charmap.html

    You can drag the key and drop it in your report or use the code indicated in the bottom right of the application

    Key codes Alt Windows

    http://symbolcodes.TLT.PSU.edu/accents/codealt.html

  • I would like to get the list of all devices on which my creative cloud has been activated for the last six months or a year

    I would like to get the list of all devices on which my creative cloud has been activated for the last six months or a year

    I do not think that information... Adobe titles represent the only link I know following your accounts, but not where the programs are installed

    https://Accounts.adobe.com/ , then click on Plans & products above to find a list of your programs and your serial numbers

  • How to get the IP Address of the Console for all my guests

    How to get the IP Address of the Console for all my guests

    a simple...

    Get-VMHost | Select Name, @{N="ConsoleIP";E={(Get-VMHostNetwork $_).ConsoleNic | ForEach{$_.IP}}}
    
  • How can I get the lines for the date between 2 different days

    Hi all,

    How can I get the lines for the date between 2 different days.

    Sample data:
    Table name: Articles
    Title start_date end_date
    Heading1 08-22-2011 2011-09-11
    2011-08-01-2011-09-01 Title2
    Title 3 2011-08-21 08-21-2011
    title4 2011-08-28 2011-09-11

    Result will be:
    Title start_date end_date
    Heading1 08-22-2011 2011-09-11
    2011-08-01-2011-09-01 Title2
    title4 2011-08-28 2011-09-11

    This is my example query:
    SELECT * FROM items WHERE trunc (es.date_start) > = TO_DATE('2011-08-22', 'YYYY-MM-DD') AND trunc (es.date_end) < = TO_DATE ('2011-08-28', 'YYYY-MM-DD')

    but I can not get the expected results. Any help would be much appreciated.

    Thanks in advance

    not read your question properly before...

    Please try this

    Select * FROM items
    WHERE (TO_DATE ('2011-08-22', 'YYYY-MM-DD') between TRUNC (es.date_start))
    AND TRUNC (es.date_end)) OR
    (TO_DATE ('2011-08-28', 'YYYY-MM-DD') between TRUNC (es.date_start))
    AND TRUNC (es.date_end))

Maybe you are looking for

  • iOS 10 - showing is more available Apps on the lock screen?

    Hello, I have an iPhone running iOS 10 6. I can't find the setting that allows the application music show on the corner of the lock (as in iOS 8 & 9) on iOS 10 screen, when I plug headphones. Please help, I have tried it looking but I can't find anyt

  • Base system Driver Windows 7 - x 64

    Hello IM using lenovo N500 (since I know they renamed it to value line), well my problem reached when I changed the vista basic x 86 for windows 7 x 64 operating system. After that I made a new installation, windows 7 OS wise that I had the hardware

  • My acer aspire 7520 cd/dvd has stoped workng?

    My laptop ACER ASPIRE 7520 cd/dvd writer has stoped workingthe system does not reconise discs

  • Officejet Pro 8500 A910 series: 10 Windows drivers for Officejet Pro 8500

    Where can I find the drivers I need for Windows 10? (I think that 64 - bit, but maybe 32 bit, how can I know?) Since the installation of 10 windows, windows drivers 8 that makes the printer function, seem outdated or deleted? There must be an easy wa

  • Task bar icons gone

    My taskbar no longer displays the volume icon or power, and when I go into my control panel to add it allows me to check the boxes. Any ideas?