勤快的小豬

          Oracle自動啟動(解決了Failed to auto-start Oracle Net Listene和Message 1053 not found錯誤)

          執行dbstart啟動數據庫時報錯
          Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
          看來是listener服務沒有起來,但是執行lsnrctl start卻能啟動listener服務。
          搜索dbstart文件中的tnslsnr字符串

          grep tnslsnr dbstart

          返回結果:
            if [ -f $ORACLE_HOME_LISTNER/bin/tnslsnr ] ; then
              echo "Failed to auto-start Oracle Net Listene using $ORACLE_HOME_LISTNER/bin/tnslsnr"

          看來可能是ORACLE_HOME_LISTNER環境變量引起的,查找 ORACLE_HOME_LISTNER

          grep ORACLE_HOME_LISTNER dbstart

          返回結果
          # 3) Set ORACLE_HOME_LISTNER
          ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
          if [ ! $ORACLE_HOME_LISTNER ] ; then
            echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
            LOG=$ORACLE_HOME_LISTNER/listener.log
            if [ -f $ORACLE_HOME_LISTNER/bin/tnslsnr ] ; then
              $ORACLE_HOME_LISTNER/bin/lsnrctl start >> $LOG 2>&1 &
              export VER10LIST=`$ORACLE_HOME_LISTNER/bin/lsnrctl version | grep "LSNRCTL for " | cut -d' ' -f5 | cut -d'.' -f1`
              echo "Failed to auto-start Oracle Net Listene using $ORACLE_HOME_LISTNER/bin/tnslsnr"
                  $LOGMSG "Restart Oracle Net Listener using an alternate ORACLE_HOME_LISTNER: lsnrctl start"

          其中有一段給ORACLE_HOME_LISTNER環境變量賦值,但是這個路徑是不對的,編輯dbstart文件
          vi dbstar
          將該行改為export ORACLE_HOME_LISTNER=$ORACLE_HOME
          保存退出,然后執行dbstart就沒問題了。呵呵

          想系統啟動是自動啟動數據庫可以通過修改/etc/rc.d/rc.local文件
          一開始我寫的命令是
          su oracle -c ora_App/product/10.2.0/db_1/bin/lsnrctl start
          su oracle -c ora_App/product/10.2.0/db_1/bin/dbstart
          但是su oracle -c ora_App/product/10.2.0/db_1/bin/lsnrctl start是參數start不起作用,它進入了lsnrctl命令提示符,并沒有啟動,后來把命令用雙引號引起來就可以了如下:
          su oracle -c "ora_App/product/10.2.0/db_1/bin/lsnrctl start"
          是可以啟動了,但是啟動時報錯如下:
          Message 1053 not found; No message file for product=network, facility=TNSTNS-12541: Message 12541 not found; No message file for product=network, facility=TNS
          TNS-12560: Message 12560 not found; No message file for product=network, facility=TNS
          但是如果我用oracle用戶登陸執行lsnrctl start就不報錯,看來是在root用戶中執行su oracle -c "ora_App/product/10.2.0/db_1/bin/lsnrctl start"有些Oracle環境變量沒有設置。查了一下su 命令的參數,其中有個-l參數
           -.-l或--login  改變身份時,也同時變更工作目錄,以及HOME,SHELL,USER,LOGNAME。此外,也會變更PATH變量。  
          加上參數
          su oracle -lc "ora_App/product/10.2.0/db_1/bin/lsnrctl start"

          posted on 2011-10-11 16:44 嚕嚕 閱讀(6724) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2011年10月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆檔案

          Oracle Data Mining | + KDD

          Oracle OLAP

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 彭水| 石泉县| 张北县| 长岛县| 卢氏县| 西华县| 交城县| 蓬安县| 塔城市| 西盟| 阜新市| 高安市| 乐安县| 贡嘎县| 山丹县| 峡江县| 界首市| 鸡西市| 山西省| 河曲县| 金寨县| 承德市| 林周县| 紫金县| 江西省| 怀柔区| 绥化市| 平山县| 平南县| 台安县| 中宁县| 太湖县| 会东县| 寿阳县| 政和县| 许昌市| 眉山市| 鹤庆县| 宜兰市| 张家口市| 霍邱县|