在Oracle數據庫中,我們如何檢查當前數據庫的CPU和PSU補丁安裝情況呢?本文我們主要就介紹這部分內容,希望能夠對您有所幫助。
正常情況下有兩種方法:
一種是登錄數據庫檢查DBA_REGISTRY_HIST視圖:
- MODDB2:[/home/Oracle]$sqlplus / as sysdba
- SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 18 13:04:43 2011
- Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
- Connected to:
- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
- With the Partitioning, Real Application Clusters, Oracle Label Security, Data Mining
- and Real Application Testing options
- SQL> set pages 100 lines 120
- SQL> col action format a6
- SQL> col namespace format a10
- SQL> col version format a10
- SQL> col comments format a15
- SQL> col action_time format a30
- SQL> col bundle_serIEs format a15
- SQL> alter session set nls_timestamp_format = 'yyyy-mm-dd hh24:mi:ss.ff';
- Session altered.
- SQL> select * from dba_registry_history;
- ACTION_TIME ACTION NAMESPACE VERSION ID BUNDLE_SERIES COMMENTS
- --------------------------- ------ ---------- -------------- -------------- ---------------
- 2011-06-02 16:54:21.301023 APPLY SERVER 10.2.0.4 4 PSU PSU 10.2.0.4.4
- 2011-06-02 16:54:42.711877 APPLY SERVER 10.2.0.4 1 OPSU PSU 10.2.0.4.5
另一種方式是通過opatch lsinventory方式:
- MODDB2:[/home/Oracle]$opatch lsinventory
- Invoking OPatch 10.2.0.5.0
- Oracle Interim Patch Installer version 10.2.0.5.0
- Copyright (c) 2010, Oracle Corporation. All rights reserved.
- Oracle Home : /Oracle/db
- Central Inventory : /Oracle/oraInventory
- from : /var/opt/Oracle/oraInst.loc
- OPatch version : 10.2.0.5.0
- OUI version : 10.2.0.4.0
- OUI location : /Oracle/db/oui
- Log file location : /Oracle/db/cfgtoollogs/opatch/opatch2011-08-18_11-18-30AM.log
- Patch history file: /Oracle/db/cfgtoollogs/opatch/opatch_history.txt
- Lsinventory Output file location : /Oracle/db/cfgtoollogs/opatch/lsinv/lsinventory2011-08-18_11-18-30AM.txt
- --------------------------------------------------------------------------------
- Installed Top-level Products (2):
- Oracle Database 10g 10.2.0.1.0
- Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
- There are 2 products installed in this Oracle Home.
- Interim patches (4) :
- Patch 6367097 : applIEd on Tue Sep 14 22:08:15 GMT+08:00 2010
- Created on 20 Jul 2008, 23:37:14 hrs US/Pacific
- Bugs fixed:
- 6367097
- ......
- Bugs fixed:
- 9294403
- OPatch succeeded.
注意:CPU和PSU補丁分為兩部分,首先通過opatch命令,隨後還需要運行cat_bundle.sql。如果沒有運行這個SQL,則補丁不算安裝成功,這時通過OPATCH命令檢查可以看到補丁的安裝信息,但是在數據庫的DBA_REGISTRY_HISTORY中是找不到對應的信息的。
以上就是Oracle數據庫中檢查當前數據庫CPU和PSU補丁信息的兩種方法,本文就介紹到這裡了,希望本次的介紹能夠對您有所收獲!