天天看點

ORA-01102: cannot mount database in EXCLUSIVE mode

安裝完oracel 10g資料庫後,啟動資料庫時遇到ora-01102: cannot mount database in exclusive mode

ORA-01102: cannot mount database in EXCLUSIVE mode

檢視告警日志檔案,發現有ora-09968: unable to lock file 和linux-x86_64 error: 11: resource temporarily unavailable等錯誤

ORA-01102: cannot mount database in EXCLUSIVE mode

      a、 oracle的共享記憶體段或信号量沒有被釋放;

      b、 oracle的背景程序(如smon、pmon、dbwn等)沒有被關閉;

      c、 用于鎖記憶體的檔案lk<sid>和sgadef<sid>.dbf檔案沒有被删除。

看了文章前面一部分。便武斷的覺得應該是第三者情況(由于告警日志中出現

了相關資訊):“用于鎖記憶體的檔案lk<sid>和sgadef<sid>.dbf檔案沒有被删除”。于是動手操作(太心急,這

毛病老是難以改變),關閉資料庫執行個體,删除/u01/app/oracle/product/10.2.0/db_1/dbs/lkepps檔案後,重新

啟動資料庫。結果作者的經曆又在我身上重演了一次。

啟動時候報ora-00205錯誤

ORA-01102: cannot mount database in EXCLUSIVE mode

檢視告警日志,有如下錯誤資訊:

ORA-01102: cannot mount database in EXCLUSIVE mode

problem description:

====================

you are trying to startup the database and you receive the following error:

ora-01102: cannot mount database in exclusive mode

cause: some other instance has the database mounted exclusive or shared.

action: shutdown other instance or mount in a compatible mode.

problem explanation:

a database is started in exclusive mode by default. therefore, the ora-01102 error is misleading and may have occurred due to one of the following reasons:

- there is still an "sgadef<sid>.dbf" file in the "oracle_home/dbs"  directory

- the processes for oracle (pmon, smon, lgwr and dbwr) still exist

- shared memory segments and semaphores still exist even though the

database has been shutdown

- there is a "oracle_home/dbs/lk<sid>" file

search words:

=============

ora-1102, crash, immediate, abort, fail, fails, migration

solution description:

=====================

verify that the database was shutdown cleanly by doing the following:

1. verify that there is not a "sgadef<sid>.dbf" file in the directory "oracle_home/dbs".

        % ls $oracle_home/dbs/sgadef<sid>.dbf  if this file does exist, remove it.

        % rm $oracle_home/dbs/sgadef<sid>.dbf

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

       % ps -ef | grep ora_ | grep $oracle_sid

if background processes exist, remove them by using the unix

command "kill". for example:

     % kill -9 <rocess_id_number>

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

% ipcs -b

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

        % ipcrm -m <shared_memory_id_number>

and remove the semaphores

       % ipcrm -s <semaphore_id_number>

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<sid>" file does not exist

5. startup the instance

solution explanation:

the "lk<sid>" and

"sgadef<sid>.dbf" files are used for locking shared memory. it

seems 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. now the database

can start.