Solved

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

Posted on 2014-11-03
4
309 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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!
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

708 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