隨筆-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 七匹狼 閱讀(579) 評論(0)  編輯  收藏 所屬分類: oracle
          主站蜘蛛池模板: 仙居县| 蓬溪县| 紫云| 呼图壁县| 邵武市| 沙河市| 会同县| 民勤县| 西华县| 平谷区| 响水县| 陆丰市| 永善县| 工布江达县| 新野县| 贵德县| 子长县| 阿克陶县| 油尖旺区| 涿鹿县| 镇原县| 延川县| 周宁县| 吉林省| 民乐县| 西峡县| 于田县| 文昌市| 兴城市| 措勤县| 辽中县| 黎平县| 昌图县| 灵宝市| 屯留县| 井冈山市| 泸定县| 平陆县| 杨浦区| 宜都市| 西充县|