Script To Export 11i Database

# expprod.sh
#
# Exports the Oracle E-Business Suite HRMS Production database
# which will then be copied over to the backup server
#
# source the environment
. /u0/oracle/proddb/9.2.0/PROD_ebusiness.env
# stop, then restart the production instance
# to overcome 'snapshot too old' error
# (commented out, as users on the system at 6:00 P.M. will be kicked off)
# cd /u0/oracle/proddb/9.2.0/appsutil/scripts/PROD_ebusiness/
# ./addbctl.sh stop immediate
# ./addbctl.sh start
# get name of log file and dump file
export LOGFILE=expprod_`date +%F_%k-%M-%S`.log
export DUMPFILE=expprod.dmp
export BACKUPDIR=/mnt/prodbkup
export EXPORTDIR=/u0/prodbkup
export ZIPFILE=expprod.tar.gz
export ZIPFILE2=expprod_`date +%F_%k-%M-%S`.tar.gz
# remove existing dump file
rm $EXPORTDIR/$DUMPFILE
rm $EXPORTDIR/$ZIPFILE
# export the ONT schema (for testing purposes)
# exp system/manager file=$EXPORTDIR/$DUMPFILE log=$EXPORTDIR/$LOGFILE owner=ONT
# export the database
exp system/manager file=$EXPORTDIR/$DUMPFILE log=$EXPORTDIR/$LOGFILE full=y consistent=y
# tar and gzip export file
tar -czvf $EXPORTDIR/$ZIPFILE $EXPORTDIR/$DUMPFILE
# remove the previous export dump from the test server, then copy the new one
# rm $BACKUPDIR/$DUMPFILE
# rm $BACKUPDIR/$ZIPFILE (Commented out by VS 10-Sep-09)
# copy the zip file and log file to the backup directory (remote NFS directory on ebusinesstest)
cp $EXPORTDIR/$ZIPFILE $BACKUPDIR/
cp $EXPORTDIR/$LOGFILE $BACKUPDIR/
# rename the zip file in the remote directory to reflect today's date
mv $BACKUPDIR/$ZIPFILE $BACKUPDIR/$ZIPFILE2
# rename the zip file in the local directory to reflect today's date (as an archive copy)
mv $EXPORTDIR/$ZIPFILE $EXPORTDIR/$ZIPFILE2

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.