Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle-l »

RE: How keep only one copy .dmp?

Sweetser, Joe

2007-07-17

Replies:

If I remember correctly (no time to test right now - sorry), data pump
will NOT overwrite an existing file. There may be a way to force it but
I believe that is the "new" default behavior. Good 'ol, plain vanilla
export happily overwrites existing files. I understand the original
poster is using export but just thought I'd through this out there in
case anyone is migrating existing backup export strategies to data pump.

-joe

-----Original Message-----
From: oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)
Mayen.Shah@(protected)
Sent: Tuesday, July 17, 2007 10:21 AM
To: john.hallas@(protected)
Cc: cemail_219@(protected);
oracle-l-bounce@(protected)
Subject: RE: How keep only one copy .dmp?


If you keep dump and log file same name every day (do not include
date/time as part of your files), it will overwrite previous dump and
log files and you will have only one copy. In this case you do not need
to delete any file at os level.
If you need to retrieve old dump file from tape backup etc, file will
have os time stamp.



HTH
Mayen Shah









  "Hallas, John
To
  (EXP N-ARM)"         cemail_219@(protected),
oracle-l@(protected)  
  <john.hallas@(protected)
cc
  .com>

  Sent by:
Subject
  oracle-l-bounce@(protected)?

  reelists.org





  Jul 17 2007 11:29

  AM





  Please respond to

  john.hallas@(protected).

      com








Remove the -mtime option and delete the file if it exists

The downside is that if the export fails you have no previous version

The other option would be to do a ls for compressed dumpfiles and rename
them and then delete those after the export has worked

-----Original Message-----
From: oracle-l-bounce@(protected)
[mailto:oracle-l-bounce@(protected)
Sent: 17 July 2007 15:51
To: oracle-l@(protected)
Subject: How keep only one copy .dmp?

How can I set my script to only keep one copy of a dump file?  On
Linux, I
have the following line in the script (which is run nightly by cron).
Yet
I always seem to end up with 2 days worth of dmp files which are using
up too much space. I only want for there to be one copy that stays on
the server.

find $DMPDIR -name "*" -mtime +0 -exec rm {} \;



Rest of script that follows that line:

DT=`date +%Y%m%d%H%M`

gzip < $EXPPIPE > $DMPDIR/${ORACLE_SID}_full.dmp.${DT}.gz &

$ORACLE_HOME/bin/exp system/$exppass full=y file=$EXPPIPE
log=$DMPDIR/${ORACLE_SID}_full_1db_exp_${DT}.log consistent=y compress=y

#Check log for errors below
cd $DMPDIR
grep -c "EXP-" ${ORACLE_SID}_full_1db_exp_${DT}.log > /dev/null if [ $?
= 0 ] then
echo "failed export" | mail -s "export of $ORACLE_SID FAILED CHECK LOG
FOR DETAILS" `cat $MAIL/dba`

exit 1
fi
exit

_________________________________________________________________
Don't get caught with egg on your face. Play Chicktionary!
http://club.live.com/chicktionary.aspx?icid=chick_hotmailtextlink2

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l





--
http://www.freelists.org/webpage/oracle-l




Confidentiality Note: This message contains information that may be confidential and/or privileged. If you are not the intended recipient, you should not use, copy, disclose, distribute or take any action based on this message. If you have received this message in error, please advise the sender immediately by reply email and delete this message. Although ICAT Managers, LLC scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. Thank you.

--
http://www.freelists.org/webpage/oracle-l


©2008 dba.5341.com - Jax Systems, LLC, U.S.A.