Solved

exact ddl

Posted on 2014-04-15
7
293 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
7 Comments
 
LVL 76

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
oracle global variables 4 52
UNIX SCP 5 47
Oracle Database Upgrade 13 42
compre toata in where clue oracle 4 44
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

759 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now