如何使用opatch给oracle打补丁
时间:2010-10-13 来源:lxl0121
1、下载
需要metalink的用户名口令
10.2及之后的数据库下载连接为:
http://updates.oracle.com/download/4898608.html
10.2之前的版本下载连接为:
http://updates.oracle.com/download/2617419.html
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
$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 : Central Inventory : FROM : /etc/oraInst.loc OPatch version : 10.2.0.3.0 OUI version : 10.2.0.3.0 OUI location : LOG file location :/cfgtoollogs/opatch/opatch2009-03-17_22-28-39PM.LOG Lsinventory Output file location : /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后面有哪些选项:
$ 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 <value> ] [-detail ] [-all_nodes] [-invPtrLoc <Path TO oraInst.loc> ] [-jre <LOC> ] [-oh <ORACLE_HOME> ] [-retry <value> ] [-patch] [-oh] [-property_file <path TO 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.
相关阅读 更多 +