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

Oracle Schema dump from batch file

Posted on 2013-12-02
4
1,044 Views
Last Modified: 2013-12-03
Is there any way to export the schema script with and without data from a batch file.
The reason I want the batch file is so that I can schedule it.
0
Comment
Question by:GNOVAK
  • 2
4 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39689818
You should be able to do a datapump export for the schema with and without data.

The online docs have the syntax and all the options.
0
 

Author Comment

by:GNOVAK
ID: 39690287
What's the best way to do this in a batch file if I'm using tnsnames....?
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39690292
expdp and impdp are command line programs.
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 39692280
if you do it with data, you can later extract the metadata without the data

here is the reference to the expdp
http://docs.oracle.com/cd/E11882_01/server.112/e22490/dp_export.htm#SUTIL200

export script for windows (you didn't state what os)
commandline expdp from the host
set oracle_sid=TheOracleSid
expdp TheSchema/passw schema=TheSchema dumpfile=TheDumpfile.dmp content=all

Open in new window


if you want to extract the script to script.sql

set oracle_sid=TheOracleSid
impdp TheSchema/passw schema=TheSchema dumpfile=TheDumpfile.dmp sqlfile=script.sql

Open in new window


the files will be stored in path data_pump_dir
> select data_path from dba_directories where name = 'DATA_PUMP_DIR';
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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…
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…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

838 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