Wednesday, June 27, 2012

ORA-01034 & ORA-27101: Shared Memory Realm Does Not Exist



ORA-12701 may occur from various reason . According to the oracle doc's  ,
ORA-27101 :  shared memory realm does not exist
Cause  : Unable to locate shared memory realm .
Action  : Verify that the realm is accessible .

ORA-27101 and ORA-01034  combined may occurs in various scenarios .The main reason for this error is that the database is not up. When we try to connect with oracle database or sometimes during installation we may get this error . We may face this error in some other scenario's too . Here are few possible scenario's (  some scenario's are from window platform and some are from Linux  platform )

Case 1 :  When try to connect with normal user we get the error as

C:\>sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 6 11:22:08 2012
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Enter user-name: scott
Enter password:
ERROR:
ORA-01034: ORACLE not available
ORA-27101:  shared memory realm does not exist
Process ID: 0
Session ID: 0 Serial number: 0

To solve this issue , set the ORACLE_SID and start the database using the "sys" user as sysdba and start the database ,

C:\>set ORACLE_SID=noida
C:\>sqlplus sys/xxxx@noida as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 6 11:25:13 2012
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  535662592 bytes
Fixed Size                  1375792 bytes
Variable Size             331350480 bytes
Database Buffers          197132288 bytes
Redo Buffers                5804032 bytes
Database mounted.
Database opened.

Case  2 :  On a system with multiple IP addresses, when we connect with sqlplus locally on the server  (i.e. "sqlplus user/password") everything is OK, but connecting through a TNS alias, either from the network or locally on the server, we get the the following errors :  

$ sqlplus user/password@db_alias
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory

We need to Manually startup the database or check whether the listener is started or not . So either connect as
$export ORACLE_SID=noida 
$ sqlplus sys/password as sysdba 
SQL>startup 
or
check the status of listener if not started then start the listener  as
$lsnrctl
lsnrctl> stop
lsnrctl>start
lsnrctl>exit
$export ORACLE_SID=noida
$sqlplus sys/password@noida as sysdba
SQL> startup


Case 3 :  Make sure while connecting, that the ORACLE_SID and ORACLE_HOME is correctly set . There should not be trailing trash in ORACLE_HOME  path . So, set ORACLE_SID  before connecting as :
Linux  : 
$export ORACLE_SID=noida 
$sqlplus sys/xxxx@noida as sysdba
SQL> startup


Window  : 
C:\> set ORACLE_SID=noida
C:\> sqlplus sys/xxxx@noida as sysdba
C:\> startup 


Case 4 :   Sometimes in case of window ,  if event log is full , then we get this error . So delete the event logs and try to connect again .

2 comments:

Unknown said...

Excellent Shahid;
It resolved my problem
Thanks

Unknown said...

Hi,
I installed the oracle XE 11.2.0 in my PC, In the run SQL command,when i connect to the DB, i got the following error.ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Process ID: 0
Session ID: 0 Serial number: 0.
Pls help me to slove this.When i given the command startup it was saying that insufficient priviliges but i am a Admin user."Get started" not displaying web page.This URL is http://127.0.0.1:8080/apex/f?p=4950