ORA-01102: cannot mount database in EXCLUSIVE mode

ORA-011012 : cannot mount database in EXCLUSIVE mode



Message : ORA-01102: cannot mount database in EXCLUSIVE mode

SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01102: cannot mount database in EXCLUSIVE mode

Cause :

An instance tried to mount the database in exclusive mode, but some other instance has already mounted the database in exclusive or parallel mode. 

Action :

Either mount the database in parallel mode or shut down all other instances before mounting the database in exclusive mode.


Solution :

1. Verify that there is not a "sgadef.dbf" file in the directory 
"ORACLE_HOME/dbs". 

[oracle@db11g dbs]$ ls -ltr
total 88
-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora
-rw-rw---- 1 oracle oinstall 1544 Nov  1 01:43 hc_orcl.dat
-rw-rw---- 1 oracle oinstall 1544 Nov 26 10:17 hc_DBUA0.dat
-rw-r----- 1 oracle oinstall 1536 Nov 27 11:18 orapwSTDB
-rw-r----- 1 oracle oinstall 1536 Nov 27 11:21 orapworcl_original_bkp
-rw-rw---- 1 oracle oinstall 1544 Nov 27 12:59 hc_STDB.dat
-rw-r----- 1 oracle oinstall   24 Nov 27 13:23 lkSTDB
-rw-r----- 1 oracle oinstall 3584 Nov 27 13:23 spfileSTDB.ora
-rw-r--r-- 1 oracle oinstall 1364 Nov 28 05:34 initSTDB.ora
-rw-r--r-- 1 oracle oinstall 1364 Nov 28 05:36 initorcl.ora
-rw-r----- 1 oracle oinstall 1536 Nov 28 05:57 orapworcl
[oracle@db11g dbs]$

Here the file is not exist.

If this file does exist, remove it. 

$ rm $ORACLE_HOME/dbs/sgadef.dbf
or
[oracle@db11g dbs]$rm sgadef.dbf

2. Verify that there are no background processes owned by "oracle".

% ps -ef | grep ora_ | grep $ORACLE_SID

[oracle@db11g dbs]$ ps -ef | grep ora_ | grep $ORACLE_SID
oracle   26478     1  0 05:49 ?        00:00:00 ora_pmon_orcl
oracle   26480     1  0 05:49 ?        00:00:00 ora_vktm_orcl
oracle   26484     1  0 05:49 ?        00:00:00 ora_gen0_orcl
oracle   26486     1  0 05:49 ?        00:00:00 ora_diag_orcl
oracle   26488     1  0 05:49 ?        00:00:00 ora_dbrm_orcl
oracle   26490     1  0 05:49 ?        00:00:00 ora_psp0_orcl
oracle   26492     1  0 05:49 ?        00:00:00 ora_dia0_orcl
oracle   26494     1  0 05:49 ?        00:00:00 ora_mman_orcl
oracle   26496     1  0 05:49 ?        00:00:00 ora_dbw0_orcl
oracle   26498     1  0 05:49 ?        00:00:00 ora_lgwr_orcl
oracle   26500     1  0 05:49 ?        00:00:00 ora_ckpt_orcl
oracle   26502     1  0 05:49 ?        00:00:00 ora_smon_orcl
oracle   26504     1  0 05:49 ?        00:00:00 ora_reco_orcl
oracle   26506     1  0 05:49 ?        00:00:00 ora_mmon_orcl
oracle   26508     1  0 05:49 ?        00:00:00 ora_mmnl_orcl
oracle   26510     1  0 05:49 ?        00:00:00 ora_d000_orcl
oracle   26512     1  0 05:49 ?        00:00:00 ora_s000_orcl
[oracle@db11g dbs]$

[oracle@db11g dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 28 06:14:49 2015

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL>
SQL> shut immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@db11g dbs]$
[oracle@db11g dbs]$ ps -ef | grep ora_ | grep $ORACLE_SID
[oracle@db11g dbs]$


If background processes are still exist, remove them by using the Unix 
command "kill". For example: 

$ kill -9  

3. Verify that no shared memory segments and semaphores that are owned by "oracle" still exist

% ipcs -b >>>>>>>>>>>>> For AIX.

If there are shared memory segments and semaphores owned by "oracle", 
remove the shared memory segments

% ipcrm -m

ipcrm -m 3178511

and remove the semaphores 

% ipcrm -s  

ipcrm -s 622592

For Linux:
----------

[oracle@db11g dbs]$ ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x80a8cf1c 622592     oracle    660        154

[oracle@db11g dbs]$
[oracle@db11g dbs]$
[oracle@db11g dbs]$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x2fe8ef34 3178511    oracle    660        4096       0

[oracle@db11g dbs]$ ipcs -q

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages



If there are shared memory segments and semaphores owned by "oracle", 
remove the shared memory segments 

[oracle@db11g dbs]$ ipcrm -m 3178511
[oracle@db11g dbs]$
[oracle@db11g dbs]$
[oracle@db11g dbs]$
[oracle@db11g dbs]$ ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status

[oracle@db11g dbs]$ ipcrm -s 622592
[oracle@db11g dbs]$
[oracle@db11g dbs]$
[oracle@db11g dbs]$
[oracle@db11g dbs]$ ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems



NOTE: The example shown above assumes that you only have one 
database on this machine. If you have more than one 
database, you will need to shutdown all other databases 
before proceeding with Step 4. 

4. Verify that the "$ORACLE_HOME/dbs/lk" file does not exist

[oracle@db11g dbs]$ ls -ltr
total 88
-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora
-rw-rw---- 1 oracle oinstall 1544 Nov  1 01:43 hc_orcl.dat
-rw-rw---- 1 oracle oinstall 1544 Nov 26 10:17 hc_DBUA0.dat
-rw-r----- 1 oracle oinstall 1536 Nov 27 11:18 orapwSTDB
-rw-r----- 1 oracle oinstall 1536 Nov 27 11:21 orapworcl_original_bkp
-rw-rw---- 1 oracle oinstall 1544 Nov 27 12:59 hc_STDB.dat
-rw-r----- 1 oracle oinstall   24 Nov 27 13:23 lkSTDB
-rw-r----- 1 oracle oinstall 3584 Nov 27 13:23 spfileSTDB.ora
-rw-r--r-- 1 oracle oinstall 1364 Nov 28 05:34 initSTDB.ora
-rw-r--r-- 1 oracle oinstall 1364 Nov 28 05:36 initorcl.ora
-rw-r----- 1 oracle oinstall 1536 Nov 28 05:57 orapworcl
[oracle@db11g dbs]$

[oracle@db11g dbs]$ mv lkSTDB lkSTDB_not_required
[oracle@db11g dbs]$
[oracle@db11g dbs]$
[oracle@db11g dbs]$ ls -ltr
total 88
-rw-r--r-- 1 oracle oinstall 2851 May 15  2009 init.ora
-rw-rw---- 1 oracle oinstall 1544 Nov  1 01:43 hc_orcl.dat
-rw-rw---- 1 oracle oinstall 1544 Nov 26 10:17 hc_DBUA0.dat
-rw-r----- 1 oracle oinstall 1536 Nov 27 11:18 orapwSTDB
-rw-r----- 1 oracle oinstall 1536 Nov 27 11:21 orapworcl_original_bkp
-rw-rw---- 1 oracle oinstall 1544 Nov 27 12:59 hc_STDB.dat
-rw-r----- 1 oracle oinstall   24 Nov 27 13:23 lkSTDB_not_required
-rw-r----- 1 oracle oinstall 3584 Nov 27 13:23 spfileSTDB.ora
-rw-r--r-- 1 oracle oinstall 1364 Nov 28 05:34 initSTDB.ora
-rw-r--r-- 1 oracle oinstall 1364 Nov 28 05:36 initorcl.ora
-rw-r----- 1 oracle oinstall 1536 Nov 28 05:57 orapworcl
[oracle@db11g dbs]$


5. Startup the instance

[oracle@db11g dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 28 06:22:37 2015

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

Connected to an idle instance.

SQL>
SQL>
SQL>
SQL> startup
ORACLE instance started.

Total System Global Area  417546240 bytes
Fixed Size                  2213936 bytes
Variable Size             268437456 bytes
Database Buffers          142606336 bytes
Redo Buffers                4288512 bytes
Database mounted.
ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/home/oracle/app/oracle/oradata/orcl/system01.dbf'

No comments:

Post a Comment