#!/bin/sh
# Name : Oracle Export Backup
# Writer : Mahendra Rajgude
# Date : 23 Oct 2007
# Version : 0.1
# Pupose : This script is written to take oracle export backup
# Exporting environmental variable. This will specific to server.
HOSTNAME=`hostname`
ORACLE_SID=ngs
ORAWEB_ADMIN=/u01/app/oracle/admin
ORAWEB_BASE=/u01/app/oracle
ORAWEB_HOME=/u01/app/oracle/products/9.2.0
ORACLE_BASE=/u01/app/oracle
ORACLE_TERM=vt100
ORACLE_HOME=/u01/app/oracle/products/9.2.0
ORACLE_PATH=/u01/app/oracle/products/9.2.0/rdbms/admin:/u01/app/oracle/products/9.2.0/sqlplus/admin:/u01/app/oracle/common/sql
BACKUP_DIR=/oraclebackup
export ORACLE_SID ORAWEB_ADMIN ORAWEB_BASE ORAWEB_HOME ORACLE_BASE ORACLE_TERM ORACLE_HOME ORACLE_PATH BACKUP_DIR HOSTNAME
# Export DATE format to add extention to backup file.
DATE=`date '+%d'`
#echo Logfile{$DATE}
# Remove any previous backup file
rm ${BACKUP_DIR}/${HOSTNAME}_full.dmp.${DATE}.gz
# Actual backup starts here
${ORACLE_HOME}/bin/exp system/manager full=y file=${BACKUP_DIR}/${HOSTNAME}_full.dmp.${DATE} statistics=none log=${BACKUP_DIR}/${HOSTNAME}_full.log.${DATE} buffer=2048000 compress=y consistent=y
# Compression done here to reduce the size of backup
/usr/bin/gzip ${BACKUP_DIR}/${HOSTNAME}_full.dmp.${DATE}
# Removing uncompressed file..
rm ${BACKUP_DIR}/${HOSTNAME}_full.dmp.${DATE}
#####################################################################################################
#####################################################################################################
# Change History
# V 1.0 Dated 23 Oct 2007 checked working fine.
Friday, April 24, 2009
Subscribe to:
Posts (Atom)