RDA (Remote Diagnostic Agent) 是 Oracle 官方提供的輕量級診斷蒐集工具,能一次性採集作業系統、資料庫、中介層、叢集等全棧配置與效能數據,且不修改任何系統參數。Oracle Support 強烈建議開 SR 時附上 RDA 報告,可大幅縮短問題診斷週期。本文涵蓋支援矩陣、安裝細節、採集流程、報告解讀重點與常見坑點。
| 類別 | 支援範圍 |
|---|---|
| 作業系統 | IBM AIX、Intel Linux (RHEL/SUSE)、HP-UX 10/11、HP Tru64、Sun Solaris 2.6-10、Windows XP/2000/2003 |
| Oracle 產品 | RDBMS (SE/EE)、RAC (單節點採集)、OAS/iAS、OMS/Grid Control/DB Control、OLAP、Developer、Collaboration Suite、Networking |
rda.tar.gz(約 10-20MB)。gunzip rda.tar.gz
tar xvf rda.tar
cd rda && ./rda.sh -c(僅檢查環境,不採集)。$ ./rda.sh -S
依提示輸入:
/ as sysdba 模式):
Enter an Oracle User ID (userid only) to view DBA_ and V$ tables If RDA will be run under the Oracle software owner's ID, enter a '/' here, and select Y at the SYSDBA prompt to avoid being prompted for the database password at runtime. Hit 'Return' to accept the default (system): / Is '/' a sysdba user (will connect as sysdba) (Y/N)? Y
完成後生成 setup.cfg、setup.bak,後續可直接編輯檔案調整參數,無需重跑向導。
# 標準採集(背景執行建議加 nohup)
$ ./rda.sh
# 詳細模式(即時顯示進度,便於排查卡住)
$ ./rda.sh -v
過程中可能提示輸入:SYS/SYSMAN/其他帳號密碼(若未在配置中預存)。
./output/RDA_<hostname>.zip./output/RDA_<hostname>.log$ rm ./output/RDA_*.zip
$ ./rda.sh -Svf # 重新互動配置
$ ./rda.sh -v # 重新採集
解壓縮 ZIP,用瀏覽器開啟 <report_group>__start.htm。
| 報告區塊 | 關鍵關注點 | 異常徵兆 |
|---|---|---|
| Database SPFile Parameters | 初始化參數完整清單 | 非預設值、隱含參數、與最佳實踐偏離 |
| SGA Information | SGA 元件大小、動態調整歷程 | 共用池碎片化、大池不足、記憶體標靶未達標 |
| Sessions and Processes | 採集時刻會話分布、限制使用率 | 逼近 PROCESSES/SESSIONS 上限、長鎖定會話 |
| V$System_Event | 實例級等待事件累計 | Top 5:log file sync、db file scattered/sequential read、enqueue、latch free、free buffer waits |
| V$Session_Wait | 即時會話等待快照 | 大量會話同一事件等待(熱塊、熱索引) |
| Latch Information | Latch 爭用統計 | Cache buffers chains、Library cache、Shared pool latch 高睡眠/等待 |
| Tablespaces | 表空間類型、使用率、自動擴展、檔案分布 | 使用率 >85%、不可擴展、臨時表空間爆滿 |
| Database Files | 資料檔路徑、大小、使用率、線上/離線 | 檔案系統層面空間不足、ASM 磁碟群組不平衡 |
| Invalid Objects | 失效物件清單 | 任何 INVALID 物件需立即編譯/排查 |
| All Errors | 近期資料庫錯誤彙總 | ORA-600/7445、ORA-1555、ORA-12541 等 |
| 事件 | 典型原因 | 對策方向 |
|---|---|---|
| log file sync | LGWR 寫入慢、Commit 頻繁 | 重做日志檔放快速儲存、批次 Commit、檢查存儲延遲 |
| db file scattered read | 全表掃描、索引失效 | SQL 調優、建立/修復索引、統計資訊收集 |
| db file sequential read | 索引範圍掃描、單區塊讀取 | 熱索引/熱塊、考慮 Keep Pool、分區表 |
| enqueue | 鎖爭用 (TX/TM/UL 等) | 應用邏輯優化、縮短交易、分區/分表 |
| free buffer waits | DBWn 寫入跟不上 | 增加 DBWR_IO_SLAVES、優化檢查點、檢查儲存效能 |
| latch free | 共用池/緩衝區 Latch 爭用 | 綁定變數、增加共用池、減少硬解析 |
zip / gzip / WinRAR,或手動打包 output/* 目錄。DBA_SEGMENTS、DBA_EXTENTS 等大字典視圖。對策:確保統計資訊最新、考慮排除非必要模組(-X 參數)。SELECT_CATALOG_ROLE 或 SYSDBA。按 4.1 步驟配置 / as sysdba。RDA -cluster 選項(新版支援)。