Introduction:
While starting the Oracle database in the mount stage was failed (ORA-01102: cannot mount database in exclusive mode) with the below error
Error:
SQL> alter database mount;
alter database mount
*ERROR at line 1:ORA-01102: cannot mount database in EXCLUSIVE mode
Cause: This ORA-01102 error is something that is related to some other instance that has the database mounted exclusive or being shared.
Solution: Shut down the other instance or mount it in a compatible mode. At First, shut down the instance using the shut immediate command. Then kill all Oracle processes related to the Oracle database. Below are the steps.
Step: 1. kill all Oracle processes related to the Oracle database.
kill -9 `ps -ef | grep $ORACLE_SID | grep -v grep | awk ‘{print $2}’`
kill -9 `ps -ef | grep <os username>| grep -v grep | awk ‘{print $2}’`
on the affected database.
Step: 2. We need to run the startup mount again.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 895105620 bytes
Fixed Size 2022504 bytes
Variable Size 163578776 bytes
Database Buffers 415236096 bytes
Redo Buffers 6365184 bytes
Database mounted.
SQL> alter database open;
Database altered
Happy Debugging!!