oracle 11g pmon工作內容系列一
背景
熟悉PMON的含義及工作內容。結論
1,pmon可以用10246 event進行跟蹤PMON工作過程2,pmon工作內容如下:
後經查詢官方手冊發現,PMON的工作內容如下:
1,監控後臺程式執行狀況
2,如果某些程式異常中斷,PMON去釋放會話資源以及佔用的鎖LOCK
3,更新事務表的標誌以及清除事務XID的標記
4,清除異常中斷會話在BUFFER CACHE佔用的快取
5,PMON也負責定期把資料庫例項註冊到監聽器中
3,10246 EVENT產生的TRACE FILE分析摘錄
--PMON接到通知
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksl2.h LINE:2160 ID:kslges, process=6c, post_num=5
*** 2015-11-01 21:49:30.646
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksl2.h LINE:2160 ID:kslges, process=39, post_num=6
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12751 ID:ksupsc, process=b8, post_num=7
*** 2015-11-01 22:03:02.812
deleting session 0xdc97f1b0 sid=201 serial=188 --PMON發現上述測試會話被人為KILL
*** 2015-11-01 22:03:03.382
deletion of killed session 0xdc97f1b0 successful
--這裡就是ORACLE核心程式碼負責清理被KILL會話佔用的資源
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12737 ID:ksuabt, process=0, post_num=8
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=9
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=10
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=11
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=12
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=13
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=14
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=15
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=16
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=17
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=18
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=19
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=20
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=21
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=22
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=23
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=24
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=25
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=26
PMON ignoring post from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2
*** 2015-11-01 22:03:06.428
marked process 0xdd6589c0 pid=184 serial=2 ospid = 11635 dead --PMON清理完被KILL後,標記為DEAD
*** 2015-11-01 22:03:06.446
deleting process 0xdd6589c0 pid=184 serial=2 priority=0 --然後刪除這個會話對應的作業系統程式資源
deletion of process dd6589c0 pid=184 seq=2 successful
測試
1,資料庫版本
SQL> select * from v$version where rownum=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
2,跟蹤pmon
SQL> alter session set tracefile_identifier='pmon_test1';
Session altered.
SQL> alter system set events='10246 trace name context forever,level 1';
System altered.
3,使用者測試會話
SQL> select sid from v$mystat where rownum=1;
SID
----------
201
SQL> select sid,serial# from v$session where sid=201;
SID SERIAL#
---------- ----------
201 188
SQL> create table t_pmon(a int,b int);
Table created.
SQL> insert into t_pmon select level,level from dual connect by level<=1000000;
insert into t_pmon select level,level from dual connect by level<=1000000
*
ERROR at line 1:
ORA-00028: your session has been killed
ORA-00028: your session has been killed
--另啟會話殺掉正在插入記錄的上述測試會話
SQL> alter system kill session '201,188';
System altered.
3,關閉pmon跟蹤
SQL> alter system set events='10246 trace name context off';
System altered.
4,檢視pmon的TRACE FILE
--PMON接到通知
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksl2.h LINE:2160 ID:kslges, process=6c, post_num=5
*** 2015-11-01 21:49:30.646
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksl2.h LINE:2160 ID:kslges, process=39, post_num=6
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12751 ID:ksupsc, process=b8, post_num=7
*** 2015-11-01 22:03:02.812
deleting session 0xdc97f1b0 sid=201 serial=188 --PMON發現上述測試會話被人為KILL
*** 2015-11-01 22:03:03.382
deletion of killed session 0xdc97f1b0 successful
--這裡就是ORACLE核心程式碼負責清理被KILL會話佔用的資源
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12737 ID:ksuabt, process=0, post_num=8
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=9
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=10
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=11
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=12
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=13
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=14
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=15
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=16
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=17
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=18
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=19
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=20
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=21
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=22
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=23
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=24
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=25
PMON posted from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2, post_num=26
PMON ignoring post from location=FILE:/ade/b/1640894963/oracle/rdbms/src/hdir/ksu.h LINE:12763 ID:ksuxfd, process=2
*** 2015-11-01 22:03:06.428
marked process 0xdd6589c0 pid=184 serial=2 ospid = 11635 dead --PMON清理完被KILL後,標記為DEAD
*** 2015-11-01 22:03:06.446
deleting process 0xdd6589c0 pid=184 serial=2 priority=0 --然後刪除這個會話對應的作業系統程式資源
deletion of process dd6589c0 pid=184 seq=2 successful
繼續測試,如果我們讓PMON阻塞,再手工KILL測試會話會如何呢
SQL> select pid,spid from v$process where pname='PMON';
PID SPID
---------- ------------------------------------------------
2 10556
SQL> oradebug setospid 10556
Oracle pid: 2, Unix process pid: 10556, image: oracle@seconary (PMON)
SQL> oradebug suspend
Statement processed.
沒看到任何有價值的內容
換個思路,如果阻塞PMON,事務提交會不會正常進行呢
SQL> oradebug setospid 10556
Oracle pid: 2, Unix process pid: 10556, image: oracle@seconary (PMON)
SQL> oradebug suspend
Statement processed.
可見事務提交不受影響
SQL> update t_pmon set a=111 where a=1;
1 row updated.
SQL> commit;
Commit complete.
後經查詢官方手冊發現,PMON的工作內容如下:
1,監控後臺程式執行狀況
2,如果某些程式異常中斷,PMON去釋放會話資源以及佔用的鎖LOCK
3,更新事務表的標誌以及清除事務XID的標記
4,清除異常中斷會話在BUFFER CACHE佔用的快取
5,PMON也負責定期把資料庫例項註冊到監聽器中
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-1822772/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 11g pmon工作內容系列二Oracle
- oracle 11g pmon工作內容系列三Oracle
- oracle dba 日常工作內容Oracle
- oracle 11g bootstrap$系列一Oracleboot
- oracle 11g latch之系列一Oracle
- Oracle redo日誌內容探索(一)Oracle Redo
- Laravel5.8 入門系列四,內容釋出功能準備工作Laravel
- VMware日常維護工作內容
- QA人員的工作內容
- Oracle巡檢內容Oracle
- 資料庫(Oracle)運維工作內容及常用指令碼命令資料庫Oracle運維指令碼
- oracle 一般手動巡檢內容Oracle
- 資料庫運維工作內容資料庫運維
- 工作踩坑系列——https 訪問遇到 “已阻止載入混合活動內容”HTTP
- Oracle 控制檔案內容Oracle
- oracle相關內容索引Oracle索引
- Oracle 11g系列:檢視Oracle
- Oracle 11g系列:約束Oracle
- oracle 11g bootstrap$系列二Oracleboot
- oracle 11g bootstrap$系列三Oracleboot
- ListView進階系列之一 內容順序淡淡顯示View
- PMON failed to acquire latch, see PMON dumpAIUI
- Oracle 11g 500種新功能 著重商業智慧及內容管理(轉)Oracle
- 密碼學系列之:內容嗅探密碼學
- Bootstrap系列 -- 4. 文字內容強調boot
- Oracle 11g系列:資料庫Oracle資料庫
- oracle smon與pmon ckpt功能的作用(ZT)Oracle
- PMON failed to acquire latch, see PMON dump in alert logAIUI
- oracle查詢語句查詢增加一列內容Oracle
- oracle 10g 培訓第一天內容Oracle 10g
- Oracle 11g系列:資料表物件Oracle物件
- oracle redo internal (2) --- dump內容理解Oracle Redo
- oracle redo internal (2) --- dump內容理解Oracle
- oracle資料庫巡檢內容Oracle資料庫
- 快手內容分發工具,一鍵分發短影片內容
- 什麼是內容運營?日常涉及哪些工作?
- 基礎運維常見工作內容有哪些?運維
- Git暫存區內容恢復到工作區Git