Jatin Adarsh
Jatin Adarsh

Reputation: 31

ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist ORACLE 10g XE

enter image description here

Dont know what went wrong. It worked perfectly first time untill i restarted my Machine.

Upvotes: 3

Views: 15539

Answers (5)

sporak
sporak

Reputation: 516

This set of errors can occur when you don't have properly set ORACLE_SID and ORACLE_HOME variables.

Note, the ORACLE_HOME variable is supposed not to end with a slash char. So, even though it seems everything is configured fine, trailing slash in the ORACLE_HOME value will lead to the issue too:

# wrong:
export ORACLE_HOME=/usr/local/oracle/11gR2/

# correct:
export ORACLE_HOME=/usr/local/oracle/11gR2

Upvotes: 0

Jatin Adarsh
Jatin Adarsh

Reputation: 31

As "chkconfig" doesnt work now. I tried using sysv-rc-conf but the command not found: then, i tried apt-get install sysv-rc-conf but then shows E: Unable to locate package sysv-rc-conf

{ i was trying to config : " /etc/init.d/dbora " file to let my database to autostart. }

Upvotes: 0

DanBoc
DanBoc

Reputation: 153

Set environment variable ORACLE_HOME and ORACLE_SID should fix.

ORACLE_HOME=\<your path>\oracle\product\10.2.0\server
ORACLE_SID=xe

Obviusly you have to configure database to startup automatically.

To do so you need to set flag Y to youre instance in /etc/oratab and create appropriate /etc/init.d/dbora

Upvotes: 1

user5683823
user5683823

Reputation:

In addition to Alex's explanation, in particular the bit about the database not restarting automatically when you restarted your machine:

Navigate to /etc/oratab and edit it as root.

Find the line

orcl:/u01/app/oracle/product/12.1.0/db_1:N

Change the N at the very end to Y.

This will make the database start up whenever you restart your machine, so you won't have this trouble again.

Upvotes: 2

Alex Poole
Alex Poole

Reputation: 191560

It looks like your database didn't start automatically after your machine rebooted, and you're trying to connect as SYS in order to start it. You're currently trying to connect without specifying the SYSDBA role.

$ sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Thu Feb 16 16:04:26 2017

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

SQL> connect sys/12345
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0

With the role specified it connects to the idle instance:

SQL> connect sys/12345 as sysdba
Connected to an idle instance.
SQL> 

You can then issue the startup command.

You can also connect straight from the command line:

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Thu Feb 16 16:07:47 2017

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

Connected to an idle instance.

SQL>

The password you supply for SYS can be anything, as it relies on OS authentication anyway. You have to supply the role though. And be logged in to the OS as a user in the right group, of course, and have $ORACLE_HOME and $ORACLE_SID set correctly, etc.

Upvotes: 2

Related Questions