Oracle Maintaince Script
All the times ,I think that I may be write an Oracle Maintaince Script with all functions.I think times and again.As a result,only a few functions that I can write.The script is displayed as fllowings;
#!/bin/bash
menu(){
echo " Oracle Database Menu"
echo " 1, Start oracle database"
echo " 2, Stop oracle database"
echo " 3, Start Oracle Enterpris Manager"
echo " 4, Quit"
}
if [ $# -gt 0 ]
then
echo "Execute scritpt with no parameters"
exit;
fi
while true
do
menu
echo -n "Enter Your Choice:"
read e
case $e in
1)
echo "start"
su oracle -c '/u01/oracle/product/11.2/bin/dbstart /u01/oracle/product/11.2'
clear
;;
2)
echo "stop"
su oracle -c '/u01/oracle/product/11.2/bin/dbshut /u01/oracle/product/11.2'
clear
;;
3)
su oracle -c '/u01/oracle/product/11.2/bin/emctl start dbconsole'
clear
;;
4)
echo -n "Continue quit(y/n):"
read c
case $c in
n|N|no)
continue
;;
y|Y|yes)
break
;;
*)
break
;;
esac
;;
esac
done
This scripts suits employee who don't know how to start/stop oracle database. You can add function entry as you need.
NOTE:AT FIRST CHANGE /etc/oratab
阅读(1763) | 评论(0) | 转发(0) |