勤快的小豬

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

          執(zhí)行dbstart啟動(dòng)數(shù)據(jù)庫時(shí)報(bào)錯(cuò)
          Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
          看來是listener服務(wù)沒有起來,但是執(zhí)行l(wèi)snrctl start卻能啟動(dòng)listener服務(wù)。
          搜索dbstart文件中的tnslsnr字符串

          grep tnslsnr dbstart

          返回結(jié)果:
            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環(huán)境變量引起的,查找 ORACLE_HOME_LISTNER

          grep ORACLE_HOME_LISTNER dbstart

          返回結(jié)果
          # 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環(huán)境變量賦值,但是這個(gè)路徑是不對(duì)的,編輯dbstart文件
          vi dbstar
          將該行改為export ORACLE_HOME_LISTNER=$ORACLE_HOME
          保存退出,然后執(zhí)行dbstart就沒問題了。呵呵

          想系統(tǒng)啟動(dòng)是自動(dòng)啟動(dòng)數(shù)據(jù)庫可以通過修改/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是參數(shù)start不起作用,它進(jìn)入了lsnrctl命令提示符,并沒有啟動(dòng),后來把命令用雙引號(hào)引起來就可以了如下:
          su oracle -c "ora_App/product/10.2.0/db_1/bin/lsnrctl start"
          是可以啟動(dòng)了,但是啟動(dòng)時(shí)報(bào)錯(cuò)如下:
          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用戶登陸執(zhí)行l(wèi)snrctl start就不報(bào)錯(cuò),看來是在root用戶中執(zhí)行su oracle -c "ora_App/product/10.2.0/db_1/bin/lsnrctl start"有些Oracle環(huán)境變量沒有設(shè)置。查了一下su 命令的參數(shù),其中有個(gè)-l參數(shù)
           -.-l或--login  改變身份時(shí),也同時(shí)變更工作目錄,以及HOME,SHELL,USER,LOGNAME。此外,也會(huì)變更PATH變量。  
          加上參數(shù)
          su oracle -lc "ora_App/product/10.2.0/db_1/bin/lsnrctl start"

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


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          <2011年10月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(2)

          隨筆檔案

          Oracle Data Mining | + KDD

          Oracle OLAP

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 肇庆市| 凤凰县| 长顺县| 科技| 施甸县| 句容市| 定日县| 南宫市| 南阳市| 广宁县| 团风县| 恩平市| 湖北省| 盐亭县| 通山县| 内黄县| 平湖市| 交城县| 安西县| 攀枝花市| 康乐县| 荆门市| 龙井市| 宁河县| 共和县| 汶川县| 霞浦县| 兰坪| 孝昌县| 日土县| 镇平县| 楚雄市| 长治县| 临沂市| 双峰县| 昆明市| 左贡县| 贡嘎县| 泽库县| 张掖市| 青铜峡市|