Export Backup Script - Errors [message #204733] |
Tue, 21 November 2006 22:40 |
prashanth_gs
Messages: 67 Registered: November 2005 Location: chennai
|
Member |
|
|
Hello all,
I am enabling Daily Backup strategy using export scripts for the newly created database.
My Script works fine. But I am receiving some error message after the export gets over. I just pasting my Export script and results while executing the script below. More, I mentioned my mail id to receive once it is completed. But m not getting the same. How to resolve this and avoid this error.
MY EXPORT SCRIPT:
#########################SCRIPT FOR DAILY EXPORT PLACED IN /gdbuat4/oradata/bkup/scripts##############################3
!/bin/bash
set -x
export DD=`date +%m%d%H%M`
export DMP_DIR=/gdbuat4/oradata/bkup/expdump
export EXP_DMP_DIR=/gdbuat4/oradata/bkup/expdump
export EXP_LOG_DIR=/gdbuat4/oradata/bkup/explogs
export SUCCESSFULL="Export terminated successfully without warnings."
export SDATE=`date "+%Y%m%d%H%M"`
exp / file=$EXP_DMP_DIR/full_${ORACLE_SID}_export_${DD}_1.dmp,$EXP_DMP_DIR/full_${ORACLE_SID}_export_${DD}_2.dmp full=y log=$EXP_LOG_DIR/full_${ORACLE_SID}_export_${DD}.log statistics=none filesize=1048560000 direct=y recordlength=65535
gzip -1 $DMP_DIR/*.dmp
# DATE format for Mailing
export VDATE=`date +%c`
if [[ `cat $EXP_LOG_DIR/full_${ORACLE_SID}_export_${DD}.log |grep -e "Export terminated successfully without warnings."` == $SUCCESSFULL ]]
then
echo " Removing Export dump and log files older than 2 days"
find $EXP_DMP_DIR -mtime +2 -type f -exec rm -f {} \;
find $EXP_LOG_DIR -mtime +2 -type f -exec rm -f {} \;
cat $EXP_LOG_DIR/full_${ORACLE_SID}_export_${DD}.log|mail -s "$SUCCESSFULL - $ORACLE_SID - $VDATE" prashant.j@tcs.com
else
echo "No export dumps and logs deleted due to error"
cat $EXP_LOG_DIR/full_${ORACLE_SID}_export_${DD}.log|mail -s "Export terminated with Errors - $ORACLE_SID - $VDATE" prashant.j@tcs.com
fi
---------------------------------COMPRESS---------------------------------------------------------
#!/bin/bash
set -x
export ORACLE_HOME=/oracle10g/app/oracle/product/10r22
export PATH=$ORACLE_HOME/bin:/usr/bin:/usr/local/bin:/bin
export DMP_DIR=/gdbuat4/oradata/bkup/expdump
gzip -1 `find $DMP_DIR -name "*.dmp" -size 1048560000c`
#gzip -1 `find $DMP_DIR -name "*.dmp" -size 1048576000c`
#gzip -1 `find $DMP_DIR -name "*.dmp" -size 76c`
~
OUTPUT WHILE EXECUTING THE SCRIPT:
. exporting statistics
Export terminated successfully without warnings.
+ gzip -1 /gdbuat4/oradata/bkup/expdump/full_gdbuat_export_11220439_1.dmp
+ date +%c
+ export VDATE=Wed Nov 22 04:40:06 2006
+ grep -e Export terminated successfully without warnings.
+ cat /gdbuat4/oradata/bkup/explogs/full_gdbuat_export_11220439.log
grep: illegal option -- e
Usage: grep -hblcnsviw pattern file . . .
+ [[ == Export terminated successfully without warnings. ]]
+ echo No export dumps and logs deleted due to error
No export dumps and logs deleted due to error
+ mail -s Export terminated with Errors - gdbuat - Wed Nov 22 04:40:06 2006 velappan.ganesan1@ge.com
+ cat /gdbuat4/oradata/bkup/explogs/full_gdbuat_export_11220439.log
+ ---------------------------------COMPRESS---------------------------------------------------------
./daily_export2.sh[32]: ---------------------------------COMPRESS---------------------------------------------------------: not found
+ set -x
+ export ORACLE_HOME=/oracle10g/app/oracle/product/10r22
+ export PATH=/oracle10g/app/oracle/product/10r22/bin:/usr/bin:/usr/local/bin:/bin
+ export DMP_DIR=/gdbuat4/oradata/bkup/expdump
+ find /gdbuat4/oradata/bkup/expdump -name *.dmp -size 1048560000c
+ gzip -1
gzip: compressed data not written to a terminal. Use -f to force compression.
For help, type: gzip -h
+ /export/home/oracle10
./daily_export2.sh[42]: /export/home/oracle10: cannot execute
Please suggest how to avoid this error and to get a mail once the export is completed.
DB: Oracle 10.2.0.1.1
OS: Sun solaris 5.8
Thanks and Regards,
Prashant
|
|
|
Re: Export Backup Script - Errors [message #204832 is a reply to message #204733] |
Wed, 22 November 2006 05:20 |
|
ebrian
Messages: 2794 Registered: April 2006
|
Senior Member |
|
|
First thing I can see is the invalid parameter '-e' being passed to grep. Are you using the /usr/xpg4/bin/grep version ?
For your gzip command, did you intend to use an 'l' (lower-case L) instead of a '1' (number one) ?
|
|
|