客户的一台数据库通过监听连接不上,报ORA-27101 shared memory realm does not exist,赶紧登录检查之
[ora10g@ks admin]$ ps -ef|grep ora_
ora10g 4308 1 0 10:23 ? 00:00:00 ora_pmon_oracl2
ora10g 4310 1 0 10:23 ? 00:00:00 ora_psp0_oracl2
ora10g 4312 1 0 10:23 ? 00:00:00 ora_mman_oracl2
ora10g 4314 1 0 10:23 ? 00:00:00 ora_dbw0_oracl2
ora10g 4316 1 0 10:23 ? 00:00:00 ora_lgwr_oracl2
ora10g 4318 1 0 10:23 ? 00:00:00 ora_ckpt_oracl2
ora10g 4320 1 0 10:23 ? 00:00:01 ora_smon_oracl2
ora10g 4322 1 0 10:23 ? 00:00:00 ora_reco_oracl2
ora10g 4324 1 0 10:23 ? 00:00:00 ora_cjq0_oracl2
ora10g 4326 1 0 10:23 ? 00:00:01 ora_mmon_oracl2
ora10g 4328 1 0 10:23 ? 00:00:00 ora_mmnl_oracl2
ora10g 4330 1 0 10:23 ? 00:00:00 ora_d000_oracl2
ora10g 4332 1 0 10:23 ? 00:00:00 ora_s000_oracl2
ora10g 4339 1 0 10:25 ? 00:00:00 ora_arc0_oracl2
ora10g 4341 1 0 10:25 ? 00:00:00 ora_arc1_oracl2
ora10g 4345 1 0 10:25 ? 00:00:00 ora_qmnc_oracl2
ora10g 4351 1 0 10:25 ? 00:00:00 ora_q000_oracl2
ora10g 4353 1 0 10:25 ? 00:00:00 ora_q001_oracl2
进程都在
[ora10g@ks admin]$ sqlplus '/ as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 6 10:29:33 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>select instance_number,instance_name,host_name,version,startup_time,status,database_status,archiver from v$instance;
INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION STARTUP_T STATUS DATABASE_STATUS ARCHIVE
--------------- ---------------- ---------- ----------------- --------- ------------ ----------------- -------
1 oracl2 ks.localdo 10.2.0.1.0 06-MAY-11 OPEN ACTIVE STARTED
Sqlplus本地登录,状态一切正常,检查alert日志,也没任何问题,看样子,数据库是好好的,下面通过监听测试下
[ora10g@ks admin]$ sqlplus system/oracle@oracl2
SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 6 10:29:16 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
真的有问题,提示数据库没打开,奇怪了。检查下监听
[ora10g@ks admin]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 06-MAY-2011 10:29:46
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.99)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 06-MAY-2011 10:25:21
Uptime 0 days 0 hr. 4 min. 25 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /ora10g/app/product/product/10.0.2/network/admin/listener.ora
Listener Log File /ora10g/app/product/product/10.0.2/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.99)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
Services Summary...
Service "oracl2" has 1 instance(s).
Instance "oracl2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
监听也没任何问题,重启监听再次测试,还是报一样的错误。
检查监听日志看下,监听日志是正常连接成功了的。奇了怪了,再次通过本地连接登录数据库检查,发现数据库正常无比,无任何问题,看来还是监听的问题……
06-MAY-2011 10:29:46 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=ks.localdomain)(USER=ora10g))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * status * 0
不过,问题在哪里呢?
查看监听配置文件listener.ora
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.99)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=oracl2)
(ORACLE_HOME=/oracle/app/product/10.0.2)
)
)
这个ORACLE_HOME=/oracle/app/product/10.0.2不对吧,我现在的ORACLE_HOME是
[ora10g@ks admin]$ echo $ORACLE_HOME
/ora10g/app/product/product/10.0.2
看来是这里的问题了,改正之,成功。
那为什么ORACLE_HOME不对我也启动监听成功了呢,原来是在/oracle/app/product/10.0.2下面也安装了另一个oracle。
下面进行相关测试
我把监听里面的ORACLE_HOME更改为一个不可用路径,再次启动监听
[ora10g@ks admin]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 06-MAY-2011 10:46:33
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /ora10g/app/product/product/10.0.2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /ora10g/app/product/product/10.0.2/network/admin/listener.ora
Log messages written to /ora10g/app/product/product/10.0.2/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.99)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
TNS-01201: Listener cannot find executable /oracle/app/product/10.0.3/bin/oracle for SID oracl2
Listener failed to start. See the error message(s) above...
看到没有,报错了,监听去调用指定home目录的oracle执行程序,这也是我上面通过监听连接不上的根本原因。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11088128/viewspace-694600/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/11088128/viewspace-694600/