RE: How keep only one copy .dmp?

  • From: Mayen.Shah@xxxxxxxxxx
  • To: john.hallas@xxxxxxxx
  • Date: Tue, 17 Jul 2007 12:20:32 -0400

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.

Mayen Shah

    "Hallas, John                                                            To 
    (EXP N-ARM)"              cemail_219@xxxxxxxxxxx, oracle-l@xxxxxxxxxxxxx    
    <john.hallas@lmco                                                        cc 
    Sent by:                                                            Subject 
    oracle-l-bounce@f         RE: How keep only one copy .dmp?                                                                             
    Jul 17 2007 11:29                                                           
    Please respond to                                                           

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@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On
Behalf Of J. Dex
Sent: 17 July 2007 15:51
To: oracle-l@xxxxxxxxxxxxx
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

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
grep -c "EXP-" ${ORACLE_SID}_full_1db_exp_${DT}.log > /dev/null
if [ $? = 0 ]
  echo "failed export" | mail -s "export of $ORACLE_SID FAILED CHECK LOG FOR
DETAILS" `cat $MAIL/dba`

exit 1

Don't get caught with egg on your face. Play Chicktionary!




Other related posts: