check database patch with opatch tools

  
    当给数据库打完patch以后,如何查询是否打patch成功?
    或者,刚刚接到一个数据库服务器,如何查询这个数据库服务器都曾经打过哪些patch?

1. 下载并安装opatch工具
   下载:p6880880_102000_LINUX.zip
   解压:unzip p6880880_102000_LINUX.zip OPatch
   更新环境变量: vi .bash_profile 追加PATH参数
                  export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/home/oracle/OPatch
                 
2.opatch的命令
  a.查询opatch的用法
    [oracle@rac1 ~]$ opatch
    /home/oracle/OPatch/opatch: line 55: [: =: unary operator expected
    Invoking OPatch 10.2.0.4.7     
    Oracle Interim Patch Installer version 10.2.0.4.7
    Copyright (c) 2009, Oracle Corporation.  All rights reserved.     
    Syntax Error... No command specified.     
     Usage: opatch [ -help ] [ -r[eport] ] [ command ]     
                command := auto
                           apply
                           lsinventory
                           napply
                           nrollback
                           rollback
                           query
                           version
                           prereq
                           util     
     := -help       Displays the help message for the command.
                           -report     Print the actions without executing.     
     example:
       'opatch -help'
       'opatch auto -help'
       'opatch apply -help'
       'opatch lsinventory -help'
       'opatch napply -help'
       'opatch nrollback -help'
       'opatch rollback -help'
       'opatch prereq -help'
       'opatch util -help'
    OPatch failed with error code 14

  b.list数据库patch
    [oracle@rac1 ~]$ opatch lsinventory
    Invoking OPatch 10.2.0.4.7     
    Oracle Interim Patch Installer version 10.2.0.4.7
    Copyright (c) 2009, Oracle Corporation.  All rights reserved.     
    Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
    Central Inventory : /u01/app/oracle/oraInventory
       from           : /etc/oraInst.loc
    OPatch version    : 10.2.0.4.7
    OUI version       : 10.2.0.4.0
    OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
    Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2009-07-20_17-48-38PM.log     
    Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt     
    Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2009-07-20_17-48-38PM.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.     
    There are no Interim patches installed in this Oracle Home.     
    Rac system comprising of multiple nodes
      Local node = rac1
      Remote node = rac2     
    --------------------------------------------------------------------------------     
    OPatch succeeded.

3. 也可以通过sql语句来查询
Run the following command to check the status of all the components after the upgrade:

SQL> select comp_name, version, status from sys.dba_registry;
 
COMP_NAME                      VERSION                        STATUS
------------------------------ ------------------------------ ----------------------
Oracle Enterprise Manager      10.2.0.4.0                     VALID
Spatial                        10.2.0.4.0                     VALID
Oracle interMedia              10.2.0.4.0                     VALID
OLAP Catalog                   10.2.0.4.0                     VALID
Oracle XML Database            10.2.0.4.0                     VALID
Oracle Text                    10.2.0.4.0                     VALID
Oracle Expression Filter       10.2.0.4.0                     VALID
Oracle Rules Manager           10.2.0.4.0                     VALID
Oracle Workspace Manager       10.2.0.4.3                     VALID
Oracle Data Mining             10.2.0.4.0                     VALID
Oracle Database Catalog Views  10.2.0.4.0                     VALID
 
COMP_NAME                      VERSION                        STATUS
------------------------------ ------------------------------ ----------------------
Oracle Database Packages and T 10.2.0.4.0                     VALID
ypes
 
JServer JAVA Virtual Machine   10.2.0.4.0                     VALID
Oracle XDK                     10.2.0.4.0                     VALID
Oracle Database Java Packages  10.2.0.4.0                     VALID
OLAP Analytic Workspace        10.2.0.4.0                     VALID
Oracle OLAP API                10.2.0.4.0                     VALID
Oracle Real Application Cluste 10.2.0.4.0                     VALID

In the output of the preceding command, the status of all the components should be VALID for a successful upgrade


参考文献:

1.  Subject:  Opatch - Where Can I Find the Latest Version of Opatch?
    Doc ID:  224346.1 Type:  BULLETIN
    Modified Date :  28-MAY-2009 Status:  PUBLISHED
   
2.  http://www.eygle.com/internal/Use.Opatch.apply.Interim.Patch.htm

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9252210/viewspace-609748/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9252210/viewspace-609748/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值