OraMatt: YABAOracle

Yet Another Blog About Oracle

Script to stop all RAC clones on a cluster…ENJOY!!!


#!/bin/bash -x
#
#
# Matt D 6/15/2011
#
# Stop all RAC databases in your cluster
#
#
#
clear
echo "----------------------------------------"
echo "This script will stop all RAC databases across the cluster."
echo "Would you like to continue? "
echo "Enter yes or no"
read DOWHAT
if [[ $DOWHAT = no ]]; then
exit 1
fi
echo "----------------------------------------"

for i in `ps -ef | grep pmon | cut -d _ -f3`
do srvctl stop database -d ${i//1}
done

clear
sleep 5
echo "Current running RAC databases"
ps -ef | grep pmon | cut -d _ -f3
#
# for i in `ps -ef | grep pmon | cut -d _ -f3`
# do srvctl status database -d ${i//1}
# srvctl status instance -d ${i//1} -i $i
# done

exit 0


Leave a comment

Navigation

About

I’m Matt and I do Oracle things.