Export script – beginners
Here is a very simple script to save an Oracle database with a full export script.
It’s a very basic example, because there is no log and no option (only a full export)
Ina few days i’ll post a more detailled export script.
#!/bin/bash
#—————————#
# Oracle Full export script #
# Nuxora v1.0 #
#—————————#
# set env
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
export ORACLE_SID=$1
when=`date +”%d%m”`
# export
exp expimp/$2 file=”$ORACLE_BACKUP”/admin/exp/full/$ORACLE_SID/exp”$when”_”$ORACLE_SID”_”FULL”.dmp FULL=Y ROWS=Y
# keep only 7 days
for file in `find “$ORACLE_BACKUP/admin/exp/full/$ORACLE_SID” -name “exp*.dmp” -mtime +7 -print`
do
echo $file
rm $file
done
Sendmail: quick start The Deployment scanner – jboss