• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

exact ddl

Could you please tell me the exact ddl for a particular schema in a database....
0
tonydba
Asked:
tonydba
2 Solutions
 
slightwv (䄆 Netminder) Commented:
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
 
Wasim Akram ShaikCommented:
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
 
DavidSenior Oracle Database AdministratorCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Wasim Akram ShaikCommented:
Won't completely agree with dvz ..
Coz you won't get constraints info this way :)
0
 
slightwv (䄆 Netminder) Commented:
>>Hi, this works for me:

I don't think this will get the grants which is part of the asker's previous question.
0
 
Steve WalesSenior Database AdministratorCommented:
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now