Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

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

Read about achieving the basic levels of HRIS security in the workplace.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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…

829 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