可以使用Oracle自带的Opatch工具给数据库打过渡性补丁,打补丁集需要使用napply参数,这时10.2.0.3自带的Opatch没有这个选项,需要升级到高版本,直接解压并覆盖原来的Opatch目录就可以。
进入Opatch目录:
ERPDB1@/u01/db10g>cd OPatch
ERPDB1@/u01/db10g/OPatch>opatch -help
Invoking OPatch 10.2.0.4.7Oracle Interim Patch Installer version 10.2.0.4.7
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Usage: opatch [ -help ] [ -r[eport] ] [ command ]command := auto
apply
lsinventory
napply
nrollback
rollback
query
version
prereq
util<global_arguments> := -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 succeeded.
打p6602742号补丁,先解压:
ERPDB1@/u01/db10g/OPatch>unzip p6602742_10203_AIX64-5L.zip
Archive: p6602742_10203_AIX64-5L.zip
creating: 6602742/
creating: 6602742/files/
creating: 6602742/files/lib/
creating: 6602742/files/lib/libserver10.a/
inflating: 6602742/files/lib/libserver10.a/kks.o
inflating: 6602742/files/lib/libserver10.a/kks1.o
inflating: 6602742/files/lib/libserver10.a/opibnd.o
inflating: 6602742/files/lib/libserver10.a/kxfx.o
inflating: 6602742/files/lib/libserver10.a/kspt.o
creating: 6602742/etc/
creating: 6602742/etc/config/
inflating: 6602742/etc/config/inventory
inflating: 6602742/etc/config/actions
creating: 6602742/etc/xml/
inflating: 6602742/etc/xml/GenericActions.xml
inflating: 6602742/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 6602742/README.txt
进入解压目录打补丁,直接用apply参数即可:
ERPDB1@/u01/db10g/OPatch>cd 6602742
ERPDB1@/u01/db10g/OPatch/6602742>echo $OBJECT_MODE
ERPDB1@/u01/db10g/OPatch/6602742>export OBJECT_MODE=32_64
ERPDB1@/u01/db10g/OPatch/6602742>echo $OBJECT_MODE
32_64
ERPDB1@/u01/db10g/OPatch/6602742>/u01/db10g/OPatch/opatch apply
Invoking OPatch 10.2.0.4.7Oracle Interim Patch Installer version 10.2.0.4.7
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /u01/db10g
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.7
OUI version : 10.2.0.3.0
OUI location : /u01/db10g/oui
Log file location : /u01/db10g/cfgtoollogs/opatch/opatch2009-06-25_23-09-50PM.logPatch history file: /u01/db10g/cfgtoollogs/opatch/opatch_history.txt
ApplySession applying interim patch '6602742' to OH '/u01/db10g'
Running prerequisite checks...
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: 'p5b1'
Local node: 'p5a1'
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/db10g')
Is the local system ready for patching? [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 '6602742' for restore. This might take a while...
Backing up files affected by the patch '6602742' for rollback. This might take a while...Patching component oracle.rdbms, 10.2.0.3.0...
Updating archive file "/u01/db10g/lib/libserver10.a" with "lib/libserver10.a/kks.o"
Updating archive file "/u01/db10g/lib/libserver10.a" with "lib/libserver10.a/kks1.o"
Updating archive file "/u01/db10g/lib/libserver10.a" with "lib/libserver10.a/opibnd.o"
Updating archive file "/u01/db10g/lib/libserver10.a" with "lib/libserver10.a/kxfx.o"
Updating archive file "/u01/db10g/lib/libserver10.a" with "lib/libserver10.a/kspt.o"
Running make for target ioracle
ApplySession adding interim patch '6602742' to inventoryVerifying the update...
Inventory check OK: Patch ID 6602742 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 6602742 are present in Oracle Home.The local system has been patched. You can restart Oracle instances on it.
Patching in rolling mode.
在RAC环境,Opatch接着会自动提示并为其他节点打补丁:
The node 'p5b1' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'p5b1'.
(Oracle Home = '/u01/db10g')Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'p5b1'
Apply-related files are:
FP = "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/copy_files.txt"
DP = "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/copy_dirs.txt"
MP = "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/make_cmds.txt"
RC = "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/remote_cmds.txt"Instantiating the file "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
Instantiating the file "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/u01/db10g/.patch_storage/6602742_Nov_22_2007_04_41_39/rac/make_cmds.txt" with actual path.
Running command on remote node 'p5b1':
cd /u01/db10g/rdbms/lib; /usr/ccs/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/db10g || echo REMOTE_MAKE_FAILED::>&2
WARNING for re-link on remote node 'p5b1':
OPatch completed the command 'cd /u01/db10g/rdbms/lib; /usr/ccs/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/db10g || echo REMOTE_MAKE_FAILED::>&2 ' with warnings.......
The node 'p5b1' has been patched. You can restart Oracle instances on it.
OPatch completed with warnings.
查看补丁应用情况:
ERPDB1@/u01/db10g/OPatch>opatch lsinventory
Invoking OPatch 10.2.0.4.7Oracle Interim Patch Installer version 10.2.0.4.7
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /u01/db10g
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.7
OUI version : 10.2.0.3.0
OUI location : /u01/db10g/oui
Log file location : /u01/db10g/cfgtoollogs/opatch/opatch2009-06-25_23-23-36PM.logPatch history file: /u01/db10g/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /u01/db10g/cfgtoollogs/opatch/lsinv/lsinventory2009-06-25_23-23-36PM.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 6602742 : applied on Thu Jun 25 23:11:44 GMT+08:00 2009
Created on 22 Nov 2007, 04:41:39 hrs PST8PDT
Bugs fixed:
6602742, 5863277, 6334554, 4367986, 5177766, 5254759, 5955454, 6085625
6039513, 5648872, 6417744, 6452485Patch 5556081 : applied on Sat Jun 21 18:27:24 GMT+08:00 2008
Created on 9 Nov 2006, 22:20:50 hrs PST8PDT
Bugs fixed:
5556081Patch 5557962 : applied on Sat Jun 21 18:27:04 GMT+08:00 2008
Created on 9 Nov 2006, 23:23:06 hrs PST8PDT
Bugs fixed:
4269423, 5557962, 5528974
Rac system comprising of multiple nodes
Local node = p5a1
Remote node = p5b1--------------------------------------------------------------------------------
OPatch succeeded.
打补丁集合:
ERPDB1@/u01/db10g/OPatch>unzip p7145055_10203_AIX64-5L.zip
Archive: p7145055_10203_AIX64-5L.zip
creating: 7145055/ERPDB1@/u01/db10g/OPatch/7145055>/u01/db10g/OPatch/opatch napply -skip_subset -skip_duplicate
Invoking OPatch 10.2.0.4.7Oracle Interim Patch Installer version 10.2.0.4.7
Copyright (c) 2009, Oracle Corporation. All rights reserved.UTIL session
Oracle Home : /u01/db10g
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.7
OUI version : 10.2.0.3.0
OUI location : /u01/db10g/oui
Log file location : /u01/db10g/cfgtoollogs/opatch/opatch2009-06-25_23-47-46PM.logPatch history file: /u01/db10g/cfgtoollogs/opatch/opatch_history.txt
Invoking utility "napply"
Checking conflict among patches...
Checking if Oracle Home has components required by patches...
Checking skip_duplicate
Checking skip_subset
Checking conflicts against Oracle Home...Conflicts/Supersets for each patch are:
Patch : 6939227
Conflict with 6602742
Conflict details:
/u01/db10g/lib/libserver10.a:/kspt.oFollowing patches have conflicts: [ 6602742 6939227 ]
Please contact Oracle Support Services to resolve patch conflicts.Conflict with patches in OracleHome detected. Please run OPatch again as
<ORACLE_HOME>/OPatch/opatch napply /u01/db10g/OPatch/7145055 -id 4336528,4605569,4963729,5079978,5190596,5366893,5387030,5455880,5471994,5526987,5640904,
5755010,5958244,6939219,6939234,6939248,6939256,6939270,6943415,6943428,7114055,7138281 -skip_duplicateIf the command is too long, please paste the patch id list in a file and
invoke with 'idfile' option. Please refer 'opatch napply -help' for
'idfile' option.
UtilSession failed: NApply stops on user's request.
--------------------------------------------------------------------------------
The following warnings have occurred during OPatch execution:
1) OUI-67301:
Following patches have conflicts: [ 6602742 6939227 ]
Please contact Oracle Support Services to resolve patch conflicts.2) OUI-67124:Conflict with patches in OracleHome detected. Please run OPatch again as
<ORACLE_HOME>/OPatch/opatch napply /u01/db10g/OPatch/7145055 -id 4336528,4605569,4963729,5079978,5190596,5366893,5387030,5455880,5471994,5526987,5640904,
5755010,5958244,6939219,6939234,6939248,6939256,6939270,6943415,6943428,7114055,7138281 -skip_duplicateIf the command is too long, please paste the patch id list in a file and
invoke with 'idfile' option. Please refer 'opatch napply -help' for
'idfile' option.
--------------------------------------------------------------------------------OPatch failed with error code 73
可见不同的patch之间也可能产生冲突,这时只能打没有冲突的Patch了。