[python]
$ more db_restore_rman_catalog
##====================================================================
## File name: db_restore_rman_catalog
## Usage: db_restore_rman_catalog
## Desc:
## The script uses to restore database with level
##====================================================================
#!/bin/bash
#
# Define variable
#
if [
fi
#
# Check SID
#
if [
echo
echo
exit
fi
ORACLE_SID=${
LOG_DIR=/u
TIMESTAMP=`date +%Y%m%d%H%M` export TIMESTAMP
RMAN_LOG=${LOG_DIR}/${ORACLE_SID}_restore_${TIMESTAMP}
SSH_LOG=${LOG_DIR}/${ORACLE_SID}_restore_full_${TIMESTAMP}
RETENTION=
echo
echo
echo
$ORACLE_HOME/bin/rman target / catalog rman_user/xxx@catadb log=${RMAN_LOG} 《EOF
startup nomount;
run{execute global script global_restore;}
exit;
EOF
RV=$?
cat ${RMAN_LOG}》${SSH_LOG}
echo
echo
echo
echo
if [ $RV
echo
echo
echo
RMAN_STAT=
mail
else
echo
echo
echo
RMAN_STAT=
rm
fi
echo
exit
[python]
$ more ck_restore
##====================================================================
## File name: ck_restore
## Usage: ck_restore
## Desc:
## The script uses to check RMAN restore log for current day
## and send mail to DBA
##====================================================================
#!/bin/bash
if [
then
fi
REV_DIR=/u
dt=`date
cat /dev/null >${REV_DIR}/ck_restore
cat ${REV_DIR}/db_restore_rman
total=`cat ${REV_DIR}/ck_restore
suc=`grep SUCCEED ${REV_DIR}/ck_restore
fail=`grep FAILED ${REV_DIR}/ck_restore
echo
echo
echo
echo
mail
[python]
$ more full_resotre_by_rman
#!/bin/bash
/u
/u
/u
#Rman restore database
From:http://tw.wingwit.com/Article/program/Oracle/201311/17459.html