Ora 27101 ошибка

In my previous articles i have given the basic idea about multiple oracle errors in detail. I have given the one by one errors.In this article i would like to throw light on most important error coming while working on oracle- ORA-27101: shared memory realm does not exist error. The ORA-27101: shared memory realm does not exist will come due to when local shared memory realm is not accessible. You can see more details in oracle documentation where you will find out multiple types of oracle errors in detail.

Why ” ORA-27101: shared memory realm does not exist ” is coming?

In this section i would like to give you the actual error coming and why that error is coming in detail. I would like to explain multiple scenarios with the error also try to give the resolution of the error.

There are two scenarios due to which this error is occurring :

Scenario 1 :ORACLE_HOME or ORACLE_SID is wrong

There are so many times where ORACLE_HOME and ORACLE_SID is wrong and due to that ORA-27101 error will come.

Scenario 2 : When Database itself is Down

There are so many times the database will be down due to network error and due to that ORA-27101 error will come.We require to check what kind of error is occurring.

Error Description :

[oracle@Amit_db~]$ sqlplus amit_database/Pass@W0RD
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Aug 4 20:14:07 2020
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

I would like to discuss the scenarios in detail.Before that we require to think about the basic cause and its basic solution.

The basic Cause: The basic cause of this error is Unable to locate shared memory realm
Required Action: The DBA need to verify that the realm is accessible

How to resolve the Error –ORA-27101: shared memory realm does not exist ?

In this section i would like to give the 2 scenarios i explained in above paragraph and i will try to give the resolution for the error.

Scenario 1:Invalid ORACLE_HOME and ORACLE_SID:

The basic cause of ORA-27101 is usually due to the invalid ORACLE_HOME and ORACLE_SID parameters at Operating system level.

Steps to check whether ORACLE_HOME and ORACLE_SID Parameters set correct way,

Step 1 : Check whether the ORACLE_HOME is without slash

Step2 : We require to check the trailing slash at first step.

Example :

$ echo $ORACLE_HOME
$ /app/oracle/832/ << This is incorrect because of trailing slash /832/

$ echo $ORACLE_HOME
$ /app/oracle/832<<The oracle home is Correct because slash is not there

Step 3 : Check and Export Oracle SID

[oracle@Amit_db~]$ echo $ORACLE_HOME
/u01/app/oracle/product/10.2.0/amu_01

[oracle@192 ~]$ echo $ORACLE_SID
Amit_test_db

In above case ORACLE_SID is not right, we need to export ORACLE_SID to the valid one which is ora832

[oracle@Amit_db~]$ export ORACLE_SID=ora832
[oracle@Amit_db~]$ sqlplus amit_database/Pass@W0RD
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Aug 4 20:14:07 2020
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

Using above way we can resolve the issue with ORACLE_SID or ORACLE_HOME and we can resolve the issue.

Resolution :

Basically, to resolve ORA-27101, Once ORACLE_HOME and ORACLE_SID are correct, and then try to start SQL*Plus. 

ORA-27101: shared memory realm does not exist

Scenario 2: Database is down:

We can also face the ORA-27101 error when database is down.So to resolve the issue we require to start the database again.

[oracle@Amit_db~]$ sqlplus sys/sys as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on tue Aug 4 19:22:38 2020
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.

SQL> startup
ORACLE instance started.
Total System Global Area 1356784321 bytes
Fixed Size                  1234522bytes
Variable Size             187766663bytes
Database Buffers         102233333333bytes
Redo Buffers               23343334bytes
Database mounted.
Database opened.

Resolution :

To start the database again if it is down.

Using the database start operation you require to connect to the databases.These are the two scenarios for resolving ORA-27101: shared memory realm does not exist with examples.Hope you will get idea about resolving the ORA-27101: shared memory realm does not exist error.If you like this article or if you have any issues with the same kindly comment in comments section.

Сообщение об ошибке:

ORA-27101: shared memory realm does not exist

означает, что процесс (обычно Listener, sqlplus) не может подсоединиться к System Global Area (SGA).

В основном это вызывают две причины:

  1. SGA действительно не существует, так как инстанция БД не стартовала.
    Стартуйте инстанцию БД под пользователeм oracle:

    $ echo startup|sqlplus / as sysdba
    
  2. Shared memory segment Id для подключения к SGA генерируется из значений переменных окружения: $ORACLE_SID + $ORACLE_HOME. Если эти значения не соответствуют тем, которые были использованы при запуске инстанции БД, то будет выше указанная ошибка, так как такого сегмента не существует. Проверьте переменные окружения:

    env | egrep -i "oracle_(sid|home)"
    

    Значения $ORACLE_SID + $ORACLE_HOME, которые были использованы при установке
    хранятся в /etc/oratab и устанавливаются так:

    export ORACLE_SID=orcl; . oraenv 
    

Например, если попытаться установить вручную и при этом ошибиться:

$ echo exit|sqlplus -l user/pass 

Connected to:
Oracle Database 11g Release 11.2.0.1.0 - Production

$ ORACLE_HOME=$ORACLE_HOME/; test -d $ORACLE_HOME && echo "directory exists"
#                   ------^
directory exists

Всё хорошо, директория существует и sqlplus из неё будет вызываться, но незначащий слэш даст при подсчёте shmid другое значение:

$ echo exit|sqlplus -l user/pass

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory

Здравствуйте, уважаемые коллеги. Хочу поделиться сегодня с вами ситуацией, с которой столкнулся при подключении к базе данных Oracle 12c из стороннего клиентского приложения (архитектура клиент-сервер). При отладке приложения и запуске команды running fnd_nodes cleanup получил ошибку:

ERROR:
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist SVR4 Error: 2: No such file or directory

При этом я вполне мог подключиться к базе данных и выполнить autoconfig на стороне базы. Но на стороне приложения все также вылетали ошибки  и я не смог подключиться к БД из приложения. При этом база данных Oracle запущена и работает штатно.

Честно говоря, я не особо понял причину этой ошибки. Я проверил файлы XML и DBC, файл TNSNAME и listener, но я понять ничего не смог. Все в норме.

Причина ошибки ORA-01034 и ORA-2710

Поколупавшись еще немного в интернете и своих мозгах, я понял эти ошибки связаны с ограниченной сессией к базе данных (db restricted session). Для того, чтобы запустить adstats.sql в приложении, я должен был разрешить ограниченную сессию к ДБ (restricted session). Но я забыл закрыть ее после того, как запустил adstats.sql. Это и вызывало ошибки.

Как исправить ошибки ORA-01034 и ORA-2710

Просто я отключился от БД один раз (закрыл сессию), так как я не мог выяснить причину проблемы сразу в процессе устранения неполадок. После этого эта ошибка исчезла.

Также вы можете выполнить следующую команду, чтобы избежать этой ошибки и без  необходимости в закрытии сессии:

SQL> alter disable restricted session;

Вас заинтересует / Intresting for you:

I was running a delete script on a table with around 80 million records, the script ran for two days and eventually failed and the hard disk space (in which Oracle was installed) was reduced to 300MB (available) from 50GB (available). Then I truncated the table. The database was up and running until this point. Then I did a system restart, after that Oracle services are up, but I am not able to connect to the database from SQL*Plus or SQL Developer. When I try to connect it gives following error:

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

After that I increased my D drive memory to 100GB (available space) and restarted the Oracle services, but still was not able to connect to yjr database.

Then I tried all the approaches in this link like

1) Restarting Oracle
2) Setting ORACLE_SID environment variable
3) Verified the ORACLE_HOME from listener.ora and ORACLE_HOME from system properties.
4) Cleared windows event logs

When I run below sequence of commands:

set oracle_sid=DATABASE NAME
sqlplus /nolog
conn sys/sys as sysdba
shutdown abort
startup

the startup step produces the following error:

ORACLE instance started.

Total System Global Area 3892314112 bytes
Fixed Size                  3084576 bytes
Variable Size            1388318432 bytes
Database Buffers         2361393152 bytes
Redo Buffers              139517952 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 6996
Session ID: 7 Serial number: 21027

The SID of the database I am trying to connect is PSPRODDB. Below is a screenshot of my environment variables:

Screenshot of env variables

Here is my listerner.ora file.

# listener.ora Network Configuration File: D:oracleproduct12.1.0.2dbhome_1networkadminlistener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:oracleproduct12.1.0.2dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:oracleproduct12.1.0.2dbhome_1binoraclr12.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.244.45.240)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

Let me know if you need any further info. Please help.

In [1], it has listed some tips for resolving Oracle exception:

  • ORA-27101: shared memory realm does not exist

In this article, we will show you yet another tip of resolving ORA-27101.


The Background


There are two teams share the same DB server in our environment. Team A started an Oracle instance without shutting it down. As a team B member, how do you figure out how to shut it down?


Steps

  1. Find out the SID name:
    • ps -ef | grep smon (or pmon)
    • For example, the command shows:
      • oracle 32607 1 0 10:12 ? 00:00:03 ora_smon_SOAR2
    • So, we know the SID is named SOAR2.
  2. Find out Oracle Home path:
    • Use pmap command to report the memory map of smon process. For example, we issue: «pmap 32607» and one of the output line shows:
      • 00002b3f57270000 4K rwx— /disk2/home/oracle/atg/OracleDB_11.2.0.2/product/11.2.0/dbhome_1/lib/libocrutl11.so
  3. Setup ORACLE_HOME and ORACLE_SID environment variable
    • For example, we have set them using Linux bash:
      • export ORACLE_HOME=/disk2/home/oracle/atg/OracleDB_11.2.0.2/product/11.2.0/dbhome_1
      • export ORACLE_SID=SOAR2

However, after we started sqlplus and tried to shutdown our instance, we got:

$sqlplus «/ as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Wed Apr 25 17:15:08 2012

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to an idle instance.

SQL> shutdown immediate;
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory

The Issue

The problem is that /data/home is a symbolic link to /disk2/home directory. Oracle does not recognize one name used in Oracle Home path if you started it using another name.

To check what the environment variable ORACLE_HOME was set, you can check the process environment (/proc/<pid>/environ) . For example, from the following file:

  • /proc/32607/environ

we have found that ORACLE_HOME was set to be:

  • /data/home/oracle/atg/OracleDB_11.2.0.2/product/11.2.0/dbhome_1

After we have reset our ORACLE_HOME to the new path, we have resolved ORA-27101 issue.

References

  1. ORA-27101: shared memory realm does not exist tips
  2. ORA-01031: insufficient privileges

Понравилась статья? Поделить с друзьями:
  • Ora 19202 возникла ошибка при обработке xml
  • Ora 14402 ошибка
  • Ora 12638 credential retrieval failed ошибка
  • Ora 12560 tns ошибка адаптера протокола как исправить
  • Ora 12546 tns permission denied ошибка