ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 手写linux下oracle的dbstart和dbshut脚本

手写linux下oracle的dbstart和dbshut脚本

原创 Linux操作系统 作者:jinqibingl 时间:2012-10-04 23:32:36 0 删除 编辑

手写linux下oracle的dbstart和dbshut脚本  

脚本内容:

#! /bin/bash

#

#chkconfig:876 99 01

#

oracle_home=/u01/oracle/10g

if [ i -f $oracle_home/bin/dbstart ]

then

echo "cannot find $oracle_home/bin/dbstart"

exit

fi

if [ i -f $oracle_home/bin/dbshut ]

then

echo "cannot find $oracle_home/bin/dbshut"

exit

fi

if [ i -f $oracle_home/bin/lsnrctl]

then

echo "cannot find $oracle_home/bin/lsnrctl"

exit

fi

if [ i -f $oracle_home/bin/emctl]

then

echo "cannot find $oracle_home/bin/emctl"

exit

fi

 

case "$1" in

'start')

echo "starting oracle 10g......."

su - oracle -c "$oracle_home/bin/dbstart"

su - oracle -c "$oracle_home/bin/lsnrctl start"

su - oracle -c "$oracle_home/bin/emctl start dbconsole"

;;

'stop')

echo "stoping oracle 10g......."

su - oracle -c "$oracle_home/bin/dbshut"

su - oracle -c "$oracle_home/bin/lsnrctl stop listiner"

su - oracle -c "$oracle_home/bin/emctl stop dbconsole"

;;

*)

echo "usage $0 :start|stop"

;;

esac

 

基本上应该可以用,同时也可以增加或者减少命令,只要参照这个格式,就可以了。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9606200/viewspace-745699/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-08-19

  • 博文量
    154
  • 访问量
    325250