Tuesday, December 23, 2008

Oracle XE Backup with Email of Log

To receive a inline copy of your back up log, add the line in bold below to your backup.sh.

Also comment out the two lines in italic.

This assumes you are running in achieve log mode - which, of course, you are :)


#Display the result to user
if [ $failed = 'true' ] ; then
echo '==================== ERROR ========================='
echo ' Backup of the database failed '
echo '==================== ERROR ========================='
echo ${errstr}.
echo Log file is at $rman_backup_current.
else
echo Backup of the database succeeded.
echo Log file is at $rman_backup_current.
mail -s 'Oracle Backup Completed' you@yourdomain.com < /usr/lib/oracle/xe/oxe_backup_current.log

fi

#Wait for user to press any key
#echo -n "Press ENTER key to exit"
#read userinp

No comments: