1853.因服务器断电导致Oracle数据库无法启动报ORA-10997,ORA-09968故障修复
故障描述:
SQL> startup
ORA-10997: another startup/shutdown operation of this instance inprogress
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
故障定位:
到这里我们就要想到Oracle启动的原理,在Oracle启动/停止进程发起的时候,会在$ORACLE_HOME/dbs目录下生成一个lkinst’SID’的临时文件进行lock,在启动/停止完成的时候会unlock然后把此文件删掉。
分析lkinst’SID’文件
从图中我们就可以看到了此实例链接文件,而这就是原因所在,服务器在异常关闭的时候数据库在关闭进程还没来得及关闭实例完成,此时服务器已经关闭了,导致此文件没有被删除,当下次启动的时候就会无法锁定实例,因而提示上方的错误。
故障处理:
删除或者移走lkinstfordb文件即可
[oracle@aix173 /oracle/app/oracle/product/11.2.0.4/dbhome_1/dbs]$rm -f lkinstfordb
再次启动数据库,发现已经正常启动
SQL> startup
ORACLE instance started.
Total System Global Area 1720328192 bytes
Fixed Size 2247072 bytes
Variable Size 1056966240 bytes
Database Buffers 654311424 bytes
Redo Buffers 6803456 bytes
Database mounted.
Database opened.
SQL>
ORA-09968, ORA-01102, ORA-10997 When Starting a Database (Doc ID 467251.1)
SYMPTOMS
Trying to startup a database on an UNIX server -having more than one database-, fails with the below errors:
sculkget: failed to lock /usr/local/oracle/product/10.2.0/dbs/lkISODDEV exclusive
sculkget: lock held by PID: xxxx
ORA-09968: unable to lock file
SVR4 Error: 11: Resource temporarily unavailable
Additional information: xxxx
ORA-1102 signalled during: ALTER DATABASE MOUNT…
OR
2023/10/26 19:34 Document 467251.1
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=196y7092h0_72&id=467251.1 2/3
SQL> startup
ORA-10997: another startup/shutdown operation of this instance inprogress
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
CHANGES
CAUSE
The strace for the startup process shows that the lock issue is on file $ORACLE_HOME/dbs/lkinst<instance_name> as below:
%strace -f -o strace_output.txt “sqlplus / as sysdba”
16456 open("/oracle/product/11.2.0/db_1/dbs/lkinstbantst1", O_RDWR|O_CREAT|O_EXCL, 0660) = -1 EEXIST (File exists)
16456 open("/oracle/product/11.2.0/db_1/dbs/lkinstbantst1", O_RDWR) = 8
16456 fcntl(8, F_SETFD, FD_CLOEXEC) = 0
16456 fcntl(8, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = -1 EAGAIN (Resource temporarily unavailable)
For example:
The parameter files for two databases have the same entries for control_files and db_name like
…
*.control_files=‘xx/control01.ctl’,‘xx/control02.ctl’,‘xx/control03.ctl’
*.db_name=ISODDEV
…
When the database is started using any of the pfiles the database being started is INST1 which locks the file INST2.
SOLUTION
Delete or rename the file $ORACLE_HOME/dbs/lkinst<instance_name>
A new file will be created when the instance is started up again.
2023/10/26 19:34 Document 467251.1
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=196y7092h0_72&id=467251.1 3/3
OR
Change the parameter file to have the correct entries for the control_files and db_name belonging to the individual databases.
实际案例:
因不明原因,可能是环境变量原因,同时起了两个实例,即两个一样的smon,kill一个就ok!




