Solved

Overwrite .dmp file

Posted on 2006-07-06
7
3,293 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now