RAC数据库中用opatch应用补丁

在RAC数据库中用opatch应该补丁,可以一个一个节点进行;如果条件容许,可以多个节点一起进行,在Oracle10.2.0.3.4开始还可以一次应用多个补丁。
[@more@]
opatch">zj1@oracle>opatch apply -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
This operation applies an interim patch to an ORACLE_HOME from
the current directory. The patch location can specified using
the parameter patch_location.
SYNTAX
opatch apply [-delay ] [ -force ]
[-invPtrLoc ] [-jdk ]
[-jre ] [-local ] [-minimize_downtime ]
[-no_bug_superset ] [-no_inventory ]
[-oh ] [-retry ] [-silent ]
[-verbose ] [-no_relink] [-pre pre script in escaped double quotes> [-opatch_pre_end] ]
[-post quotes> [-opatch_post_end] ] [-no_sysmod]
[-property_file ]
[-local_node ]
[-remote_nodes ]
[]
OPTIONS
-all_nodes
Apply the patch using all-node mode.
......
-local_node
This option can be used to specify to OPatch the local
node name to be used for RAC mode application of the patch
-remote_nodes
This option can be used to specify to OPatch the list
of remote nodes to be used for RAC mode application of
the patch. The node names are comma separated and
without spaces
停止应用应用补丁
srvctl">zj1@oracle>srvctl stop service -d mdzj
srvctl">zj1@oracle>srvctl stop instance -d mdzj -i mdzj1,mdzj2
srvctl">zj1@oracle>srvctl stop nodeapps -n zj1
srvctl">zj1@oracle>srvctl stop nodeapps -n zj2
crs_stat">zj1@oracle>crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.mdzj.db application OFFLINE OFFLINE
ora....j1.inst application OFFLINE OFFLINE
ora....j2.inst application OFFLINE OFFLINE
ora.....zj1.cs application OFFLINE OFFLINE
ora....zj1.srv application OFFLINE OFFLINE
ora....zj2.srv application OFFLINE OFFLINE
ora.....zj2.cs application OFFLINE OFFLINE
ora....zj1.srv application OFFLINE OFFLINE
ora....zj2.srv application OFFLINE OFFLINE
ora.....zj3.cs application OFFLINE OFFLINE
ora....zj1.srv application OFFLINE OFFLINE
ora....zj2.srv application OFFLINE OFFLINE
ora....J1.lsnr application OFFLINE OFFLINE
ora.zj1.gsd application OFFLINE OFFLINE
ora.zj1.ons application OFFLINE OFFLINE
ora.zj1.vip application OFFLINE OFFLINE
ora....J2.lsnr application OFFLINE OFFLINE
ora.zj2.gsd application OFFLINE OFFLINE
ora.zj2.ons application OFFLINE OFFLINE
ora.zj2.vip application OFFLINE OFFLINE
zj1@oracle>
pwd">zj1@oracle>pwd
/soft/patch/5471564
opatch">zj1@oracle>opatch apply -all_nodes
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
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/oui
Log file location : /u01/app/oracle/product/10.2.0/db/cfgtoollogs/opatch/opatch2008-04-16_14-06-39PM.log
ApplySession applying interim patch '5471564' to OH '/u01/app/oracle/product/10.2.0/db'
Invoking fuser to check for active processes.
Invoking fuser on "/u01/app/oracle/product/10.2.0/db/lib/libjox10.a"
OPatch detected the node list and the local node from the inventory. OPatch will patch the local system then propagate the patch to the remote nodes.

This node is part of an Oracle Real Application Cluster.
Remote nodes: 'zj2'
Local node: 'zj1'
Please shut down Oracle instances running out of this ORACLE_HOME on all the nodes.
(Oracle Home = '/u01/app/oracle/product/10.2.0/db')
Are all the nodes ready for patching?
Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '5471564' for restore. This might take a while...
Backing up files affected by the patch '5471564' for rollback. This might take a while...
Patching component oracle.javavm.server, 10.2.0.3.0...
Copying file to "/u01/app/oracle/product/10.2.0/db/lib/libjox10.a"
The following actions have failed:
Copy failed from '/soft/patch/5471564/files/lib/libjox10.a' to '/u01/app/oracle/product/10.2.0/db/lib/libjox10.a'...

Do you want to proceed? [y|n]
y
User Responded with: Y
ApplySession adding interim patch '5471564' to inventory
Verifying the update...
Inventory check OK: Patch ID 5471564 is registered in Oracle Home inventory with proper meta-data.
Copy failed: failed to update "/u01/app/oracle/product/10.2.0/db/lib/libjox10.a" with updated "/soft/patch/5471564/files/lib/libjox10.a"
ApplySession failed: ApplySession failed in system modification phase... 'Verification of patch failed: null'
OPatch will attempt to restore the system...
Restoring the Oracle Home...
Checking if OPatch needs to invoke 'make' to restore some binaries...
OPatch was able to restore your system. Look at log file and timestamp of each file to make sure your system is in the state prior to applying the patch.
--------------------------------------------------------------------------------
The following warnings have occurred during OPatch execution:
1) OUI-67124:Copy failed from '/soft/patch/5471564/files/lib/libjox10.a' to '/u01/app/oracle/product/10.2.0/db/lib/libjox10.a'...
--------------------------------------------------------------------------------
OPatch failed with error code 73
在两个节点上运行/usr/sbin/slibclean
从内存中清除一些当前不用的modules
后重新应用patch
opatch">zj1@oracle>opatch apply -all_nodes
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
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/oui
Log file location : /u01/app/oracle/product/10.2.0/db/cfgtoollogs/opatch/opatch2008-04-16_14-09-23PM.log
ApplySession applying interim patch '5471564' to OH '/u01/app/oracle/product/10.2.0/db'
Invoking fuser to check for active processes.
Invoking fuser on "/u01/app/oracle/product/10.2.0/db/lib/libjox10.a"
OPatch detected the node list and the local node from the inventory. OPatch will patch the local system then propagate the patch to the remote nodes.

This node is part of an Oracle Real Application Cluster.
Remote nodes: 'zj2'
Local node: 'zj1'
Please shut down Oracle instances running out of this ORACLE_HOME on all the nodes.
(Oracle Home = '/u01/app/oracle/product/10.2.0/db')
Are all the nodes ready for patching?
Do you want to proceed? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '5471564' for restore. This might take a while...
Backing up files affected by the patch '5471564' for rollback. This might take a while...
Patching component oracle.javavm.server, 10.2.0.3.0...
Copying file to "/u01/app/oracle/product/10.2.0/db/lib/libjox10.a"
ApplySession adding interim patch '5471564' to inventory
Verifying the update...
Inventory check OK: Patch ID 5471564 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 5471564 are present in Oracle Home.
Patching in all-node mode.
Updating nodes 'zj2'
Apply-related files are:
FP = "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/copy_files.txt"
DP = "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/copy_dirs.txt"
MP = "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/make_cmds.txt"
Instantiating the file "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/10.2.0/db/.patch_storage/5471564_Jan_21_2008_04_46_49/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
All nodes have been patched. You may start Oracle instances on the local system and nodes 'zj2'

OPatch succeeded.
zj1@oracle>
ok,应用成功
查看补丁有没有应用到系统:
opatch">zj1@oracle>opatch lsinventory|grep 5471564
Patch 5471564 : applied on Wed Apr 16 14:09:43 GMT+08:00 2008
opatch">zj2@oracle>opatch lsinventory|grep 5471564
Patch 5471564 : applied on Wed Apr 16 14:09:43 GMT+08:00 2008

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

转载于:http://blog.itpub.net/15385/viewspace-1002614/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值