Oracle如何重啟mmon/mmnl進程(AWR自動采集)


環境:Oracle 11.2.0.4 RAC
現象:sysaux空間滿導致無法正常生成快照,清理空間后,手工生成快照可以成功,但是觀察自動生成快照依然是不成功。
之前了解到awr對應的相關后台進程是mmon,那么如何重啟這個mmon進程呢?
起初我誤以為是這種非核心進程是kill掉會自動啟動,實際在實驗環境中測試發現殺掉mmon進程並不會再自動起來。
那想啟動mmon進程難道要重啟數據庫嗎?當然,重啟數據庫自然是可以實現重啟mmon的目的,但是這對於絕大多數的生產環境來說,如果為這樣的需求去申請重啟數據庫都是幾乎不可接受的。
下面我在實驗環境做一個實際的演示:

當前節點mmon進程的信息如下:

[oracle@db01 ~]$ ps -ef|grep _mmon|grep -v grep
grid      5471     1  0 Dec13 ?        00:00:07 asm_mmon_+ASM1
oracle    7476     1  0 12:09 ?        00:00:05 ora_mmon_orcl1

正確重新啟動mmon的方法是在業務閑時啟用restricted模式,再立馬禁用:

alter system enable restricted session;
alter system disable restricted session;   

為了盡可能的減少設置restricted模式帶來的影響,所以建議最好兩個語句一起復制執行。
Tips:啟用restricted模式后,應用新連接數據庫的會話將直接報錯ORA-12526無法連接,直到禁用restricted模式后才可以恢復,具體現象如下:

[oracle@rac1-server ~]$ sqlplus jingyu/jingyu@192.168.1.107/orcl

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Dec 14 15:33:58 2018

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

ERROR:
ORA-12526: TNS:listener: all appropriate instances are in restricted mode

再去觀察mmon進程已經正常重啟:

[oracle@db01 ~]$ ps -ef|grep _mmon|grep -v grep
grid      5471     1  0 Dec13 ?        00:00:07 asm_mmon_+ASM1
oracle   15298     1  0 15:33 ?        00:00:00 ora_mmon_orcl1

可以看到,ora_mmon_orcl1進程的啟動時間由12:09變為15:33,說明是已經成功重啟了。再去觀察自動生成快照已經正常。
補充說明:
后續了解到,其實除了mmon進程外,還有一個mmnl進程也是隨着一起重啟的。
關於這兩個進程和awr的具體關系描述,可以參考eygle的文章,引用如下:

在Oracle10g中,有兩個后台進程是新增的,這里我想說的是MMON和MMNL。

在Oracle不同的文檔中,對這兩個進程的解釋存在歧義。
MMON 應該是 Memory Monitor 的縮寫,但是在有的文檔中被記錄為Manageability Monitor ,這應當是10g早期版本中的稱呼,只不過后來發生了變更。
這個進程的主要作用如下:
The memory monitor (MMON) process was introduced in 10g and is associated with the Automatic Workload Repository new features used for automatic problem detection and self-tuning. MMON writes out the required statistics for AWR on a scheduled basis.
另外一個進程是 MMNL ,是 Memory Monitor Light (MMNL) 的縮寫,在部分文檔中記錄為 Manageability Monitor Light .
這個進程的作用如下:
The Memory Monitor Light (MMNL) process is a new process in 10g which works with the Automatic Workload Repository new features (AWR) to write out full statistics buffers to disk as needed.

可以看到,mmon和mmnl這兩個后台進程在Oracle 10g就已經隨着AWR一起引入,作用都與awr自動收集相關。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM