xoxomos
asked on
Overwrite .dmp file
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/backu ps/datapum p/paebprd_ expfull.dm p"
ORA-27038: created file already exists
Additional information: 1
Is there any way to simply overwrite the file if it exists?
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/backu
ORA-27038: created file already exists
Additional information: 1
Is there any way to simply overwrite the file if it exists?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you need to remove or move the file if it exisits before you do data pump export.
acton
acton
Are you using a shell script or batch file to do this expdp?
you could use sth like this to do it before you do expdp:
f [ -f filename ];then
rm -fr filename
else
expdp
fi
f [ -f filename ];then
rm -fr filename
else
expdp
fi
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
In case of shell script
if [ -f filename ]; then
mv filename1 filename2
fi
ASKER
export ORACLE_SID=paebprd
export ORACLE_HOME=/u01/app/oracl e/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
~
export ORACLE_HOME=/u01/app/oracl
$ORACLE_HOME/bin/expdp system/xoxomos directory=datadir1 dumpfile=paebprd_expfull_$
xpfull full=y
~
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