隨筆-13  評論-28  文章-63  trackbacks-0
          #!/bin/bash
          #
          # chkconfig: 35 95 1
          # description: init script to start/stop oracle database 10g, TNS listener, EMS, isqlplus

          #

          # match these values to your environment:

          export ORACLE_BASE=/home/app/oracle
          export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1
          # export ORACLE_TERM=xterm
          export PATH=$PATH:$ORACLE_HOME/bin
          export NLS_LANG='american_america.ZHS16GBK'
          export ORACLE_SID=esales
          # export DISPLAY=localhost: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
          isqlplusctl start
          EOO
          ;;

          stop)
          su - "$ORACLE_USER"<<EOO
          lsnrctl stop
          sqlplus /nolog<<EOS
          connect / as sysdba
          shutdown immediate
          EOS
          emctl stop dbconsole
          isqlplusctl stop
          EOO
          ;;

          *)
          echo "Usage: $0 {start|stop}"
          ;;
          esac



          二、 以root用戶執行以下命令
          chmod 755 /etc/rc.d/init.d/oracle10g
          chkconfig --add oracle10g


          三、 重啟服務
          service oracle10g stop
          service oracle10g start

           

          這樣在開關機的時候oracle自動啟動和停止。
          posted on 2008-10-16 14:51 七匹狼 閱讀(580) 評論(0)  編輯  收藏 所屬分類: oracle
          主站蜘蛛池模板: 长阳| 河东区| 永善县| 龙里县| 昌邑市| 蒲城县| 旌德县| 汝州市| 耿马| 临武县| 秦安县| 沙田区| 敖汉旗| 黄浦区| 启东市| 海林市| 三河市| 牟定县| 蕲春县| 上高县| 西盟| 比如县| 双峰县| 黑山县| 武宣县| 沾化县| 承德市| 临沂市| 崇信县| 阿拉善左旗| 宜城市| 留坝县| 达拉特旗| 定安县| 金华市| 大邑县| 德钦县| 三都| 新巴尔虎右旗| 增城市| 靖安县|