Home » Infrastructure » Linux » export script doesn't make gzip of dmp file (11g, 11.2.0.1, red hat linux-5)
export script doesn't make gzip of dmp file [message #592424] Thu, 08 August 2013 02:26 Go to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear All,

Below are my script to take full backup of database. Only problem is, after generation of .dmp file, gzip doesn't make it compressed.



expdp system/oracle  DIRECTORY=DP_DIR DUMPFILE=EXPDP_TAGITEST_`date +"%d%m%y_%H%M"`.dmp LOGFILE=EXPDP_TAGITEST_`date +"%d%m%y_%H%M"`.log FUL
L=Y
if [ `echo $?` -ne 0 ]; then
echo "The export failed at `date`" >> $EXPORT_LOG
else
echo
echo "The export succeeded at `date`" >> $EXPORT_LOG
find -name "*.log" -mtime +1 -exec rm {} \;
find -name "*.dmp.gz" -mtime +1 -exec rm {} \;
fi
gzip /usr/backup/dp_dir/EXPDP_TAGITEST_`date +"%d%m%y_%H%M"`.dmp

~
~



While checking the below script separatly, it compress the .dmp

gzip /usr/backup/dp_dir/EXPDP_TAGITEST_`date +"%d%m%y_%H%M"`.dmp


Kindly assist me to rectify the problem.

Regards,
Ishika
Re: export script doesn't make gzip of dmp file [message #592425 is a reply to message #592424] Thu, 08 August 2013 02:40 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Are you sure that this,
date +"%d%m%y_%H%M"
will be expanded to the same value at all times?

[Updated on: Thu, 08 August 2013 02:40]

Report message to a moderator

Re: export script doesn't make gzip of dmp file [message #592426 is a reply to message #592424] Thu, 08 August 2013 02:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Why "`echo $?`" ans not just "$?"?

Regards
Michel
Re: export script doesn't make gzip of dmp file [message #592748 is a reply to message #592426] Mon, 12 August 2013 01:35 Go to previous message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear All,

I used the below script to get export of database and it's worked.

#--------------------------------------------#
export PATH=/home/oracle/mono-1.9.1/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/opt/oracle/10.2.0/bin
export ORACLE_SID=testmydb
export ORACLE_HOME=/opt/oracle/10.2.0
export DMP_DEST=/bkup/dp_dir
export DMP_RETENTION=7
expdp system/oracle directory=DP_DIR dumpfile=expdp_`date +%d%m%y_%H_%M`_$ORACLE_SID.dmp LOGFILE=expdp_`date +%d%m%y_%H_%M`_$ORACLE_SID.log full=y exclude=statistics
###############gzip####################
gzip $DMP_DEST/*.dmp
##########################################deleted#######################################
echo "Cleaning up 1 week old backupfiles/logfiles ..." 
find $DMP_DEST -name '*.gz' -mtime +$DMP_RETENTION -exec ls -l {} \;
find $DMP_DEST -name '*.gz' -mtime +$DMP_RETENTION -exec rm -r {} \;
echo "cleaning completed.."


Regards,
Ishika
Previous Topic: Am Unable To Execute the runInstaller Script To Install Oracle Grid Infrastructure
Next Topic: Batch file is not getting executed
Goto Forum:
  


Current Time: Thu Mar 28 14:42:10 CDT 2024