快速確認 Oracle 資料庫版本、Patch 級別、作業系統平台是補丁規劃、相容性驗證、技術支援申請的基礎動作。本文提供 OS 層面 (`uname`) 與資料庫層面 (`sqlplus`、`v$version`、`product_component_version`) 完整指令集,並說明輸出欄位含義。
# Solaris / Linux / AIX / HP-UX 通用
$ uname -a
# 輸出範例:
SunOS billing 5.8 Generic_108528-23 sun4u sparc SUNW,Ultra-4
# 解讀:OS=SunOS 5.8 (Solaris 8), 架構=sparc, 機型=Ultra-4
$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Sun Nov 28 10:48:00 2004
...
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> SELECT * FROM v$version;
BANNER
----------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
關鍵欄位解讀:
Oracle9i Enterprise Edition Release 9.2.0.4.0:資料庫核心版本 (Major.Minor.PatchSet.PatchSetUpdate)。64bit Production:64 位元正式版。PL/SQL Release:PL/SQL 引擎版本 (通常同核心)。CORE:核心程式碼基準版本。TNS for Solaris:網路層版本 (平台相關)。NLSRTL:國際化運行時庫版本。
SQL> SELECT * FROM product_component_version;
PRODUCT VERSION STATUS
---------------------------------------- ----------- -----------
NLSRTL 9.2.0.4.0 Production
Oracle9i Enterprise Edition 9.2.0.4.0 64bit Production
PL/SQL 9.2.0.4.0 Production
TNS for Solaris 9.2.0.4.0 Production
...
SQL> SELECT banner FROM v$version WHERE rownum = 1;
| 格式 | 範例 | 含義 | ||
|---|---|---|---|---|
| Major.Minor.Maintenance.PatchSet | 19.3.0.0 | 19c Release 3 (19.3), 基準版 | ||
| Major.Minor.PatchSet.PSU | 19.12.0.0 | 19c Release 12 (19.12), 含 PSU | ||
| Major.Minor.PatchSet.BP | 19.18.0.0 | 19c Release 18, 含 Bundle Patch |
| 版本 | 發布年份 | Premier Support 結束 | Extended Support 結束 | 備註 |
|---|---|---|---|---|
| 11.2.0.4 | 2013 | 2020-01 | 2023-12 | 長壽版,大量存量系統仍在用 |
| 12.1.0.2 | 2014 | 2021-07 | 2024-07 | 多租戶架構引入 |
| 12.2.0.1 | 2017 | 2022-11 | 2025-11 | 最後非長期支援版 |
| 18c | 2018 | 2021-06 | 2024-06 | 年度發布模式起點 |
| 19c | 2019 | 2024-04 | 2027-04 | 長期支援版 (LTS),主流遷移目標 |
| 21c | 2021 | 2024-08 | 2027-08 | 創新版 |
| 23c | 2023 | 2026-08 | 2029-08 | 最新 LTS (Free/Developer 先行) |
熟練掌握 `uname -a`、`v$version`、`product_component_version` 三大查詢來源,能在最短時間內精準定位環境基線,為升級、補丁、遷移決策提供可靠依據。