zoukankan      html  css  js  c++  java
  • oracle11g在CentOS6.9上启动脚本

    #!/bin/bash
    # chkconfig:2345 99 10
    # description: Startup Script for oracle Database
    # /etc/init.d/oracle
    # time 2017-08-11 by justzhi
    export ORACLE_BASE="/oracle/ora11g"
    export ORACLE_HOME="$ORACLE_BASE/app"
    export ORACLE_OWNER=oracle
    if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
    then
        echo "Oracle startup:cannot start "
        exit 1
    fi
    #depending on parameter -- start,stop,restart,
    #of the instance and listener or usage display
    case "$1" in
      start)
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
        echo "Starting Oracle:"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
        touch /var/lock/subsys/oracle11g
        echo "OK"
        ;;
      stop)
        #oracle listener and instance shutdown
        echo -n "Shutdown Oracle"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
        su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut "
        rm -f /var/lock/subsys/oracle11g
        echo "ok"
        ;;
      status)
        if ( pgrep "tnslsnr" && netstat -anpt | grep ":1521") &> /dev/null
          then
            echo " Oracle 11g Net Listener is running."
          else
            echo "Oracle 11g Net listener is not running"
        fi
        if (netstat -anpt|grep ":1158" && netstat -anpt |grep ":5520") &> /dev/null
          then
            echo "Oralce 11g Enterprise Mannager is running"
          else
            echo "Oracle 11g Enerprise Mannager is not running"
        fi
        ;;
       restart)
          $0 stop
          $0 start
          ;;
          *)
          echo "Usage: $0 {start|stop|restart|status}"
          exit 1
          ;;
    esac
    exit 0

  • 相关阅读:
    Python(调用函数、定义函数)
    Python(可变/不可变类型,list,tuple,dict,set)
    Python(变量、数据类型)
    java内存泄露
    java垃圾回收
    mac下安装mysql教程
    Http、Https请求工具类
    ThreadLocal内部机制及使用方法
    java单例模式详解
    (转)Java集合框架:HashMap
  • 原文地址:https://www.cnblogs.com/me80/p/7446597.html
Copyright © 2011-2022 走看看