Datapump Export Script
#!/bin/ksh -x
#
# Title:     datapump_backup.ksh
# Purpose:   Used to take full datapump exports
# Called by: n/a
#
# Notes:     None
#
# Author:    Mark ramsay
# Date:      05 April 2012
#
# Notes:     Requires an oracle directory to be present called data_pump_dir which points to 
#            /u01/app/oracle/admin/${ORACLE_SID}/dpdump
#            Parameter \$1 should be set to the Oracle SID
#            *BE CAREFUL* - The script will remove an dump files from the data_pump_dir
#                           that match the find command.
#

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin

SDS_date=`date +%d%b%Y`
export ORACLE_SID=$1
export ORAENV_ASK=NO

. oraenv

expdp \"/ as sysdba\" DUMPFILE=${ORACLE_SID}_full_backup_${SDS_date}.dmp DIRECTORY=data_pump_dir Full=y

cd /u01/app/oracle/admin/${ORACLE_SID}/dpdump

find . -name "${ORACLE_SID}_full_backup_*.dmp" -mtime +14 -follow -exec rm {} \;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License