Today's Birthday
Quote of the Day
This Day in History

Monday, March 8, 2010

sample rman_unregister_db.ksh file

#!/bin/ksh
##
## Script Name: rman_unregister_db.ksh
## Author : Ramakrishna Nemani
##
## Unregister a given database with rman catalog
##
##

. ~/.profile
. ./rmanids.sh

##
## Make sure ORACLE_SID is passed as an argument
##

if (( $# < 1 ))
then
echo
echo Error Missing Arguement, Please supply Oracle Sid
echo
echo Usage: $0 ORACLE_SID
echo
exit
fi

export ORACLE_SID=$1
rman << EOF
connect target ${rmanid}/${rmanpw} ;
connect catalog ${catlid}/${catlpw}@${ORACLE_CATL} ;
unregister database noprompt ;
EOF

export rman_rtnval=$?
echo $rman_rtnval
if [[ $rman_rtnval = 0 ]]
then
echo $ORACLE_SID successfully registered with rman catalog
else
echo $ORACLE_SID could not be registered with rman catalog
fi

## -------------------------------------------------------------------------------
## End of  rman_unregister_db.ksh
## -------------------------------------------------------------------------------

No comments:

Post a Comment