ORACLE 11gR2 單例項資料庫自啟

lovehewenyu發表於2013-12-25

ORACLE 11gR2 單例項資料庫自啟

 
1.修改 /etc/oratab  最下面的 N  改為 Y

2.修改 $ORACLE_HOME/bin/dbstart 和 $ORACLE_HOME/bin/dbshut

ORACLE_HOME_LISNER=$ORACLE_HOME的絕對路徑

3.加為linux服務:

vi /etc/init.d/oracle
#!/bin/sh
# chkconfig: 35 90 90
# description: Oracle 11gR2
# /etc/init.d/oracle
#
# Run-level Stratup script for the Oracle Instance, Listener, and Web Interface

export ORACLE_SID=doudou
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export TMP=/tmp
export TMPDIR=/u01/tmp
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:
umask 022
 

ORA_OWNR="oracle"

case "$1" in
  start)
        su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart
        echo "Oracle Start Successful!"
        ;;
  stop)
        su $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
        echo "Oracle Stop Successful!"
        ;;
  reload|restart)
        $0 stop
        $0 start
        ;;
  *)
        echo $"Usage: `basename $0` {start|stop|reload|restart}"
        exit 1
  esac
  exit 0

 
4.新增開機啟動服務
chmod 755 /etc/init.d/oracle
chkconfig --add oracle
chkconfig oracle on
chkconfig --list oracle

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-1064273/,如需轉載,請註明出處,否則將追究法律責任。

相關文章