首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 數據庫知識 >  >> Oracle 資料庫 >> Oracle 資料庫基礎

Oracle 體系結構核心觀念:Instance 與 Database 的關係、SGA、PGA、背景程序完整圖解

     編輯:Oracle 資料庫基礎

Oracle Server = Instance + Database

  • Instance = SGA (共享記憶體) + Background Processes (背景程序)
  • Database = 實體檔案 (Datafiles, Controlfiles, Redo Logs, Parameter Files, Password File)

記憶體結構

SGA = Database Buffer Cache + Redo Log Buffer + Shared Pool + Large Pool + Java Pool + Streams Pool
PGA = Sort Area + Hash Area + Session Info + Stack (每 Process 私有)

SGA 核心元件功能

背景程序 (必備)

元件功能關鍵參數
Database Buffer Cache快取資料塊映像,減少實體 I/ODB_CACHE_SIZE
Redo Log Buffer循序記錄變更向量,LGWR 寫入線上 Redo LogLOG_BUFFER
Shared PoolLibrary Cache (Shared SQL/PLSQL) + Data Dictionary CacheSHARED_POOL_SIZE
Large Pool大型作業緩衝 (平行查詢、RMAN、MTS UGA)LARGE_POOL_SIZE
Java PoolJava 程式碼/資料緩衝JAVA_POOL_SIZE
Streams PoolStreams 複寫/擷取/應用STREAMS_POOL_SIZE
程序職責
DBWn將髒塊從 Buffer Cache 寫入資料檔
LGWR將 Redo Log Buffer 寫入線上 Redo Log 檔
CKPT更新資料檔/控制檔檢查點資訊,觸發 DBWn
SMONInstance Recovery、臨時段清理、空間合併
PMON清理失敗 Process 遺留資源 (鎖、Session、Rollback)

可選背景程序

  • ARCn:歸檔程序 (歸檔模式必備)
  • RECO:分散式交易恢復
  • Snnn / Pnnn:Shared Server / Dispatcher

Process 架構差異

  • Unix/Linux:每個背景程序對應一個 OS Process (專用伺服器模式)。
  • Windows:單一 ORACLE.EXE Process,背景程序以 Thread 形式運行。

連線流程

User Process → Listener → Server Process (Dedicated/Shared) → SGA/Background Processes ↔ Database Files

Server Process 負責與 User Process 交換資料、解析執行 SQL、管理 PGA。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved