Oracle 檢查當前資料庫CPU和PSU補丁資訊

瘦瘦的猴子發表於2024-05-06

方法一:登入資料庫,檢查DBA_REGISTRY_HIST檢視

select *from dba_registry_history;

        ACTION_TIME       ACTION     NAMESPACE     VERSION       ID  BUNDLE_SERIES      COMMENTS
        --------------------- ------------------------------ ---------- ---------- ---------- ---------------
        2013-08-24 12:03:45.119862     APPLY       SERVER         11.2.0.4      0 PSU   Patchset 11.2.0.2.0
        2015-07-24 17:37:04.622489     APPLY       SERVER         11.2.0.4      0 PSU   Patchset 11.2.0.2.0

方法二:透過opatch lsinventory方式

$ORACLE_HOME/OPatch/opatch lsinventory -all

檢視opatch版本資訊

$ORACLE_HOME/OPatch/opatch version

        OPatch Version: 11.2.0.3.4
        OPatch succeeded.

更新dba_registry_history檢視為最新PSU資訊

SQL> startup 
SQL> !lsnrctl start 
SQL> alter system register; 

升級資料庫資料字典

SQL> @?/rdbms/admin/catbundle.sql psu apply

編譯無效物件的指令碼

SQL>@?/rdbms/admin/utlrp.sql

檢視更新後的檢視資訊

set line 150
col ACTION_TIME for a30
col ACTION for a8
col NAMESPACE for a8
col VERSION for a10
col BUNDLE_SERIES for a5
col COMMENTS for a20
select * from dba_registry_history;
    ACTION_TIME                    ACTION NAMESPACE  VERSION            ID BUNDLE_SERIES   COMMENTS
    ------------------------------ ------ ---------- ---------- ---------- --------------- -------------------------
    2013-08-24 12:03:45.119862     APPLY  SERVER     11.2.0.4            0 PSU             Patchset 11.2.0.2.0
    2015-07-24 17:37:04.622489     APPLY  SERVER     11.2.0.4            0 PSU             Patchset 11.2.0.2.0
    2015-07-24 20:52:13.592073     APPLY  SERVER     11.2.0.4            5 PSU             PSU 11.2.0.4.5
select action,comments from registry$history;
    ACTION COMMENTS
    ------ -------------------------
    APPLY  Patchset 11.2.0.2.0
    APPLY  Patchset 11.2.0.2.0
    APPLY  PSU 11.2.0.4.5     #顯示安裝成功,補丁成功從11.2.0.2.0版本升級到補丁11.2.0.4.5

檢視無效物件
    SYS@orcl>select count(*) from dba_objects where status<>'VALID';  #為零表示正常
轉載自:oracle11 打補丁方法 - vmsysjack - 部落格園 (cnblogs.com)

相關文章