誤修改ORACLE_HOME導致無法登陸資料庫

jiangkch發表於2014-02-26
1、現象:
[oracle@secdb1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 25 23:49:20 2014
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  314572800 bytes
Fixed Size                  1219184 bytes
Variable Size              79693200 bytes
Database Buffers          230686720 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL> conn system/oracle@PROD
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Warning: You are no longer connected to ORACLE.
SQL> 
2.解決方法:
懷疑是ORACLE_HOME目錄設定不正確導致,檢視ORACLE_HOME目錄,發現目錄中多了一個“/”
[oracle@secdb1 ~]$ echo $ORACLE_HOME
//u01/app/oracle/product/10.2.0/db_1

重新設定一下ORACLE_HOME的目錄,啟動資料後,連線正常
[oracle@secdb1 ~]$ export  ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
[oracle@secdb1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0/db_1
[oracle@secdb1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Feb 26 00:27:41 2014
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  314572800 bytes
Fixed Size                  1219184 bytes
Variable Size              79693200 bytes
Database Buffers          230686720 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL> conn system/oracle@PROD
Connected.
SQL> 

3、總結
oracle使用者中的環境變數非常重要,特別是ORACLE_HOME,如果不小心改動了,會導致資料庫無法連線


jiangkck

2014026
----------------------



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

相關文章