EXPDP automation in shell scripts
This script is created for SUN Solaris (no change requried) and RHEL (a small change will be required).
it will do
1. create dump file of full db only metadata.
2. create dump of some particular tables.
3. tar and zip that file
4. ftp the files in some other safe places
5. finally delete old dump files from both servers.
ORACLE_BASE=/oracle/orabase; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=SHAONDB; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
CURR_MONTH=`date +"%b_%Y"|tr "[:lower:]" "[:upper:]"`
CURR_DATE=`date +"%d_%b_%Y"|tr "[:lower:]" "[:upper:]"`
## 7days means 168 hour ###
DAYAGO=`TZ=GMT+168 date +"%d_%b_%Y"|tr "[:lower:]" "[:upper:]"`
## in rhel it will be DAYAGO=`date -d '7 day ago' +"%d_%b_%Y"|tr "[:lower:]" "[:upper:]"` ##
BASE_DIR="/backup/DUMP_ORACLE/DUMP_...