标题: Get ORA-15028 when delete datafile on ASM [打印本页] 作者: 刘泽宇 时间: 2024-9-15 13:19 标题: Get ORA-15028 when delete datafile on ASM 现象:
On : 11.1.0.7 version, STORAGE
When attempting to delete unused datafile in asmcmd,
the following error occurs.
ERROR
-----------------------
ASMCMD> rm -rf TBS_ODS_201505.1978.877567729
ORA-15032: not all alterations performed
ORA-15028: ASM file '+DATADG/<database>/datafile/TBS_ODS_201505.1978.877567729' not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)
原因:
Since lsof command in ASMCMD is only available in 11.2 and above, asmcmd of 11.1.0.7 do not support it.
So we can track this issue on ASM instance by using errorstack:
alter system set events '15028 trace name errorstack level 3';
Note: To turn off this event after debug:
alter system set events '15028 trace name context off';
From errorstack trace of ORA-15028, we can see process 19453 (with sid 115, serial#42340) have a LIBRARY OBJECT LOCK on datafile TBS_ODS_201505.1978.877567729, so rm datafile failed:
From this process state dump in errorstack trace, we can see this datafile is locked by session (sid115,serial#42340), so it cannot be deleted.
An alternative way is to find it by using systemstate dump. In systemstate dump trace, search the file name, and then we can find the process id behind it: