ORA-27101: shared memory realm does not exist

今天遇到一個比較奇怪的問題,在sqlplus通過OS認證登陸數據庫服務器是正常的

[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 3 11:23:35 2014
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select status from v$instance;

STATUS
------------------------------------
OPEN

如果通過服務名登陸,就會提示下面錯誤

[oracle@localhost ~]$ sqlplus test/test@orcl

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 3 11:04:19 2014
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist

Linux-x86_64 Error: 2: No such file or directory

查看ORACLE_HOME、ORACLE_SID沒有問題

[oracle@localhost ~]$ echo $ORACLE_HOME
/oracle/product/10.2.0/db_1
[oracle@localhost ~]$ echo $ORACLE_SID 
orcl

查看監聽沒有問題

[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 03-JUL-2014 11:25:17
Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.147)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                03-JUL-2014 11:14:46
Uptime                    0 days 0 hr. 10 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.147)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

查看tnsnames.ora文件配置
[oracle@localhost ~]$ cat /oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.147)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

查看sqlnet.ora文件配置

[oracle@localhost ~]$ cat /oracle/product/10.2.0/db_1/network/admin/sqlnet.ora
#sqlnet.authentication_services=(NONE)
#names.directory_path=(tnsnames,onames,hostname)

查看listener.ora文件配置

[oracle@localhost ~]$ cat /oracle/product/10.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /oracle/product/10.2.0/db_1/)
      (SID_NAME = orcl)
    )
   
  )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.147)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )

經過仔細查找,終於發現問題,原來是listener.ora文件中ORACLE_HOME路徑最後多了個斜槓,去掉後重啓監聽解決。

[oracle@localhost ~]$ sqlplus test/test@orcl
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 3 11:40:29 2014
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章