当前位置: 技术问答>linux和unix
[200分]在redhatlinux9中,关闭系统时,如何设置先自动关闭oracle9i数据库(急)
来源: 互联网 发布时间:2015-07-02
本文导语: 在redhatlinux9中,关闭系统时,如何设置才能先自动关闭oracle9i数据库,然后才能关闭linux 。 分不够可以再加!!!!!!!!!!!! | automatic start and stop oracle9i 1.su vi /etc/oratab dbsid:...
在redhatlinux9中,关闭系统时,如何设置才能先自动关闭oracle9i数据库,然后才能关闭linux 。
分不够可以再加!!!!!!!!!!!!
分不够可以再加!!!!!!!!!!!!
|
automatic start and stop oracle9i
1.su
vi /etc/oratab
dbsid:/home/oracle/OraHome1:Y
2.su
vi /etc/rc.d/init.d/oracle
#!/bin/sh
#
# /etc/rc.d/init.d/oracle
# function: start and stop Oracle database and listeners
# check result of run
case "$1" in
start)
echo -n "Starting Oracle Databases: "
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
su - oracle -c /home/oracle/OraHome1/bin/startdb9i >> /var/log/oracle
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Finished." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
touch /var/lock/subsys/oracle
;;
stop)
echo -n "Shutting Down Oracle Listeners: "
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Shutting Down Oracle Databases as part of system down." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
rm -f /var/lock/subsys/oracle
su - oracle -c /home/oracle/OraHome1/bin/stopdb9i >> /var/log/oracle
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Finished." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
;;
restart)
echo -n "Restarting Oracle Databases: "
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Restarting Oracle Databases as part of system up." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
su - oracle -c /home/oracle/OraHome1/bin/stopdb9i >> /var/log/oracle
su - oracle -c /home/oracle/OraHome1/bin/startdb9i >> /var/log/oracle
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Finished." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
touch /var/lock/subsys/oracle
;;
*)
echo "Usage: oracle {start|stop|restart}"
exit 1
esac
3.su - oracle
vi /home/oracle/OraHome1/bin/startdb9i
#/home/oracle/OraHome1/bin/startdb9i
echo "begin to start oracle"
lsnrctl start
sqlplus /nolog
1.su
vi /etc/oratab
dbsid:/home/oracle/OraHome1:Y
2.su
vi /etc/rc.d/init.d/oracle
#!/bin/sh
#
# /etc/rc.d/init.d/oracle
# function: start and stop Oracle database and listeners
# check result of run
case "$1" in
start)
echo -n "Starting Oracle Databases: "
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
su - oracle -c /home/oracle/OraHome1/bin/startdb9i >> /var/log/oracle
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Finished." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
touch /var/lock/subsys/oracle
;;
stop)
echo -n "Shutting Down Oracle Listeners: "
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Shutting Down Oracle Databases as part of system down." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
rm -f /var/lock/subsys/oracle
su - oracle -c /home/oracle/OraHome1/bin/stopdb9i >> /var/log/oracle
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Finished." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
;;
restart)
echo -n "Restarting Oracle Databases: "
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Restarting Oracle Databases as part of system up." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
su - oracle -c /home/oracle/OraHome1/bin/stopdb9i >> /var/log/oracle
su - oracle -c /home/oracle/OraHome1/bin/startdb9i >> /var/log/oracle
echo "Done."
echo ""
echo "----------------------------------------------------" >> /var/log/oracle
date +"! %T %a %D : Finished." >> /var/log/oracle
echo "----------------------------------------------------" >> /var/log/oracle
touch /var/lock/subsys/oracle
;;
*)
echo "Usage: oracle {start|stop|restart}"
exit 1
esac
3.su - oracle
vi /home/oracle/OraHome1/bin/startdb9i
#/home/oracle/OraHome1/bin/startdb9i
echo "begin to start oracle"
lsnrctl start
sqlplus /nolog
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
站内导航:
特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!