隨筆-13  評(píng)論-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用戶執(zhí)行以下命令
          chmod 755 /etc/rc.d/init.d/oracle10g
          chkconfig --add oracle10g


          三、 重啟服務(wù)
          service oracle10g stop
          service oracle10g start

           

          這樣在開(kāi)關(guān)機(jī)的時(shí)候oracle自動(dòng)啟動(dòng)和停止。
          posted on 2008-10-16 14:51 七匹狼 閱讀(583) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): oracle
          主站蜘蛛池模板: 和静县| 雷波县| 泊头市| 洛扎县| 泸水县| 石家庄市| 青阳县| 苗栗县| 理塘县| 海口市| 台州市| 望奎县| 旬邑县| 大埔县| 呼和浩特市| 枞阳县| 桐城市| 青龙| 长岭县| 平昌县| 阜宁县| 博罗县| 东乡族自治县| 封开县| 莱芜市| 惠来县| 弥勒县| 满洲里市| 邛崃市| 仁布县| 桂平市| 樟树市| 上虞市| 绥滨县| 葫芦岛市| 黄龙县| 六安市| 柳州市| 中卫市| 盘山县| 潍坊市|