Solved

How to get a complete schema dump of an Oracle database?

Posted on 2014-11-03
4
313 Views
Last Modified: 2014-11-14
Hello,

I'm trying to export the schemas (Tables, Procedures, Packages, etc.) I have access to, into a .sql file.

I'm not the root user/or the person who owns the schemas, but I'd like to copy all the schemas I have access to; so that I can recreate the database in another location.

Is there a simple way to do this? Or do I need to go log in as each schema's ID and export the objects under that ID?

Appreciate any help on this!
0
Comment
Question by:Errang Genevre
4 Comments
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 100 total points
ID: 40420722
Unless you have elevated privs I don't think you can.

There are some cool scripts out there that use dbms_metadata.get_ddl to grab all the DDL but you need the select_catalog_role role to be able to grab the DDL from a different schema.  Then you just go against all_objects to get all the DDL.  Examples are out there.

If you were granted the export privs, you could export using the indexfile or sqlfile (classic exp or datapump export).
0
 
LVL 16

Accepted Solution

by:
Wasim Akram Shaik earned 400 total points
ID: 40420923
In that case, if you don't have privileges,
this kind of approach should work..

select * from all_source where owner='USR1';

you should be able to view the source code, though in a table form.. substitute object names to get the object source code, this should bring you the basic ddl, however to get other things ddl like constraints, etc., you have to get it via all_dependencies or by via user_tab_cons
0
 

Author Closing Comment

by:Errang Genevre
ID: 40444036
Thanks!
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.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

777 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