Solved

exact ddl

Posted on 2014-04-15
7
298 Views
Last Modified: 2014-06-10
Could you please tell me the exact ddl for a particular schema in a database....
0
Comment
Question by:tonydba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 250 total points
ID: 40002218
Take a look at SCHEMA_EXPORT of DBMS_METADATA:
http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_metada.htm

It isn't as simple as the get_ddl functions.  It will require a little more code and effort.

There are script examples for it out there if you look around.

The first one I came across:
http://www.remote-dba.net/t_advanced_extract_schema.htm
0
 
LVL 16

Assisted Solution

by:Wasim Akram Shaik
Wasim Akram Shaik earned 250 total points
ID: 40002289
Another option would be to do a expdp of the schema you want

later do a impdp only with sqlfile to get the total ddl of the schema with option content=metadata_only

refer to this question in stack over flow where in the scenario has been described in other way around by taking the export with metadata option and doing an import with sql file(import/export --data pump)

http://serverfault.com/questions/382691/create-a-definition-file-from-oracle
0
 
LVL 23

Expert Comment

by:David
ID: 40002637
Hi, this works for me:

set long 90000
set feedback off
set echo off
set heading on
set lines 100
set arraysize 100
UNDEFINE SCHEMA
SPOOL /tmp/delete.me

select
   dbms_metadata.GET_DDL(u.object_type,u.object_name,'&&SCHEMA') ||';'
from
   dba_objects u
where
   owner = '&&SCHEMA'
/  
SPOOL OFF
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 16

Expert Comment

by:Wasim Akram Shaik
ID: 40002691
Won't completely agree with dvz ..
Coz you won't get constraints info this way :)
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40002704
>>Hi, this works for me:

I don't think this will get the grants which is part of the asker's previous question.
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 40124056
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question