Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1232
  • Last Modified:

Oracle Schema dump from batch file

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
GNOVAK
Asked:
GNOVAK
  • 2
1 Solution
 
slightwv (䄆 Netminder) Commented:
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
 
GNOVAKAuthor Commented:
What's the best way to do this in a batch file if I'm using tnsnames....?
0
 
slightwv (䄆 Netminder) Commented:
expdp and impdp are command line programs.
0
 
Geert GOracle dbaCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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