ORA-01102: Cannot Mount Database in EXCLUSIVE Mode
ORA-01102 is a critical Oracle startup error that occurs when the database instance attempts to mount in EXCLUSIVE mode but finds the target already locked by another process or a stale lock file. This typically happens after an abnormal shutdown, a duplicate startup attempt, or leftover shared memory segments from a crashed instance. Understanding and resolving this error quickly is essential to minimizing downtime in production environments.
Top 3 Causes
1. Stale Lock Files from Abnormal Shutdown
When an Oracle instance crashes or is forcefully killed, lock files such as lk<SID> and sgadef<SID>.dbf may remain under $ORACLE_HOME/dbs/. On the next startup attempt, Oracle detects these files and assumes another instance already holds the lock.
-- Check instance status after attempting startup
SELECT instance_name, status, database_status
FROM v$instance;
-- After confirming DB is truly down, remove stale lock files (OS level)
-- $ ls -la $ORACLE_HOME/dbs/lk*
-- $ rm -f $ORACLE_HOME/dbs/lkORCL
-- $ rm -f $ORACLE_HOME/dbs/sgadefORCL.dbf
-- Restart after cleanup
STARTUP;
2. Duplicate Instance Startup Attempt
In a non-RAC (single-instance) environment, attempting to start a second instance with the same ORACLE_SID will trigger ORA-01102. This can happen when a DBA accidentally runs a startup command without realizing the instance is already running, or when an automated script fires twice.
-- Check for running PMON process at OS level first
-- $ ps -ef | grep pmon
-- If an instance is already running, check its status
SELECT inst_id, instance_name, host_name, status
FROM gv$instance;
-- Shut down the duplicate attempt gracefully
SHUTDOWN IMMEDIATE;
-- Or if unresponsive
SHUTDOWN ABORT;
3. Residual Shared Memory Segments
After an abnormal instance termination, System Global Area (SGA) shared memory segments may not be fully released by the OS. These orphaned segments conflict with the new instance startup and often appear alongside ORA-27154 or ORA-27300 errors.
-- Check SGA information if instance is partially accessible
SELECT name, bytes, resizeable
FROM v$sgainfo;
-- Confirm ADR trace location for further diagnosis
SELECT value
FROM v$diag_info
WHERE name = 'Diag Trace';
-- After OS-level shared memory cleanup, remount and open
STARTUP MOUNT;
ALTER DATABASE OPEN;
Quick Fix Solutions
-- Step 1: Attempt a clean shutdown first
SHUTDOWN IMMEDIATE;
-- Step 2: If shutdown fails, use ABORT
SHUTDOWN ABORT;
-- Step 3: After removing lock files and clearing shared memory at OS level,
-- restart the database
STARTUP;
-- Step 4: For RAC environments, verify no other node holds the lock
SELECT inst_id, instance_name, host_name, status
FROM gv$instance
ORDER BY inst_id;
-- Step 5: Check alert log location to review full error context
SELECT value
FROM v$diag_info
WHERE name = 'Diag Trace';
Prevention Tips
Always use proper shutdown procedures — Use
SHUTDOWN IMMEDIATEorSHUTDOWN NORMALbefore any OS reboot, patching, or maintenance window. Integratedbstart/dbshutscripts or systemd service units to automate clean startup and shutdown sequences, ensuring lock files are always properly released.Monitor and standardize your environment — Use Oracle Enterprise Manager (OEM) or a third-party monitoring tool to receive instant alerts on abnormal instance terminations. Standardize
ORACLE_SIDnaming conventions across environments to prevent accidental duplicate startups, and periodically audit$ORACLE_HOME/dbs/for stalelk*andsgadef*files as part of your routine DBA health checks.
Related Errors
- ORA-01100: Database already mounted — similar context, occurs on duplicate mount attempts.
- ORA-27154: post/wait create failed — OS-level semaphore issue, frequently appears alongside ORA-01102.
- ORA-27300 / ORA-27301: OS system call failures related to shared memory, check these when diagnosing residual SGA segments.
- ORA-01507: Database not mounted — may appear if OPEN is attempted without a proper MOUNT step during recovery from ORA-01102.
📖 Want a more detailed guide?
Check out the full in-depth version (Korean) on oraerror.com — includes detailed analysis, additional SQL examples, and prevention tips.
Top comments (0)