RE: How keep only one copy .dmp?

  • From: "William Wagman" <wjwagman@xxxxxxxxxxx>
  • To: <cemail_219@xxxxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 17 Jul 2007 08:39:50 -0700

Greetings,

I suspect, although it is only a suspicion, that the time stamp on the file 
must be > 24:00:00 hours prior to the time you run the find. For example, you 
run the find at 22:00 then start your export. The export finishes at 22:30. 
Then the next day you run your find at 22:00. The previous days dump file has a 
time stamp of 22:30, not yet 24 hours old so it isn't deleted then you get 
today's dump file thus 2 files. I think. 


Bill Wagman
Univ. of California at Davis
IET Campus Data Center
wjwagman@xxxxxxxxxxx
(530) 754-6208
-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of J. Dex
Sent: Tuesday, July 17, 2007 7:51 AM
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 
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

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


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


Other related posts: