RAC資料庫中用opatch應用補丁

jqs發表於2008-04-16
在RAC資料庫中用opatch應該補丁,可以一個一個節點進行;如果條件容許,可以多個節點一起進行,在Oracle10.2.0.3.4開始還可以一次應用多個補丁。
[@more@]
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
停止應用應用補丁
stop service -d mdzj
stop instance -d mdzj -i mdzj1,mdzj2
stop nodeapps -n zj1
stop nodeapps -n zj2
-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
>

/soft/patch/5471564
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
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.
>
ok,應用成功
檢視補丁有沒有應用到系統:
lsinventory|grep 5471564
Patch 5471564 : applied on Wed Apr 16 14:09:43 GMT+08:00 2008
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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章