Chinaunix首页 | 论坛 | 博客
  • 博客访问: 184688
  • 博文数量: 44
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 40
  • 用 户 组: 普通用户
  • 注册时间: 2016-09-22 15:37
文章分类
文章存档

2017年(28)

2016年(16)

我的朋友

分类: Oracle

2017-09-13 00:23:19

原文地址:rac环境打oracle 10.2.0.5.6补丁 作者:hxl

环境:
os: Red Hat Linux As 5
DB:10.2.0.5(两个节点)

1.下载补丁号13343471
这个需要从下载,下载完成后上传到服务器并解压到相应的目录,同时修改目录属主。
[root@node1 soft]#mkdir 13343471
[root@node1 soft]# unzip -d ./13343471 p13343471_10205_LINUX.zip
[root@node1 soft]# chown -R oracle:oinstall ./13343471


2.检查该补丁是否已经跟已经安装的补丁有冲突
oracle用户下执行
node1-> /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./13343471
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.5.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2014-02-08_22-13-03PM.log

Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.


3.查看该补丁能否采用rolling方式升级
采用这种方法对应用系统没有影响的,升级一个节点的同时,其他节点不需要停机.
node1-> ./opatch query -all  /soft/13343471/13343471|grep rolling
 Patch is a rolling patch: true

返回true说明该补丁可以采用滚动方式升级.

4.升级节点1
我这里是两个节点的rac,这里先升级节点1
关闭节点1
node1-> srvctl stop listener -n node1
node1-> srvctl stop instance -d racdb -i racdb1

 

node1-> cd 13343471/
node1-> ls
custom  etc  files  patchmd.xml  README.html  README.txt
node1-> /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.5.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2014-02-08_22-24-52PM.log

Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '13343471' to OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:


Following executables are active :
/u01/app/oracle/product/10.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecutables" failed.
System intact, OPatch will not attempt to restore the system

OPatch failed with error code 74

这个原因是因为没有关闭asm实例导致的,停掉asm实例继续
node1-> srvctl stop asm -n node1
node1-> /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.5.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2014-02-08_22-30-59PM.log

Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '13343471' to OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...
Patch 13343471: Optional component(s) missing : [ oracle.rdbms.dv, 10.2.0.5.0 ] , [ oracle.rdbms.dv.oc4j, 10.2.0.5.0 ] , [ oracle.network.cman, 10.2.0.5.0 ]

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: 'node2'
Local node: 'node1'
elease shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/10.2.0/db_1')


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 '13343471' for restore. This might take a while...
Backing up files affected by the patch '13343471' for rollback. This might take a while...
Execution of 'sh /soft/13343471/13343471/custom/scripts/pre -apply 13343471 ':
...
Patching component oracle.sdo.locator, 10.2.0.5.0...
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libordsdo10.a"  with "lib/libordsdo10.a/mdidx.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libordsdo10.a"  with "lib/libordsdo10.a/mdrcr.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libordsdo10.a"  with "lib/libordsdo10.a/mdrt.o"
Running make for target client_sharedlib
Running make for target ioracle
Running make for target iwrap
Running make for target client_sharedlib
Running make for target proc
Running make for target irman
ApplySession adding interim patch '13343471' to inventory

Verifying the update...
Inventory check OK: Patch ID 13343471 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 13343471 are present in Oracle Home.

The local system has been patched.  You can restart Oracle instances on it.


Patching in rolling mode.


The node 'node2' will be patched next.


Please shutdown Oracle instances running out of this ORACLE_HOME on 'node2'.
(Oracle Home = '/u01/app/oracle/product/10.2.0/db_1')

Is the node ready for patching? [y|n]

这个时候打开不要输入任何内容,打开另外一个窗口启动实例1
node1-> srvctl start asm -n node1
node1-> srvctl start instance -d racdb -i racdb1
node1-> srvctl start listener -n node1

关闭实例2
node1-> srvctl stop listener -n node2
node1-> srvctl stop instance -d racdb -i racdb2
node1-> srvctl stop asm -n node2

等待实例2关闭完成后,回到刚才升级的窗口,在提升下输入'Y',升级节点2

Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'node2'
   Apply-related files are:
     FP = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/13343471_Dec_20_2011_19_32_16/rac/copy_files.txt"
     DP = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/13343471_Dec_20_2011_19_32_16/rac/copy_dirs.txt"
     MP = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/13343471_Dec_20_2011_19_32_16/rac/make_cmds.txt"
     RC = "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/13343471_Dec_20_2011_19_32_16/rac/remote_cmds.txt"

Instantiating the file "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/13343471_Dec_20_2011_19_32_16/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/10.2.0/db_1/.patch_storage/13343471_Dec_20_2011_19_32_16/rac/copy_files.txt" with actual path.
Propagating files to remote nodes..

...

The node 'node2' 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 'node2' .
The following make commands were invoked on remote nodes:
'cd /u01/app/oracle/product/10.2.0/db_1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
cd /u01/app/oracle/product/10.2.0/db_1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
cd /u01/app/oracle/product/10.2.0/db_1/plsql/lib; /usr/bin/make -f ins_plsql.mk iwrap ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
cd /u01/app/oracle/product/10.2.0/db_1/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
cd /u01/app/oracle/product/10.2.0/db_1/precomp/lib; /usr/bin/make -f ins_precomp.mk proc ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
cd /u01/app/oracle/product/10.2.0/db_1/rdbms/lib; /usr/bin/make -f ins_rdbms.mk irman ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
'


OPatch succeeded.

按照提示启动实例2
node1-> srvctl start asm -n node2
node1-> srvctl start instance -d racdb -i racdb2
node1-> srvctl start listener -n node2

到这里节点1和节点2都升级完成.

5.执行脚本
注意rac环境,该脚本只在一个节点上执行即可,所数据库已经启动的情况下,不需要再启动数据库,直接执行脚本即可。

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @catbundle.sql psu apply
SQL> -- Execute the next statement only if this is the first PSU applied for 10.2.0.5 or this is the first PSU applied since 10.2.0.5.3.
SQL> @utlrp.sql
我的数据库版本是10.2.0.5,之前没有打过任何补丁,所以需要执行utlrp.sql.


6.编译失效对象

7.验证升级情况
node1-> cd /u01/app/oracle/product/10.2.0/db_1/OPatch
node1-> ./opatch lsinv
Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.5.0
OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2014-02-08_22-52-14PM.log

Patch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-02-08_22-52-14PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 10g                                                  10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 4                           10.2.0.5.0a
There are 2 products installed in this Oracle Home.


Interim patches (1) :

Patch  13343471     : applied on Sat Feb 08 22:34:11 CST 2014
Unique Patch ID:  14268542
   Created on 20 Dec 2011, 19:32:16 hrs PST8PDT
   Bugs fixed:
     6402302, 10269717, 10327190, 11693109, 8865718, 10017048, 9024850
     8394351, 8546356, 8224558, 13489660, 9360157, 9770451, 9020537, 9772888
     8650138, 8664189, 8488233, 10091698, 10092858, 12551710, 7519406
     13349665, 10132870, 8771916, 9109487, 7509714, 9171933, 10173237
     9532911, 10139235, 10159846, 10068982, 8350262, 11792865, 7119382
     7361418, 10306945, 8666117, 11724962, 11725006, 6157713, 10214450
     9184754, 8966823, 8544696, 9320130, 9767674, 9323583, 7026523, 9399589
     8277300, 9672816, 13343467, 9726739, 9499302, 8412426, 10165083, 10208905
     12419392, 6651220, 9150282, 9145204, 9659614, 9949948, 11076894, 10327179
     8882576, 7612454, 7111619, 7450366, 9711859, 11893577, 9714832, 9735237
     8970313, 6011045, 11814891, 10162036, 10248542, 9952230, 9469117, 13359623
     9952270, 9842573, 13343471, 8660422, 10324526, 11066597, 12419258
     9322219, 8636407, 9713537, 12828105, 10010310, 9390484, 9824435, 12925532
     9963497, 9032322, 12862186, 12551700, 12862187, 12551701, 10249537
     12551702, 12551703, 9586877, 8211733, 12551704, 10076669, 6694396
     9548269, 12551705, 12551706, 9337325, 12551707, 8354642, 7602341, 12551708
     9308296, 12827745, 9072105, 8528171, 10157402, 12565867, 11737047

 

Rac system comprising of multiple nodes
  Local node = node1
  Remote node = node2

--------------------------------------------------------------------------------

OPatch succeeded.

node1-> ./opatch lsinventory -bugs_fixed|grep -i 'PSU'
                                                    ENCAPSULATED BY EXCEPTION HANDLING
9952230    13343471  Sat Feb 08 22:34:11 CST 2014   DATABASE PSU 10.2.0.5.1 (INCLUDES CPUOCT2010)
10248542   13343471  Sat Feb 08 22:34:11 CST 2014   DATABASE PSU 10.2.0.5.2 (INCLUDES CPUJAN2011)
11724962   13343471  Sat Feb 08 22:34:11 CST 2014   DATABASE PSU 10.2.0.5.3 (INCLUDES CPUAPR2011)
12419392   13343471  Sat Feb 08 22:34:11 CST 2014   DATABASE PSU 10.2.0.5.4 (INCLUDES CPUJUL2011)
12827745   13343471  Sat Feb 08 22:34:11 CST 2014   DATABASE PSU 10.2.0.5.5 (INCLUDES CPUOCT2011)
13343471   13343471  Sat Feb 08 22:34:11 CST 2014   DATABASE PSU 10.2.0.5.6 (INCLUDES CPUJAN2012)
13349665   13343471  Sat Feb 08 22:34:11 CST 2014   ORA-600 [KKSLMTL-VALNOTFOUND] WITH PSU 10.2.0.5.5


-- The End --

阅读(2620) | 评论(0) | 转发(0) |
0

上一篇:exp/imp与expdp/impdp区别

下一篇:rolling patch

给主人留下些什么吧!~~