今天在STARTUP一数据库时,发生如下错误:
[oracle@bogon ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 18 06:38:59 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 3307048960 bytes
Fixed Size                  2217872 bytes
Variable Size            1811941488 bytes
Database Buffers         1476395008 bytes
Redo Buffers               16494592 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
GOOGLE一下,发现是lk<SID>文件造成的,该文件位于ORALCE_HOME下的dbs目录下,马上检查该文件:
[root@bogon dbs]# fuser -u lkORCL
lkORCL:    18897(oracle) 18903(oracle) 18907(oracle) 18909(oracle) 18913(oracle) 18915(oracle) 18917(oracle) 18919(oracle) 18921(oracle) 18923(oracle) 18925(oracle) 18927
(oracle) 19019(oracle) 19021(oracle) 19023(oracle) 19025(oracle) 19029(oracle) 19044(oracle) 19046(oracle) 19048(oracle) 19094(oracle)
果然该文件没释放,用fuser命令kill掉:
[root@bogon dbs]# fuser -k lkORCL
lkORCL: 18897 18903 18907 18909 18913 18915 18917 18919 18921 18923 18925 18927 19019 19021 19023 19025 19029 19044 19046 19048 19094
然后:
SQL> startup
ORACLE instance started.
Total System Global Area 3307048960 bytes
Fixed Size                  2217872 bytes
Variable Size            1811941488 bytes
Database Buffers         1476395008 bytes
Redo Buffers               16494592 bytes
Database mounted.
Database opened.
SQL>
数据库STARTUP成功。