您的位置:首页 > 其它

ORA-27101: shared memory realm does not exist

2014-07-03 11:44 465 查看
今天遇到一个比较奇怪的问题,在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> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息