oracle程式都啟來了,sqlplus 顯示是idle instance

longqidong發表於2012-05-11
今天碰到一個比較鬱悶的問題,透過第三方備份軟體恢復資料庫後,檢視程式顯示oracle是起來的:
oracle    6661     1  0 17:09 ?        00:00:00 ora_pmon_orcl
oracle    6663     1  0 17:09 ?        00:00:00 ora_psp0_orcl
oracle    6665     1  0 17:09 ?        00:00:00 ora_mman_orcl
oracle    6667     1  0 17:09 ?        00:00:00 ora_dbw0_orcl
oracle    6669     1  0 17:09 ?        00:00:00 ora_lgwr_orcl
oracle    6671     1  0 17:09 ?        00:00:00 ora_ckpt_orcl
oracle    6673     1  0 17:09 ?        00:00:00 ora_smon_orcl
oracle    6675     1  0 17:09 ?        00:00:00 ora_reco_orcl
oracle    6677     1  0 17:09 ?        00:00:00 ora_cjq0_orcl
oracle    6679     1  0 17:09 ?        00:00:00 ora_mmon_orcl
oracle    6681     1  0 17:09 ?        00:00:00 ora_mmnl_orcl
oracle    6683     1  0 17:09 ?        00:00:00 ora_d000_orcl
oracle    6685     1  0 17:09 ?        00:00:00 ora_s000_orcl
oracle    6693     1  0 17:09 ?        00:00:00 ora_p000_orcl
oracle    6695     1  0 17:09 ?        00:00:00 ora_p001_orcl
oracle    6697     1  0 17:09 ?        00:00:00 ora_qmnc_orcl
oracle    6699     1  0 17:09 ?        00:00:00 ora_j000_orcl
oracle    6701     1  0 17:09 ?        00:00:00 ora_j001_orcl
oracle    6703     1  0 17:09 ?        00:00:00 ora_j002_orcl
oracle    6705     1  0 17:09 ?        00:00:00 ora_j003_orcl
oracle    6711     1  0 17:09 ?        00:00:00 ora_q000_orcl
oracle    6713     1  0 17:09 ?        00:00:00 ora_q001_orcl
oracle    6719  6599  0 17:10 pts/2    00:00:00 ps -ef
oracle    6720  6599  0 17:10 pts/2    00:00:00 grep ora


然後透過sqlplus / as sysdba進去,顯示是idle instance
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 11 17:10:31 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> conn sys/123 as sysdba
Connected to an idle instance.
SQL> conn / as sysdba
Connected to an idle instance.

但是使用下面一種方式可以:
SQL> conn sys/123@orcl as sysdba
Connected.

這就比較鬱悶了:

後面有人說是環境變數的問題,我仔細檢查。沒檢查出什麼問題:

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
ORACLE_BASE=/app/oracle/
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH
export ORACLE_BASE ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBARY_PATH

最後和其他主機資料庫環境變數做比較,發現ORACLE_BASE後面多了一條斜線。
去掉之後,重新連線,OK了,比較不解,記錄一下。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22418990/viewspace-723381/,如需轉載,請註明出處,否則將追究法律責任。

相關文章