#!/usr/bin/sh # # This script is for Oracle Export Entire database mode on UNIX. # Written: Colin Wang # Date: June 1, 1999 # # # Set up variables for Oracle # ORACLE_HOME=/home/oracle ORA_NLS33=/users/oracle8/app/oracle/product/8.0.5/ocommon/nls/admin/data ORACLE_SID=ora8 NLS_LANG=American_America.WE8ISO8859P1 PATH=/usr/sbin:/bin:/usr/bin:$ORACLE_HOME/bin:. BCK_DIR=~/backup export ORACLE_HOME ORACLE_SID PATH BCK_DIR # cd $BCK_DIR # echo "APDM full backup starting - `date` " >>backup.log # # For Export command. # DATE=`date +%m%d` DT=`date` exp system/manager FULL=Y FILE=full_$DATE.dmp BUFFER=10240000 LOG=full_$DATE.log res=$? if [ $res -ne 0 ] then echo "some error occurred in the process of full Export ('$res') - " $DT >>backup.log echo "----------------------------------------------" >> backup.log echo "Export (full) Error - ('$res')" $DT | mailx -s "Export Error" admin@xxxyyy.com exit 2 fi # # Save as them to Tape # # Note: if you have tape storage, you can use storage manager for this; # or refer to the Perl script written by me to do this. Thanks. # tar cvf /dev/rmt/0n $BCK_DIR res=$? if [ $res -ne 0 ] then echo "some error occurred in the process of TAR '$res') - " $DT >>backup.log echo "TAR Error - ('$res')" $DT | mailx -s "TAR Error" admin@xxxyyy.com exit 2 fi # res=$? # echo "Full Backup finished - $DT" >>backup.log # echo "---------------------------------------" >>backup.log #