사용자 도구

사이트 도구


dbms:oracle:install:startstopshellscripts

Oracle Start/Stop Shell Script

  1. 환경설정을 맞추어 아래의 스크립트를 작성한다.
    #!/bin/sh
    # chkconfig: 35 95 1
    # description: init script to start/stop oracle database 10g, TNS listener, EMS
    #
    # match these values to your environment: 
    
    export ORACLE_BASE=/usr/u01/app/oracle
    export ORACLE_HOME=/usr/u01/app/oracle/product/10.2.0.1
    export ORACLE_TERM=xterm
    export PATH=/home/oracle/bin:$ORACLE_HOME/bin:$PATH
    export ORACLE_SID=orcl
    export DISPLAY=<your ip address>:0
    export ORACLE_USER=oracle
    
    # see how we are called:
    case $1 in
    start)
    su - $ORACLE_USER <<EOO
    lsnrctl start
    sqlplus /nolog<<EOS
    connect / as sysdba
    startup
    EOS
    emctl start dbconsole
    EOO
    ;;
    
    stop)
    su - $ORACLE_USER <<EOO
    lsnrctl stop
    sqlplus /nolog<<EOS
    connect / as sysdba
    shutdown immediate
    EOS
    emctl stop dbconsole
    EOO
    ;;
    
    *)
    echo "Usage: $0 {start|stop}"
    ;;
    esac
  2. /etc/init.d/ 에 카피를 하고 /etc/rc.Xd 에 링크를 걸어준다.
dbms/oracle/install/startstopshellscripts.txt · 마지막으로 수정됨: 2008/10/24 10:51 저자 starlits