Problem Description
Users cant able to login to database server. Though it allow sysdba to login, it does not allow to run any query. Sometimes it will show database is connected to an idle instance. But when we startup database it shall throw error ORA-01081: cannot start already-running ORACLE - shut it down first.
$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.3.0 Production on Sat Oct 12 07:53:11 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select instance_name,status from v$instance;
ERROR at line 1:
ORA-01012: not logged on
SQL> desc v$instanceUsers cant able to login to database server. Though it allow sysdba to login, it does not allow to run any query. Sometimes it will show database is connected to an idle instance. But when we startup database it shall throw error ORA-01081: cannot start already-running ORACLE - shut it down first.
$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.3.0 Production on Sat Oct 12 07:53:11 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select instance_name,status from v$instance;
ERROR at line 1:
ORA-01012: not logged on
ERROR:
ORA-01012: not logged on
SQL> startup
ORA-01012: not logged on
Changes
Oracle has been forcefully shutdown at OS level or crashed.
CAUSE
An orphaned shared memory segment belonging to the ORACLE_SID still exists from a previous instance startup.
The command
ps -ef | grep $ORACLE_SID
shows no processes but with ORACLE_SID set the Oracle 'sysresv' utility shows a shared memory segment for a non-existing instance, e.g.
$ sysresv
IPC Resources for ORACLE_SID "TEST" :
Shared Memory:
ID KEY
5963794 0x00000000
5996563 0x00000000
6029332 0xb2e3c9ac
Semaphores:
ID KEY
No semaphore resources used
Oracle Instance not alive for sid "TEST"
Solution
On OS level, remove the orphaned shared memory segment using:
ipcrm -m <problem shared memory id>
$ ipcrm -m 5963794
$ ipcrm -m 5996563
$ ipcrm -m 6029332
$sqlplus '/as sysdba'
Connected to an idle instance.
SQL> startup Oracle instance started
Total System Global Area 10689474560 bytes
Fixed Size 2237776 bytes
Variable Size 6375344816 bytes
Database Buffers 4294967296 bytes
Redo Buffers 16924672 bytes
Oracle Instance Started.
Oracle Database Opened.
Thank you. You saved me with this one.
ReplyDeleteGlad to know this helped you..!!
ReplyDeletehelp me at big time...
ReplyDeleteThank you!!
ReplyDeleteWorked like a charm..!
ReplyDeletejust login with user / as sysdba
ReplyDeletethen shutdown abort
then startup database
thats it
This one actually helped
DeleteThank you. For once, a simple solution for a problem. I hate it when people just go on stroking their egos by describing hard to understand terminologies where just one simple solution or command would do the trick. Once again, thank you very much.
DeleteExcellent. Simple way to handle...
DeleteYou rock man.. This one actually worked. Thanks a lot..!!
Deleteyou are the best men ... ty ... saludos desde Peru
DeleteThank you, this was way simpler than the first option
DeleteThis one really worked. Thanks alot.
Deleteworked like a charm, thank you
DeleteThanks Rajesh :) This fix worked like a charm. Unfortunately, i didn't find any OS level orphaned shared memory segment and luckily found your comment. You rock man!!!
DeleteAre you blogger?
This comment has been removed by the author.
ReplyDeleteThanks you saved me with this one
ReplyDeleteWhen i am running this command i am getting the error
ReplyDeleteC:\Windows\system32>sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 14 09:42:01 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-00020: maximum number of processes (150) exceeded
Enter user-name:
===================================
C:\Windows\system32>sqlplus -prelim "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 14 09:33:16 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SYS@xyzdb 14-OCT-14>
SYS@xyzdb 14-OCT-14> SELECT p.spi
2 b.name "Background Process
3 s.username "User Name",
4 s.osuser "OS User",
5 s.status "STATUS",
6 s.sid "Session ID",
7 s.serial# "Serial No.",
8 s.program "OS Program"
9 FROM v$process p,
10 v$bgprocess b,
11 v$session s
12 WHERE s.paddr = p.addr
13 AND b.paddr(+) = p.addr
14 AND p.spid = 5280;
SELECT p.spid "Thread ID",
*
ERROR at line 1:
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0
sqlplus / as sysdba
Deletealter system register set processes=4000 scope=spfile;
It is possible that your hostname is not being recognized.
As root, type: hostname
As DB user, start listener and then DB. Should be fine
Thanks for the post. It quickly got me on my way!
ReplyDelete@Rajesh thanks brother, your advice saved me a lot of time & effort, Thanks Ankur for maintaining this blog.
ReplyDeleteexcellent
ReplyDeletecheck your hdisk space where it's keep the oradata file
ReplyDeleteHi, I am very new to Oracle I have just installed the pre built EBS 12.2 and it was working fine when I restart I face the same error can you please give me the steps to solve this as I am also new to Linux I have only 3 user oracle, root and applmgr How can I do that plz it is urgent Thanks
ReplyDeleteCan you please provide more details on the error message. Also check if you see any defunct processes from oracle, applmgr user.
DeleteORA-01081 :can not start already running ORACLE - shut it down first
DeleteDisconnect from oracle Database 11g Enterprise edition Release 11.2.0.4.0 -64 bit production
with the partitioning,OLAP, Data mining and Real Application Testing options
addbct1.sh : existing with status 9
This comment has been removed by the author.
DeletePlease check all the processes running from oracle, aplmgr
ReplyDeleteps -ef | grep oracle
ps -ef | grep applmgr
Kill all the processes, then do "ipcs -b" to find the remaining IPC facilities, owned by the same user, and remove them.
Another possible option is to issue the command 'shutdown abort' or'startup force' when connected thru sqlplus.
hai,
Deleteis there UTLMONTR.SQL script in oracle 11g windows ,iam not able to find this script.
please help me out on this.
Hi
ReplyDeleteThanks, this work, but now I am getting new error
When I Started Database Listener i.e
addlnctl. sh exits with status 1
Please check the listener config. files under $TNS_ADMIN (ORACLE_HOME/network/admin)
ReplyDeleteThanks, Now everything is working fine
DeleteThanks a lot
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteusorisa0csms01:CSMS:$ sqlplus / as sysdba
ReplyDeleteSQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 17 10:40:49 2015
Copyright (c) 1982, 2013, 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
SQL> startup
ORACLE instance started.
Total System Global Area 3340451840 bytes
Fixed Size 2257840 bytes
Variable Size 1828719696 bytes
Database Buffers 1493172224 bytes
Redo Buffers 16302080 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> select name, open_mode from v$database;
select name, open_mode from v$database
*
ERROR at line 1:
ORA-01507: database not mounted
usorisa0csms01:CSMS:$ sqlplus / as sysdba
ReplyDeleteSQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 17 10:40:49 2015
Copyright (c) 1982, 2013, 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
SQL> startup
ORACLE instance started.
Total System Global Area 3340451840 bytes
Fixed Size 2257840 bytes
Variable Size 1828719696 bytes
Database Buffers 1493172224 bytes
Redo Buffers 16302080 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> select name, open_mode from v$database;
select name, open_mode from v$database
*
ERROR at line 1:
ORA-01507: database not mounted
Great post it fixed my database.
ReplyDeleteHelped me as well, thanks! I would never suspect such thing :-)
ReplyDeleteNice & great post, helped me fixing my issue.
ReplyDeleteThis is great solution, It worked for me, Thanks a lot Ankur
ReplyDeleteI have still got same error for dbconnection(ORA-01012: not logged on. I am not able to connect database using pro*c.
ReplyDeletehere is he piece of code :
#include
#include
#include
EXEC SQL INCLUDE sqlca;
/* SQL and C shared variable declarations */
EXEC SQL BEGIN DECLARE SECTION;
char username[10] = "ad";
char password[10] = "ad";
char db_string[50] = "DV13ER";
EXEC SQL END DECLARE SECTION;
int oracle_connect();
void SQLerror();
main(){
printf("sql connection code=%d",sqlca.sqlcode);
return(sqlca.sqlcode);
}
int a;
/* ... */
EXEC SQL SELECT COUNT(*) INTO :a
FROM dual;
/* ... */
printf("The salary is %d\n", a);
//exit(0);
}
int oracle_connect(){
EXEC SQL CONNECT :username IDENTIFIED BY :password
AT DB_NAME USING :db_string;
printf("sql connection code=%d",sqlca.sqlcode);
return(sqlca.sqlcode);
}
void SQLerror()
{
/* Debugger */
/* fprintf(stderr,"SQLerror called\n");*/
fprintf(stderr,"\nORACLE error detected:\n");
fprintf(stderr,"% .70s \n", sqlca.sqlerrm.sqlerrmc);
fprintf(stderr,"Exiting...\n");
EXEC SQL ROLLBACK;
// Delete_Screen_Parms();
exit(207);
}
there is no IPC resource for oracle_sid
Fantastic!!!! Saved me today !
ReplyDeleteThank's a lot Brother....Nice post and worked for me
ReplyDeleteThank you.
ReplyDeleteThank you Ankur. Great post and helped me.
ReplyDeleteAnkur, I was struggling from morning, I was about to restart the box but your post has saved.
ReplyDeleteexcellent.
Thank you
--Dev
Big THANKs, ITs was very helpful
ReplyDeleteThank u brother.
ReplyDeleteI am unable to fix the issue.Could u give me any suggestion.(I have tried using command prompt).
ReplyDeleteHEllo ANKUR,
ReplyDeleteFIRST of all thank u for maintain this BLOG.
well I am trying to connect my database getting this error ORA-01012
in windows7(32-bit pc)
how to solve this
and also i am trying to shutdown no action is there
ERROR LIke
sql>sqlplus / as sysdba
connected
sql>
sql>select name from v$database;
error
ORA-01012: not logged on
session id:0, process id :0,
serial no: 0
can u pls find this
U just saved me... Thanks a lot .
ReplyDeleteThanks a lot...it has resolved my issue .
ReplyDeletePradeep Vyas
Thanks..!! Worked!!
ReplyDeleteThanks! Great tip.
ReplyDeleteFantastic. Saved me today.
ReplyDeleteThanks a lot. It worked for me.
ReplyDeleteThank you! This worked for me!
ReplyDeletePerfect solution by command sysresv and ipcrm -m , issue got resolved. Thanks.
ReplyDeleteFirst month at new job, ran into this one after patching oracle home. THANKS!!! You saved me :=)
ReplyDeleteThank you so much, you saved me..
ReplyDeleteGood one !! Thanks
ReplyDeleteThanks buddy.. Please guide me how to fix this issue permanently.....my setup is active passive. Wherever I'm switch over DB12c one node to second node that time i facing this issue.
ReplyDeletePlease help me
Thank you....you helped a brother
ReplyDeletei had this same error..ORA-01012: not logged on
ReplyDeletei did this $ sysresv, but noticed my oracle instance is alive,
do i still
ipcrm -m
***************** End of Resource Limits Dump ******************
Total /dev/shm size: 1762906112 bytes, used: 1720320 bytes
Shared Memory:
ID KEY
364347401 0x00000000
364380170 0x00000000
364314631 0x00000000
364412940 0x97883768
Semaphores:
ID KEY
12976128 0xa75179ec
13008897 0xa75179ed
13041666 0xa75179ee
Oracle Instance alive for sid "orcl"
Hi all
ReplyDeleteORA-01012: not logged on
session id:0, process id :0,
serial no: 0
This error has been a problem in my Windows environment. Any suggestions how I can overcome this challenge?
Eskişehir
ReplyDeleteAdana
Sivas
Kayseri
Samsun
FQ2YG
Denizli
ReplyDeleteAnkara
Antep
Bursa
Eskişehir
H44
https://titandijital.com.tr/
ReplyDeletenevşehir parça eşya taşıma
bolu parça eşya taşıma
batman parça eşya taşıma
bayburt parça eşya taşıma
LAPJ
https://istanbulolala.biz/
ReplyDelete6J7YYB
yalova evden eve nakliyat
ReplyDeletetunceli evden eve nakliyat
giresun evden eve nakliyat
ağrı evden eve nakliyat
van evden eve nakliyat
L7PAKG
urfa evden eve nakliyat
ReplyDeletemalatya evden eve nakliyat
burdur evden eve nakliyat
kırıkkale evden eve nakliyat
kars evden eve nakliyat
QP37W0
E7C78
ReplyDeleteUrfa Lojistik
Erzincan Lojistik
Van Lojistik
Muş Parça Eşya Taşıma
Tekirdağ Evden Eve Nakliyat
B9C30
ReplyDeleteIğdır Şehirler Arası Nakliyat
Adana Lojistik
Siirt Şehir İçi Nakliyat
Van Şehir İçi Nakliyat
Çorum Şehirler Arası Nakliyat
Niğde Evden Eve Nakliyat
Ardahan Evden Eve Nakliyat
Btcturk Güvenilir mi
Vector Coin Hangi Borsada
C485C
ReplyDeleteGiresun Parça Eşya Taşıma
Binance Güvenilir mi
Tunceli Lojistik
Silivri Duşa Kabin Tamiri
Yalova Şehirler Arası Nakliyat
Batman Lojistik
Manisa Parça Eşya Taşıma
Kilis Parça Eşya Taşıma
Batman Parça Eşya Taşıma
004C1
ReplyDeleteÇanakkale Lojistik
Bybit Güvenilir mi
seo danışmanlığı
sarms for sale
Hakkari Parça Eşya Taşıma
Batman Şehirler Arası Nakliyat
Kütahya Parça Eşya Taşıma
Rize Evden Eve Nakliyat
Kocaeli Lojistik
D06DC
ReplyDeletezonguldak rastgele görüntülü sohbet uygulamaları
Diyarbakır Rastgele Görüntülü Sohbet Uygulaması
izmir rastgele sohbet siteleri
Antalya Ücretsiz Sohbet Uygulaması
Bitlis Rastgele Görüntülü Sohbet Uygulamaları
Aydın Canli Sohbet Bedava
osmaniye en iyi görüntülü sohbet uygulaması
Karabük Yabancı Canlı Sohbet
Bilecik Telefonda Görüntülü Sohbet
5A7C8
ReplyDeleteOkex Borsası Güvenilir mi
Caw Coin Hangi Borsada
Binance Kimin
Tiktok Takipçi Satın Al
Gate io Borsası Güvenilir mi
Nonolive Takipçi Satın Al
Facebook Grup Üyesi Satın Al
Tumblr Takipçi Hilesi
Binance Sahibi Kim
F6C44
ReplyDeletereferans kimliği
gate io
gate io
en iyi kripto para uygulaması
kizlarla canli sohbet
4g mobil
bitexen
canlı sohbet odaları
kredi kartı ile kripto para alma
Thanks and I have a neat proposal: How To Budget House Renovation cost to gut and renovate a house
ReplyDelete