linux下的oracle启动脚本
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-04-22
#!/bin/bash # oracle This shell script takes care of starting and stopping the oracle services. #author:jacky.lee #version 1.0 #date:2010.3.20 #oracle_home:/u01/app/oracle/product/10.2.0/db_1 RETVAL=0 # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network #define the start function start () { #start LISTENER if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl ]; then su - oracle -c ''lsnrctl start'' >/home/oracle/lsnrctl_start.log 2>&1 & fi #start oracle instance if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus ]; then su - oracle -c ''sqlplus''<<EOF connect / as sysdba startup quit EOF fi #start oracle enterprise manage if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/emctl ]; then su - oracle -c ''emctl start dbconsole'' >/home/oracle/oem_start.log 2>&1 & fi #start web isqlplus if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/isqlplusctl ]; then su - oracle -c ''isqlplusctl start'' >/home/oracle/isqlplusctl_start.log 2>&1 & fi } # #define the stop function # stop () { #stop oracle instance if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/sqlplus ]; then su - oracle -c ''sqlplus''<<EOF shutdown immediate quit EOF fi #stop isqlplus if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/isqlplusctl ]; then su - oracle -c ''isqlplusctl stop'' >/home/oracle/isqlplusctl_stop.log 2>&1 & fi #stop oracle enterprise manage if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/emctl ]; then su - oracle -c ''emctl stop dbconsole'' >/home/oracle/oem_stop.log 2>&1 & fi #stop LISTENER if [ -x /u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl ]; then su - oracle -c ''lsnrctl start'' >/home/oracle/lsnrctl_stop.log 2>&1 & fi } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $prog {start|stop|restart}" exit 1 esac exit $RETVAL |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于linux下的oracle启动脚本的所有评论