#!/bin/sh
case "$1" in
start)
# start tsnlisnter
echo "start tsnlisnter"
su - oracle -c "lsnrctl start"
# start database
echo "Start Oracle database instance"
su - oracle -c "echo \"
CONN SYS/PASSWORD AS SYSDBA
STARTUP
exit \"|sqlplus /NOLOG"
# start enterprise manager
echo " Start Emterprise Manager"
su - oracle -c "emctl start dbconsole"
# start isqlplus
echo "Start isqlplus"
su - oracle -c "isqlplusctl start"
;;
stop)
# shutdown database
echo "Shutdown Oracle database instance"
su - oracle -c "echo \"
CONN SYS/PASSWORD AS SYSDBA
SHUTDOWN immediate
exit \"|sqlplus /NOLOG"
# stop tsnlisnter
echo "Stop tsnlisnter"
su - oracle -c "lsnrctl stop"
# stop enterprise manager
echo " Stop Emterprise Manager"
su - oracle -c "emctl stop dbconsole"
# stop isqlplus
echo "Stop isqlplus"
su - oracle -c "isqlplusctl stop"
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
////
将上述脚本保存在/etc/int.d/下 oracle10
ln -s /etc/init.d/oracle10g /etc/rc0.d/K00oracle10g
ln -s /etc/init.d/oracle10g /etc/rc2.d/S99oracle10g
感谢suisuiyouyu在cu的分享!
阅读(1010) | 评论(0) | 转发(0) |