oracle smon與pmon ckpt功能的作用(ZT)

paulyibinyi發表於2008-06-05
SMON是Oracle資料庫至關重要的一個後臺程式,SMON 是System Monitor 的縮寫,意即:系統監控。

  在資料庫啟動過程中,SMON排在CKPT程式之後,在Oracle9i中排在第六號的位置:

  PMON started with pid=2

  DBW0 started with pid=3

  LGWR started with pid=4

  CKPT started with pid=5

  SMON started with pid=6

  RECO started with pid=7

  SMON負責系統監視已經一些系統清理及恢復工作,這些工作主要包括:

  1.清理臨時空間以及臨時段

  SMON負責在資料庫啟動時清理臨時表空間中的臨時段,或者一些異常操作過程遺留下來的臨時段,例如,當建立索引過程中,建立期間分配給索引的 Segment被標誌為TEMPORARY,如果Create Index (或rebuild Index等)會話因某些原因異常中斷,SMON負責清理這些臨時段。

  2.接合空閒空間

  在DMT(字典管理表空間)中,SMON負責把那些在表空間中空閒的並且互相是鄰近的Extent接合成一個較大的空閒擴充套件區,這需要表空間的pctincrease設定為非零值。

  3.執行例項恢復(Instance recovery)

  在例項恢復過程中,SMON的工作包括三個環節:應用Redo執行前滾、開啟資料庫提供訪問、回滾未提交資料

  Tue Apr 22 21:31:10

  SMON: enabling cache recovery

  Tue Apr 22 21:31:10

  ARC0: Completed archiving log 1 thread 1 sequence 238

  Tue Apr 22 21:31:11

  Undo Segment 1 Onlined

  Undo Segment 2 Onlined

  Undo Segment 3 Onlined

  Undo Segment 4 Onlined

  Undo Segment 5 Onlined

  Undo Segment 6 Onlined

  Undo Segment 7 Onlined

  Undo Segment 8 Onlined

  Undo Segment 9 Onlined

  Undo Segment 10 Onlined

  Successfully onlined Undo Tablespace 1.

  Tue Apr 22 21:31:11

  SMON: enabling tx recovery

  Tue Apr 22 21:31:11

  Database Characterset is ZHS16GBK

  replication_dependency_tracking turned off (no async multimaster replication found)

  Completed: ALTER DATABASE OPEN

  4.離線(Offline)回滾段

  在自動回滾段管理(AUM)中負責Offline不再需要的回滾段,日誌中會記錄類似如下資訊:

  Fri May 2 15:43:21

  SMON offlining US=11

  SMON offlining US=12

  SMON offlining US=13

  SMON offlining US=14

  SMON offlining US=15

  SMON offlining US=16

  SMON offlining US=17

  SMON offlining US=18

  SMON offlining US=19

  SMON offlining US=20

  SMON offlining US=21

  SMON offlining US=22

  SMON offlining US=23

  5.執行並行恢復

  以下資訊來自9i日誌:

  Fri May 11 21:30:45

  SMON: Parallel transaction recovery tried

  Also Recordsome English Note About SMON:

  The SMON background process performs all monitoring functions on the database. The SMON process performs a "warm start" each time that is re-started, ensuring that any in-flight transaction at the time of the last shutdown are recovered. For example, if crashed hard with a power failure, the SMON process is attached at startup time, and detects any uncompleted work, using the rollback segments to recover the transactions. In addition,SMON performs periodic cleanup of temporary segments that are no longer needed, and also perform. tablespace operations, coalescing contiguous free extents into larger extents.

 

PROCESS MONITOR (PMON) 程式監控程式

主要用於回滾異常終止的或被使用者強制終止的事務.

<1>.rolling back the transaction.

<2>.releasing locks.釋放鎖.

<3>.releasing other resources.

<4>.restarts dead dispatchers.重啟死掉的排程器.(在共享伺服器中用).

PMON (:Include in SGA)-----------------------&gtPGA

 

 

CHECKPOINT (CKPT) 檢查點程式

用來在資料庫裡實現同步,實現之前會強制將髒資料從內在裡寫到物理檔案裡.

<1>.會啟動DBWn來寫髒資料(SIGNALLING DBWn at CKPT.)

<2>.完後會更新DATAFILE的HEADER和控制檔案的HEADER.而HEADER中有同步所需要的資訊,即

CHECKPOINT的資訊.

<3>.在ORACLE中,正常情況下,所有檔案必須同期性地同步;靠CHECKPOINT來完成.

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-332381/,如需轉載,請註明出處,否則將追究法律責任。

相關文章