Saturday, March 26, 2016

ORA-01102: cannot mount database in EXCLUSIVE mode

While starting the oracle database instance it fails with following error.
Connected to an idle instance.
ORACLE instance started.
Total System Global Area 877574740 bytes
Fixed Size 651436 bytes
Variable Size 502653184 bytes
Database Buffers 263840000 bytes
Redo Buffers 10629120 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
Cause:
This ORA-01102 error indicates an instance tried to mount the database in exclusive mode, but some other instance has already mounted the database in exclusive or parallel mode. By default a database is started in EXCLUSIVE mode. Sometimes it cause due to setting incorrect ORACLE_SID environment specially for newly created database check you have set the correct CASE of ORACLE_SID in .base_profile. The real cause of ORA-01102 would be found in the alert log file where you will find additional information. Thus it always suggesting after getting error you must check the alert.log first.
The common reasons causing error ORA-01102 as follows.
·        The processes for Oracle (PMON, SMON, LGWR and DBWR) still exist. You can search them by ps -ef |grep “db_name”
·        Shared memory segments and semaphores still exist even though the database has been shutdown.
·        There exists a file named ORACLE_HOME\dbs\lk “db_name" where db_name is your actual database name.
·        A file named ORACLE_HOME\dbs\sgadef{sid}.dbf exists where SID is your actual database SID.
·        If you have two databases the same host and one is already started then if you try to start the other one will cause the issue.
·        While setting the ORACLE_SID environment variable, remember the point it is case sensitive in .bash_profile.
Solution:
·        Verify that there are no background processes owned by "oracle" $ ps -ef | grep ora_ | grep $ORACLE_SID. If background process exists, kill them.
·        Verify that no shared memory segments and semaphores that are owned by "oracle" still exist, if so, remove them $ ipcs –b
$ ipcrm -m Shared_Memory_ID_Number
$ ipcrm -s Semaphore_ID_Number
·        Verify that file $ORACLE_HOME\dbs\lk{db_name} does not exist where db_name is your actual database name.
·        Verify that file $ORACLE_HOME\dbs\sgadef{sid}.dbf does not exist where sid is your actual database SID.
·        Check you have set the correct case of ORACLE_SID in .base_profile.
Note: The "lk{db_name}" and "sgadef{sid}.dbf" files are used for locking shared memory. It may happen that even though no memory is allocated, Oracle thinks memory is still locked. By removing the "sgadef" and "lk" files you remove any knowledge oracle has of shared memory that is in use. So after removing those two file you can try to startup database.
·        If you see you have several databases in your machine and both of them uses have same entry in the parameter control_files and db_name then use correct values belonging to the individual databases.

·        From alert log if you see error related to permission denied" then ensure that in the file/directory oracle has permission and ensure that oracle is owner of the file. With chmod and chown you can change permission and ownership respectively.

No comments:

Post a Comment