299 views
in Scripts by ACE (20,920 points)

1 Answer

by ACE (20,920 points)

#!/bin/bash -x
#
#
# UNIRAC.IN
#
# 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

Categories

...