下面是在10.2.0.4 RAC上滚动(Rolling)回退补丁8575528的过程:
1).停止1号机数据库Oracle_HOME下所有的数据库实例(如果有ASM,也要停止):
$srvctl stop instance -d <dbname> -i <instance_name>
$srvctl stop asm -n <nodename>
比如:
$srvctl stop instance -d ONEPIECE -i ONEPIECE1
$srvctl stop asm -n nascds14
$crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....E1.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
2). 在1号机回滚补丁:
比如:
$su - oracle
$cd $ORACLE_HOME/OPatch/8575528
$opatch rollback -id 8575528
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/oui
Log file location : /u01/app/oracle/cfgtoollogs/opatch/opatch2012-06-13_18-22-10PM.log
RollbackSession rolling back interim patch '8575528' from OH '/u01/app/oracle'
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: 'nascds15'
Local node: 'nascds14'
Please shut down Oracle instances running out of this ORACLE_HOME on all the nodes.
(Oracle Home = '/u01/app/oracle')
Are all the nodes ready for patching? [y|n]
y <=========输入y
User Responded with: Y
Backing up files affected by the patch '8575528' for restore. This might take a while...
Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kks1.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kksc.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/kksh.o"
Updating archive file "/u01/app/oracle/lib/libserver10.a" with "lib/libserver10.a/ksmp.o"
Running make for target ioracle
RollbackSession removing interim patch '8575528' from inventory
Patching in rolling mode.
The node 'nascds15' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'nascds15'.
(Oracle Home = '/u01/app/oracle')
Is the node ready for patching? [y|n]
3). 然后opatch会问您是否要在另外一个节点上回滚。这时候执行下面的操作。
4). 启动1号机ASM 实例和数据库实例:
$srvctl start asm -n <nodename>
$srvctl start instance -d <dbname> -i <instance_name>
比如:
$srvctl start asm -n nascds14
$srvctl start instance -d ONEPIECE -i ONEPIECE1
$crs_stat -t
ora....E1.inst application ONLINE ONLINE nascds14
ora....SM1.asm application ONLINE ONLINE nascds14
5).停止2号机的ASM实例和数据库实例:
$srvctl stop instance -d <dbname> -i <instance_name>
$srvctl stop asm -n <nodename>
$srvctl stop instance -d ONEPIECE -i ONEPIECE2
$srvctl stop asm -n nascds15
$crs_stat -t
ora....E2.inst application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
6). 在之前回滚补丁的那个提示符中,确认继续下一个节点。
The node 'nascds15' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'nascds15'.
(Oracle Home = '/u01/app/oracle')
Is the node ready for patching? [y|n]
y <=========输入y
User Responded with: Y
Updating nodes 'nascds15'
Rollback-related files are:
FR = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_files.txt"
DR = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_dirs.txt"
FP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt"
MP = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt"
RC = "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remote_cmds.txt"
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_dirs.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/remove_dirs.txt" with
actual path.
Removing directories on remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_files.txt" with
actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/copy_dirs.txt" with
actual path.
Propagating directories to remote nodes...
Instantiating the file "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt.instantiated"
by replacing $ORACLE_HOME in "/u01/app/oracle/.patch_storage/8575528_Aug_17_2010_07_56_36/rac/make_cmds.txt" with
actual path.
Running command on remote node 'nascds15':
cd /u01/app/oracle/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle || echo
REMOTE_MAKE_FAILED::>&2
The node 'nascds15' has been patched. You can restart Oracle instances on it.
There were relinks on remote nodes. Remember to check the binary size and timestamp on the nodes 'nascds15' .
The following make commands were invoked on remote nodes:
'cd /u01/app/oracle/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle
'
OPatch succeeded.
7). 启动2号机的ASM实例和数据库实例:
$srvctl start asm -n <nodename>
$srvctl start instance -d <dbname> -i <instance_name>
比如:
$srvctl start asm -n nascds15
$srvctl start instance -d ONEPIECE -i ONEPIECE2
8).在两个节点分别执行下面的命令来确认补丁已经回滚成功。
$ $ORACLE_HOME/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle
Central Inventory : /home/oracle/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/oui
Log file location : /u01/app/oracle/cfgtoollogs/opatch/opatch2012-06-13_19-40-41PM.log
Lsinventory Output file location : /u01/app/oracle/cfgtoollogs/opatch/lsinv/lsinventory2012-06-13_19-40-41PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
Rac system comprising of multiple nodes
Local node = nascds14
Remote node = nascds15
--------------------------------------------------------------------------------
OPatch succeeded.
