#!/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
## -------------------------------------------------------------------------------
Monday, March 8, 2010
Subscribe to:
Post Comments (Atom)




No comments:
Post a Comment