操作系统环境redhat5.3 Oracle版本:Oracle11gR2
错误描述如下:
SQL> startup
ORACLE instance started.
Total System Global Area 598437888 bytes
Fixed Size 1338140 bytes
Variable Size 394265828 bytes
Database Buffers 197132288 bytes
Redo Buffers 5701632 bytes
Database mounted.
Database opened.
SQL> select * from test;
ID SCN
---------- ----------
1 751174
2 751225
3 751232
4 751239
5 751794
6 751805
7 751811
8 752922
8 rows selected.
SQL> conn scott/tiger
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Warning: You are no longer connected to ORACLE.
找了N多网上资料:
(1) 当ORACLE_HOME、ORACLE_SID设置不正确时,会出现这个错误
[oracle@elvis ~]$ echo $ORACLE_HOME
/u01/oracle/product/11.2.0/dbhome_1
[oracle@elvis ~]$ echo $ORACLE_SID
Elvis
经过查看不是因为这个错误。
(2) 说是由于listener.ora里面的语句设置不正确导致的
[oracle@elvis admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = elvis)
(ORACLE_HOME = /u01/oracle/product/11.2.0/dbhome_1) --后面不应该有”/”
(SID_NAME = elvis) 我的也没问题
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = elvis)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/oracle
(3) 还有说Oracle目录满了导致的
(4) 由于监听服务文件的错误
[oracle@elvis admin]$ vi tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ABC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = elvis)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = elvis)
)
)
LISTENER_ELVIS =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
我加了这句话后,正常了
[oracle@elvis ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 17 14:15:39 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> conn scott/tiger
Connected.
elvis
2012.10.17
知识共享~共同进步
转载请注明:
http://blog.csdn.net/elvis_dataguru/article/details/8081414