在Oracle数据库中,我们如何检查当前数据库的CPU和PSU补丁安装情况呢?本文我们主要就介绍这部分内容,希望能够对您有所帮助。
正常情况下有两种方法:
一种是登录数据库检查DBA_REGISTRY_HIST视图:
MODDB2:[/home/oracle]$sqlplus/assysdba SQL*Plus:Release10.2.0.4.0-ProductiononThuAug1813:04:432011 Copyright(c)1982,2007,Oracle.AllRightsReserved. Connectedto: OracleDatabase10gEnterpriseEditionRelease10.2.0.4.0-64bitProduction WiththePartitioning,RealApplicationClusters,OracleLabelSecurity,DataMining andRealApplicationTestingoptions SQL>setpages100lines120 SQL>colactionformata6 SQL>colnamespaceformata10 SQL>colversionformata10 SQL>colcommentsformata15 SQL>colaction_timeformata30 SQL>colbundle_seriesformata15 SQL>altersessionsetnls_timestamp_format='yyyy-mm-ddhh24:mi:ss.ff'; Sessionaltered. SQL>select*fromdba_registry_history; ACTION_TIMEACTIONNAMESPACEVERSIONIDBUNDLE_SERIESCOMMENTS -------------------------------------------------------------------------------------- 2011-06-0216:54:21.301023APPLYSERVER10.2.0.44PSUPSU10.2.0.4.4 2011-06-0216:54:42.711877APPLYSERVER10.2.0.41OPSUPSU10.2.0.4.5
另一种方式是通过opatch lsinventory方式:
MODDB2:[/home/oracle]$opatchlsinventory InvokingOPatch10.2.0.5.0 OracleInterimPatchInstallerversion10.2.0.5.0 Copyright(c)2010,OracleCorporation.Allrightsreserved. OracleHome:/oracle/db CentralInventory:/oracle/oraInventory from:/var/opt/oracle/oraInst.loc OPatchversion:10.2.0.5.0 OUIversion:10.2.0.4.0 OUIlocation:/oracle/db/oui Logfilelocation:/oracle/db/cfgtoollogs/opatch/opatch2011-08-18_11-18-30AM.log Patchhistoryfile:/oracle/db/cfgtoollogs/opatch/opatch_history.txt LsinventoryOutputfilelocation:/oracle/db/cfgtoollogs/opatch/lsinv/lsinventory2011-08-18_11-18-30AM.txt -------------------------------------------------------------------------------- InstalledTop-levelProducts(2): OracleDatabase10g10.2.0.1.0 OracleDatabase10gRelease2PatchSet310.2.0.4.0 Thereare2productsinstalledinthisOracleHome. Interimpatches(4): Patch6367097:appliedonTueSep1422:08:15GMT+08:002010 Createdon20Jul2008,23:37:14hrsUS/Pacific Bugsfixed: 6367097 ...... Bugsfixed: 9294403 OPatchsucceeded.
注意:CPU和PSU补丁分为两部分,首先通过opatch命令,随后还需要运行cat_bundle.sql。如果没有运行这个SQL,则补丁不算安装成功,这时通过OPATCH命令检查可以看到补丁的安装信息,但是在数据库的DBA_REGISTRY_HISTORY中是找不到对应的信息的。
相关文章
标签:Oracle