【檢視】V$BGPROCESS與V$PROCESS間的區別與聯絡

secooler發表於2010-02-01
請看下面Oracle官方文件關於這兩個檢視的定義描述:
V$BGPROCESS
V$BGPROCESS displays information about the background processes.

V$PROCESS
This view contains information about the currently active processes. While the LATCHWAIT column indicates what latch a process is waiting for, the LATCHSPIN column indicates what latch a process is spinning on. On multi-processor machines, Oracle processes will spin on a latch before waiting on it.

透過下面的SQL語句的查詢結果,您可能會更加真切的瞭解其中的區別與聯絡。
1.單獨透過v$bgprocess是獲得當前系統中啟動的Oracle“後臺程式”資訊
若不加限制條件是列出所有可能的Oracle“後臺程式”。

sys@ora10g> select paddr, name from v$bgprocess where paddr<>'00';

PADDR            NAME
---------------- -----
0000000081656688 PMON
0000000081656E70 PSP0
0000000081657658 MMAN
0000000081657E40 DBW0
000000008165C568 ARC0
000000008165CD50 ARC1
000000008165D538 ARC2
0000000081658628 LGWR
0000000081658E10 CKPT
00000000816595F8 SMON
0000000081659DE0 RECO
000000008165A5C8 CJQ0
000000008165DD20 QMNC
000000008165ADB0 MMON
000000008165B598 MMNL

15 rows selected.

2.單獨透過v$process檢視,我們獲的是當前系統中所有程式資訊,包括“後臺程式”,也包括“伺服器程式”。
這個是概念性區別:“後臺程式”和“伺服器程式”(又分共享伺服器程式和專有伺服器程式)是由區別的哦。
sys@ora10g> select addr, program from v$process;

ADDR             PROGRAM
---------------- ------------------------
0000000081655EA0 PSEUDO
0000000081656688 oracle@testdb (PMON)
0000000081656E70 oracle@testdb (PSP0)
0000000081657658 oracle@testdb (MMAN)
0000000081657E40 oracle@testdb (DBW0)
0000000081658628 oracle@testdb (LGWR)
0000000081658E10 oracle@testdb (CKPT)
00000000816595F8 oracle@testdb (SMON)
0000000081659DE0 oracle@testdb (RECO)
000000008165A5C8 oracle@testdb (CJQ0)
000000008165ADB0 oracle@testdb (MMON)
000000008165B598 oracle@testdb (MMNL)
000000008165BD80 oracle@testdb (J000)
000000008165C568 oracle@testdb (ARC0)
000000008165CD50 oracle@testdb (ARC1)
000000008165D538 oracle@testdb (TNS V1-V3)
000000008165DD20 oracle@testdb (QMNC)
000000008165E508 oracleora10g@testdb
000000008165ECF0 oracle@testdb (q001)
000000008165FCC0 oracle@testdb (q000)

20 rows selected.

3.V$BGPROCESS與V$PROCESS二者的聯絡
這兩個檢視是透過v$bgprocess.paddr與v$process.addr關聯起來的,關聯後查詢結果顯而易見只會有Oracle“後臺程式”的資訊
sys@ora10g> select a.paddr, a.name, a.description from v$bgprocess a, v$process b where a.paddr=b.addr;

PADDR            NAME  DESCRIPTION
---------------- ----- -------------------------
0000000081656688 PMON  process cleanup
0000000081656E70 PSP0  process spawner 0
0000000081657658 MMAN  Memory Manager
0000000081657E40 DBW0  db writer process 0
0000000081658628 LGWR  Redo etc.
0000000081658E10 CKPT  checkpoint
00000000816595F8 SMON  System Monitor Process
0000000081659DE0 RECO  distributed recovery
000000008165A5C8 CJQ0  Job Queue Coordinator
000000008165ADB0 MMON  Manageability Monitor Process
000000008165B598 MMNL  Manageability Monitor Process 2
000000008165C568 ARC0  Archival Process 0
000000008165CD50 ARC1  Archival Process 1
000000008165D538 ARC2  Archival Process 2
000000008165DD20 QMNC  AQ Coordinator

15 rows selected.

4.小結
Oracle提供給我們很多寶貴的系統檢視,在充分理解其含義及內在的聯絡是深入研究的基礎。拋磚待玉來。

Good luck.

secooler
10.02.01

-- The End --

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

相關文章