Solved

Overwrite .dmp file

Posted on 2006-07-06
7
3,317 Views
Last Modified: 2008-02-07
Trying to set up expdp job to back up schema daily overwriting each time.
I get Oracle error messages:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/export/home/oracle/backups/datapump/paebprd_expfull.dmp"
ORA-27038: created file already exists
Additional information: 1

Is there any way to simply overwrite the file if it exists?
0
Comment
Question by:xoxomos
[X]
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
  • 3
  • 3
7 Comments
 
LVL 14

Accepted Solution

by:
sathyagiri earned 250 total points
ID: 17053964
If you're using expdp then I guess the only way is to make sure the file doesn't exist. In case of exp this issue wouldn't be there
0
 
LVL 19

Expert Comment

by:actonwang
ID: 17053968
unfoturnately , you can not overwrite  it automatically:

see:


////////////////////////////////
Restrictions

If there are preexisting files that match the resulting filenames, an error is generated. The existing dump files will not be overwritten.


from:
http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10825/dp_export.htm#sthref55
0
 
LVL 19

Expert Comment

by:actonwang
ID: 17053972
you need to remove or move the file if it exisits before you do data pump export.

acton
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 14

Expert Comment

by:sathyagiri
ID: 17053995
Are you using a shell script or batch file to do this expdp?
0
 
LVL 19

Expert Comment

by:actonwang
ID: 17054012
you could use sth like this to do it before you do expdp:


f [ -f filename ];then
rm -fr filename
else
expdp
fi
0
 
LVL 14

Expert Comment

by:sathyagiri
ID: 17054026
If so, just add logic to either remove or rename the file

In case of shell script

if [ -f filename ]; then
mv filename1 filename2
fi
0
 

Author Comment

by:xoxomos
ID: 17054046
export ORACLE_SID=paebprd
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1


$ORACLE_HOME/bin/expdp system/xoxomos directory=datadir1 dumpfile=paebprd_expfull_$dt.dmp logfile=paebprd_e
xpfull full=y
~
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

688 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