Solved

exact ddl

Posted on 2014-04-15
7
294 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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Encryption Decryption in Oracle 12 108
sql query 5 70
Wrap Oraccle SQL*Plus executable Command 4 70
Get the parent node - XMLTYPE 9 56
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…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

863 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

23 Experts available now in Live!

Get 1:1 Help Now