如何使用opatch给oracle打补丁

1340阅读 0评论2013-08-12 wuxiaobo_2009
分类:LINUX

1、下载
需要metalink的用户名口令
10.2及之后的数据库下载连接为:
10.2之前的版本下载连接为:
2、安装可以参照metalink Note 189489.1
安装其实很简单,unix下做一下unzip,然后把opath加到你的$PATH即可
3、opatch作用
opatch是用于维护"个别"补丁的,有人称其为interim path或是one-off patch
以解决TA ENQ AND US ENQ DEADLOCK DURING TRANSACTION RECOVERY IN RAC问题的interim patch 3777178为例,
安装及rollback的命令如下:
install:
oracle>unzip p3777178_9206_HP64.zip
oracle>cd 3777178
oracle>opatch apply
rollback:
oracle>cd 3777178
oracle>opatch rollback -id 3777178
查看:
如下命令可以看到已经安装了哪些interim patch
[oracle@mysql2 ~]$ /u01/app/oracle/product/10.2.0/db_2/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.3.0
Oracle interim Patch Installer version 10.2.0.3.0
Copyright (c) 2005, Oracle Corporation.  All rights reserved..

Oracle Home       : /u01/app/oracle/product/10.2.0/db_2
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.3.0
OUI version       : 10.2.0.3.0
OUI location      : /u01/app/oracle/product/10.2.0/db_2/oui
Log file location : /u01/app/oracle/product/10.2.0/db_2/cfgtoollogs/opatch/opatch2009-03-17_22-28-39PM.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_2/cfgtoollogs/opatch/lsinv/lsinventory2009-03-17_22-28-39PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 2                            10.2.0.3.0
There are 2 products installed in this Oracle Home.

Interim patches (3) :
Patch  5965763      : applied on Tue Mar 17 15:28:47 CST 2009
   Created on 22 Aug 2007, 02:32:03 hrs PST8PDT
   Bugs fixed:
     5935527, 5733637, 5855301, 5738652, 5489166, 5898868, 5610906, 3197358
     5965763, 5601756, 5853383
Patch  5556081      : applied on Thu Jul 17 17:43:15 CST 2008
   Created on 9 Nov 2006, 22:20:50 hrs PST8PDT
   Bugs fixed:
     5556081
Patch  5557962      : applied on Thu Jul 17 17:43:04 CST 2008
   Created on 9 Nov 2006, 23:23:06 hrs PST8PDT
   Bugs fixed:
     4269423, 5557962, 5528974

--------------------------------------------------------------------------------
 

4、不断的在opatch后面加-h可以看到这个命令更加详细的选项:
看一下lsinventory后面有哪些选项:
[oracle@mysql2 ~]$ /u01/app/oracle/product/10.2.0/db_2/OPatch/opatch lsinventory -h
Invoking OPatch 10.2.0.3.0
Oracle interim Patch Installer version 10.2.0.3.0
Copyright (c) 2005, Oracle Corporation.  All rights reserved..

DESCRIPTION
    List the inventory for a particular $ORACLE_HOME or display all
    installations that can be found.
SYNTAX
opatch lsinventory [-all ] [-delay ] [-detail ] [-all_nodes]
               [-invPtrLoc ] [-jre ]
               [-oh ] [-retry ] [-patch] [-oh]
               [-property_file ]
OPTIONS
       -all
              Report the name and installation directory for each
              $ORACLE_HOME found.
       -delay
              If -retry is specified, this option tells OPatch how
              many seconds it should wait before attempting to lock
              inventory again in case of a previous failure.
       -detail(s)
              Report installed products and other details. This
              option cannot be used in conjunction with all option.
       -invPtrLoc
              Used to locate the oraInst.loc file. When the
              installation used the invPtrLoc flag. This should be
              the path to the oraInst.loc file
       -jre
              This option tells OPatch to use JRE (java) from the
              specified location instead of the default location
              under Oracle Home
       -retry
              This option tells OPatch how many times it should
              retry in case of an inventory lock failure
       -patch
              Lists the patch IDs installed in the oracle home
       -oh
              The oracle home to work on. This takes precedence over
              the environment variable ORACLE_HOME
       -property_file
              The user defined property file for OPatch to use. The
              path to the property file should be absolute. This
              property file takes precedence over the one that is
              supplied with OPatch
       -all_nodes
       Reports the patches installed on the given Oracle Home
              in all nodes of the RAC system. It also prints the oracle
              binary's size and checksum on all nodes. This option cannot
              be used in conjunction with -all, -detail, -patch.          
PARAMETERS
       This operation does not have any required parameters.
上一篇:ORACLE_DBA TABLESPACE 笔记
下一篇:oracle 服务器端字符集变更