刪除歸檔日誌錯誤ORA-15028: ASM file '..' not dropped; currently being accessed
本文標記的是[翻譯],但並不是完全翻譯原文,因為我覺得其他兩個標記[原創]和[轉載]更加不合適
問題描述
本人執行delete noprompt archivelog all;時
會出現如下錯誤
ORA-15028: ASM file ‘+ASM/…/…/archivelog/2018_06_04/thread_1_seq_369793.27460.977942437’ not dropped; currently being accessed
一但出現這個錯誤,歸檔日誌刪除操作就無法繼續下去了。
不管執行幾次delete noprompt archivelog all;命令,都是這個錯誤,
都是碰到同一個檔案’+ASM/…/…/archivelog/2018_06_04/thread_1_seq_369793.27460.977942437’
根據路徑中的“2018_06_04”可以判斷 ,這檔案都已經幾個月前的了,不應該還是"currently being accessed"的狀態,肯定是有什麼程式或者程序加鎖了這個檔案一直不釋放。
之後百度到了這個文章http://www.cnblogs.com/future2012lg/p/5234435.html
解決方法
以下都是linux環境下
1.命令ps -ef | grep -i ora_arc*找到所有的歸檔日誌程序
oracle 26934 1 0 2017 ? 05:01:52 ora_arc0_orcl
oracle 26936 1 0 2017 ? 02:11:25 ora_arc1_orcl
oracle 26938 1 0 2017 ? 00:17:55 ora_arc2_orcl
…
2.根據路徑中的“thread_1”猜測是“ora_arc1_orcl”這個程序鎖了檔案
3.命令kill -9 26936結束程序“ora_arc1_orcl”
4.命令delete noprompt archivelog all;,沒有再遇到"currently being accessed"這樣的問題
提醒:過段時間執行命令ps -ef | grep -i ora_arc*會發現剛才殺掉的程序“ora_arc1_orcl”會自動恢復