首页 > 代码库 > Oracle 12c Lnux 启动脚本

Oracle 12c Lnux 启动脚本

#!/bin/bash##oracle: Start/Stop Oracle Database 11g R2/12c## chkconfig: 345 90 10# description: The Oracle Database Server is an RDBMS created by Oracle Corporation## processname: oracle. /etc/rc.d/init.d/functionsLOCKFILE=/var/lock/subsys/oraclePATH=$PATH:$HOME/binORACLE_USER=oracleexport PATHORACLE_BASE=/home/oracle/Oracle_12c/app/oracleORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1ORACLE_SID=MYORACLEPATH=$PATH:$ORACLE_HOME/binLD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32NLS_LANG=AMERICAN_CHINA.ZHS16GBKexport ORACLE_BASE ORACLE_HOME PATH ORACLE_SID LD_LIBRARY_PATH NLS_LANGcase "$1" instart)   if [ -f $LOCKFILE ]; then      echo $0 already running.      exit 1   fi   echo -n $"Starting Oracle Database:"   su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"   su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"   touch $LOCKFILE   ;;stop)   if [ ! -f $LOCKFILE ]; then      echo $0 already stopping.      exit 1   fi   echo -n $"Stopping Oracle Database:"   su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"   su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"   rm -f $LOCKFILE   ;;restart)   $0 stop   $0 start   ;;status)   if [ -f $LOCKFILE ]; then      echo $0 started.      else      echo $0 stopped.   fi   ;;*)   echo "Usage: $0 [start|stop|status]"   exit 1esacexit 0