Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Location
    Green Bay
    Posts
    201

    Unanswered: Get ALL DDL of table create

    I need to get the SQL that creates all tables in one schema and it's indexs, contrants, and triggers into a SQL file so that I can export structure to a different instance and a different schema.

    I have access to PL/SQL developer, and TOAD

    Is there a scripting package similar to EM in SQL Server.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    The simplest way is to export the schema and then import into the new schema/instance with data=NO
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Have a look at the dbms_metadata.get_ddl() function

    http://download-east.oracle.com/docs...d2.htm#1024701

    You can easily create SQL statement that will create SQL script to generate the DDL for the whole schema.

  4. #4
    Join Date
    Dec 2003
    Posts
    1,074
    Right, exp/imp, or expdp/impdp if you have a later version of Oracle.

    If you actually want the scripts, though, you can use the same. For export/import look into the "SHOW" option - for datapump export/import look into the "SQLFILE" option. Both will use the command line utility to create the scripts normally executed during the import process.

    -cf

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    do what Chuckie told ya
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  6. #6
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by rbackmann
    ...Is there a scripting package similar to EM in SQL Server.

    If the source DB is WinDoze SQL Server, you may want to post or move this question to the M$ SQL Server Forum.

    Otherwise use SQL Developer or TOAD or DDL Wizard to reverse-engineer your schema.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •