今天一客户执行如下命令时报错:
SQL> connect john/wanghong@john
ERROR: ORA-01034: oracle not available
ORA-27101: shared memory realm does not exist
该错误多数是由于ORACLE_HOME或ORACLE_SID设置不当造成的,如果是Windows,则多半是由于多个instance造成的,解决方法如下:
1.设定好正确的ORACLE_HOME和ORACLE_SID
在Unix&Linux下,在profile里设置正确的ORACLE_HOME和ORACLE_SID或者手工临时指定:
export ORACLE_HOME=/opt/ oracle /8.1.7
export ORACLE_SID=test
在Windows中在注册表里添加ORACLE_HOME及ORACLE_SID,并设置正确,也可以手工临时指定:
set ORACLE_SID=TEST
2.确定instance已经startup
在windows下在服务里面看到的service已经启动,并不代表instance已经start:
set ORACLE_SID=TEST
sqlplus /nolog
sql>connect /as sysdba
如果提示已经连接到闲置的实例,代表该instance没有起来,否则会提示已经连接
跟客户沟通,发现该server上有多个instance,而在服务中查看, oracle service都是启动的,设定ORACLE_SID,用sqlplus连过去,发现其instance未启动,将其启动后问题解决,修改sid启动方式用如下命令:
oradim -edit -sid test -startmode a
No Comments
Be the first to comment on this entry.
Leave a comment
Fields in bold are required. Email addresses are never published or distributed.
Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>URLs must be fully qualified (eg: http://www.dbifan.com),and all tags must be properly closed.
Line breaks and paragraphs are automatically converted.
Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.