oracle rac 关机及开机 脚本 conan为数据库实例 dbrac1、dbrac2为数据库服务器hostname
##########oracle 节点1关机脚本 echo "#!/bin/bash ##########shutdown oracle rac su grid -c “srvctl stop database -d conan” source /home/grid/.bash_profile crsctl stop has -f &> /dev/null crsctl stop cluser -all &> /dev/null crs_stat -t -v ssh dbrac2 -c ‘sh /home/shutdown_rac2.sh’ shutdown -h 0 " >> /home/shutdown_rac1.shsh /home/shutdown_rac1.sh
##########oracle 节点2关机脚本 echo "#!/bin/bash ##########shutdown oracle rac #su grid -c “srvctl stop database -d conan” source /home/grid/.bash_profile crsctl stop has -f #crsctl stop cluser -all &> /dev/null crs_stat -t -v shutdown -h 0 " >> /home/shutdown_rac2.sh
##########oracle 节点1开机脚本 echo "#!/bin/bash ##########startup oracle rac dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 su - grid -c “crsctl start cluster -n dbrac1 dbrac2” su - oracle -c “lsnrctl start” su - grid -c “crs_stat -t -v” su grid -c "srvctl start database -d conan ssh dbrac2 ‘sh /home/start_rac2.sh’ " >> /home/start_rac1.sh
sh /home/start_rac1.sh
##########oracle 节点1开机脚本 echo "#!/bin/bash ##########startup oracle rac dd if==/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 #crsctl start cluster -n dbrac1 dbrac2 su - oracle -c “lsnrctl start” crs_stat -t -v #su grid -c “srvctl start database -d conan” >> /home/start_rac2.sh