1.什么是PSU
PSU(Patch Set Update)简单讲就是多个补丁的集合,它减轻了小版本周期长而带来的不能及时更新的影响,解决了多个个别补丁冲突和相互影响的问题,同时减轻DBA安装补丁的负担,减少补丁安装次数。
PSU特点
(1)每个PSU(Patch Set Update)修改5位版本号的第5位,如11.2.0.2现在的PSU为11.2.0.2.9,既然是补丁集,那么每个PSU就包含多个补丁,它作为一个整体进行了严格测试,解决各补丁的冲突问题。
(2)PSU定期发布,PSU不仅包括对功能、性能修复的一般补丁,也包括安全补丁,由于PSU包括同期发布的CPU(Critical Patch Updates),只要安装PSU即可,如同PSR和CPU一样,
(3)PSU是累积型的,即只要安装最新的PSU就自动包括以前所有PSU的内容,如安装11.2.0.2.9就包含了11.2.0.2.1至11.2.0.2.8
Oracle推荐的PSU的版本见[ID 756671.1]
Oracle Recommended Patches -- Oracle Database [ID 756671.1]
以下为本次打11.2.0.2.9的操作日志
2.先停掉数据库和监听
[oracle3@svr7-168 patch]$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 15-APR-2013 10:59:08
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=svr7-168)(PORT=1522)))
The command completed successfully
[oracle3@svr7-168 patch]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on Mon Apr 15 10:59:16 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
3.下载并解压PSU
[oracle3@svr7-168 patch]$ unzip p14727315_112020_Linux-x86-64_112029.zip
[oracle3@svr7-168 patch]$ cd 14727315
4.检查冲突
[oracle3@svr7-168 14727315]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /opt/software/oracle3/product/11.2.0
Central Inventory : /opt/oracle3/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 11.2.0.2.0
OUI location : /opt/software/oracle3/product/11.2.0/oui
Log file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_11-00-53AM.log
Patch history file: /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch_history.txt
Invoking prereq "checkconflictagainstohwithdetail"
OPatch failed to locate Central Inventory.
Possible causes are:
The Central Inventory is corrupted
The oraInst.loc file specified is not valid.
Prereq "checkConflictAgainstOHWithDetail" is not executed.
The details are:
Exception occured : OPatch failed to locate Central Inventory.
Possible causes are:
The Central Inventory is corrupted
The oraInst.loc file specified is not valid.
Summary of Conflict Analysis:
There are no patches that can be applied now.
Conflicts/Supersets for each patch are:
OPatch succeeded.
5. 如果Inventory不正常或损坏,重建Inventory
根据上面操作日志显示,Inventory不正常或损坏,我们再重建Inventory再进行相关的操作
这是一个性能测试环境,可能软件是从其它机器上面拷贝过来的,造成了Inventory的损坏或丢失,没关系,我们重建一下就可以了
(1)查看Inventory
[oracle3@svr7-168 14727315]$ opatch lsinventory
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /opt/software/oracle3/product/11.2.0
Central Inventory : /opt/software/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 11.2.0.2.0
OUI location : /opt/software/oracle3/product/11.2.0/oui
Log file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_11-22-21AM.log
Patch history file: /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch_history.txt
List of Homes on this system:
Inventory load failed... OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
Oracle Home dir. path does not exist in Central Inventory
Oracle Home is a symbolic link
Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo
OPatch failed with error code 73
(2)重建Inventory
修改oraInst.loc为指定的目录
[oracle3@svr7-168 redo]$ vi /etc/oraInst.loc
inventory_loc=/opt/software/oracle3/oraInventory
inst_group=dba
下面为11g的创建方式
[oracle3@svr7-168 14727315]$ cd /opt/software/oracle3/product/11.2.0/oui/bin/
[oracle3@svr7-168 bin]$ ./attachHome.sh
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 10239 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /opt/software/oracle3/oraInventory
'AttachHome' was successful.
[oracle3@svr7-168 bin]$
10G和之前版本请使用下面方式重建inventory
下面用实际目录替换$ORACLE_HOME
cd $ORACLE_HOME/oui/bin
./runInstaller -silent -attachHome ORACLE_HOME="$ORACLE_HOME" ORACLE_HOME_NAME="Ora10gHome"
(3)再次显示,发现已经正常
[oracle3@svr7-168 14727315]$ opatch lsinventory
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /opt/software/oracle3/product/11.2.0
Central Inventory : /opt/software/oracle3/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 11.2.0.2.0
OUI location : /opt/software/oracle3/product/11.2.0/oui
Log file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_11-30-01AM.log
Patch history file: /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/lsinv/lsinventory2013-04-15_11-30-01AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.2.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
6.再次验证并apply
(1)验证冲突,日志显示opatch版本太低
[oracle3@svr7-168 14727315]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
[oracle3@svr7-168 14727315]$ opatch apply
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /opt/software/oracle3/product/11.2.0
Central Inventory : /opt/software/oracle3/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 11.2.0.2.0
OUI location : /opt/software/oracle3/product/11.2.0/oui
Log file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_11-30-40AM.log
Patch history file: /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch_history.txt
Failed to load the patch object. Possible causes are:
The specified path is not an interim Patch shiphome
Meta-data files are missing from the patch area
Patch location = /home/oracle3/patch/14727315
Details = PatchObject constructor: Input file "/home/oracle3/patch/14727315/etc/config/actions" or "/home/oracle3/patch/14727315/etc/config/inventory" does not exist.
ApplySession failed: PatchObject constructor: Input file "/home/oracle3/patch/14727315/etc/config/actions" or "/home/oracle3/patch/14727315/etc/config/inventory" does not exist.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 73
[oracle3@svr7-168 14727315]$
(2)metalink上面下载最新的Opatch,见patch p6880880,选择相关的版本并下载,
下载后解压至$ORACLE_HOME中
[oracle3@svr7-168 patch]$ unzip p6880880_112000_Linux-x86-64.zip
[oracle3@svr7-168 patch]$ mv OPatch/ $ORACLE_HOME/
7.再次应用PSU
apply前最好检查一下冲突,检查冲突的日志没有拷贝下来
[oracle3@svr7-168 14727315]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
[oracle3@svr7-168 14727315]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /opt/software/oracle3/product/11.2.0
Central Inventory : /opt/software/oracle3/oraInventory
from : /opt/software/oracle3/product/11.2.0/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.2.0
Log file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_11-57-33AM_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 13696224 13923804 14275621 14727315
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/software/oracle3/product/11.2.0')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '13696224' to OH '/opt/software/oracle3/product/11.2.0'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.rdbms.rsf, 11.2.0.2.0...
Patching component oracle.rdbms, 11.2.0.2.0...
Patching component oracle.sysman.console.db, 11.2.0.2.0...
Patching component oracle.sysman.oms.core, 10.2.0.4.3...
Patching component oracle.ldap.rsf, 11.2.0.2.0...
Patching component oracle.rdbms.dv, 11.2.0.2.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.2.0...
Patching component oracle.sysman.plugin.db.main.repository, 11.2.0.2.0...
Patching component oracle.rdbms.rman, 11.2.0.2.0...
Patching component oracle.sdo.locator, 11.2.0.2.0...
Patching component oracle.network.rsf, 11.2.0.2.0...
Patching component oracle.precomp.common, 11.2.0.2.0...
Verifying the update...
Applying sub-patch '13923804' to OH '/opt/software/oracle3/product/11.2.0'
Patching component oracle.rdbms.rsf, 11.2.0.2.0...
Patching component oracle.rdbms, 11.2.0.2.0...
Patching component oracle.sysman.console.db, 11.2.0.2.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.2.0...
Patching component oracle.rdbms.rman, 11.2.0.2.0...
Patching component oracle.network.rsf, 11.2.0.2.0...
Patching component oracle.network.listener, 11.2.0.2.0...
Verifying the update...
Applying sub-patch '14275621' to OH '/opt/software/oracle3/product/11.2.0'
Patching component oracle.rdbms.rsf, 11.2.0.2.0...
Patching component oracle.rdbms, 11.2.0.2.0...
Patching component oracle.network.client, 11.2.0.2.0...
Patching component oracle.network.rsf, 11.2.0.2.0...
Patching component oracle.precomp.common, 11.2.0.2.0...
Patching component oracle.rdbms.rman, 11.2.0.2.0...
Patching component oracle.rdbms.deconfig, 11.2.0.2.0...
Patching component oracle.rdbms.util, 11.2.0.2.0...
Patching component oracle.dbjava.jdbc, 11.2.0.2.0...
Patching component oracle.dbjava.ic, 11.2.0.2.0...
Verifying the update...
Applying sub-patch '14727315' to OH '/opt/software/oracle3/product/11.2.0'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.2.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.precomp.common, 11.2.0.2.0...
Patching component oracle.rdbms, 11.2.0.2.0...
Patching component oracle.rdbms.rman, 11.2.0.2.0...
Patching component oracle.rdbms.rsf, 11.2.0.2.0...
Patching component oracle.rdbms.util, 11.2.0.2.0...
Patching component oracle.sdo.locator, 11.2.0.2.0...
Patching component oracle.sysman.console.db, 11.2.0.2.0...
Patching component oracle.sysman.oms.core, 10.2.0.4.3...
Verifying the update...
Make failed to invoke "/usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/opt/software/oracle3/product/11.2.0"....'genclntsh: genclntsh: Could not locate /opt/software/oracle3/product/11.2.0/network/admin/shrept.lst
make: *** [client_sharedlib] Error 1
Make failed to invoke "/usr/bin/make -f ins_rdbms.mk client_sharedlib ORACLE_HOME=/opt/software/oracle3/product/11.2.0"....'genclntsh: genclntsh: Could not locate /opt/software/oracle3/product/11.2.0/network/admin/shrept.lst
make: *** [client_sharedlib] Error 1
OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/opt/software/oracle3/product/11.2.0/precomp/lib/env_precomp.mk:2158: warning: ignoring old commands for target `pcscfg.cfg'
/opt/software/oracle3/product/11.2.0/precomp/lib/ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/opt/software/oracle3/product/11.2.0/precomp/lib/env_precomp.mk:2158: warning: ignoring old commands for target `pcscfg.cfg'
The following make actions have failed :
Re-link fails on target "client_sharedlib".
Re-link fails on target "client_sharedlib".
Do you want to proceed? [y|n]
y
User Responded with: Y
Composite patch 14727315 successfully applied.
OPatch Session completed with warnings.
Log file location: /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_11-57-33AM_1.log
OPatch completed with warnings.
上面补丁已经打成功,现在需要更新相关系统视图
[oracle3@svr7-168 14727315]$ cd $ORACLE_HOME/rdbms/admin
sqlplus "/as sysdba"
SQL> startup
SQL> @catbundle.sql psu apply
SQL> quit
8.查看相关的补丁和PSU情况
[oracle3@svr7-168 10220118]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.
Oracle Home : /opt/software/oracle3/product/11.2.0
Central Inventory : /opt/software/oracle3/oraInventory
from : /opt/software/oracle3/product/11.2.0/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.2.0
Log file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/opatch2013-04-15_13-21-28PM_1.log
Lsinventory Output file location : /opt/software/oracle3/product/11.2.0/cfgtoollogs/opatch/lsinv/lsinventory2013-04-15_13-21-28PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.2.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch 10220118 : applied on Mon Apr 15 13:18:11 CST 2013
Unique Patch ID: 15991767
Created on 19 Feb 2013, 02:57:52 hrs PST8PDT
Bugs fixed:
10220118
This patch overlays patches:
14727315
This patch needs patches:
14727315
as prerequisites
Patch 14727315 : applied on Mon Apr 15 12:04:17 CST 2013
Unique Patch ID: 15682618
Patch description: "Database Patch Set Update : 11.2.0.2.9 (14727315)"
Created on 3 Jan 2013, 02:38:30 hrs PST8PDT
Sub-patch 14275621; "Database Patch Set Update : 11.2.0.2.8 (14275621)"
Sub-patch 13923804; "Database Patch Set Update : 11.2.0.2.7 (13923804)"
Sub-patch 13696224; "Database Patch Set Update : 11.2.0.2.6 (13696224)"
Bugs fixed:
13080778, 10114837, 10373381, 14461358, 10035737, 12737666, 11065646
13769501, 12639234, 12586495, 10630870, 12880299, 9715581, 10218814
9860769, 10332111, 15896431, 14263036, 10367188, 12830339, 14263073
9651350, 12586489, 11683713, 14107388, 10097711, 12950644, 10113990
12370722, 12586491, 12899768, 15896427, 9414040, 14613900, 9373370
11724916, 13769503, 9578670, 10285022, 10399808, 11877623, 10248523
12586493, 9972680, 10092858, 12546006, 12797765, 12586487, 13769509
11830777, 10055063, 10648873, 10419984, 10077191, 11063191, 10220033
11858315, 11061775, 9478199, 12649442, 12326708, 11708510, 10127360
11734067, 10396041, 10190642, 13737746, 10396874, 10233732, 10209232
12595561, 9956835, 11666137, 10061015, 9672816, 11695416, 9744252
10620808, 9858539, 11694127, 11894889, 9382956, 10204358, 12713993
10080579, 12764337, 11738259, 10084145, 10363186, 12670165, 10324294
14107384, 10158493, 10155605, 10013177, 13343424, 11686968, 10013431
14546575, 12586496, 11674485, 13476583, 9877980, 10126822, 10284570
10329146, 10326338, 15896429, 11064851, 11063821, 12655433, 10314582
10051315, 12326246, 10332589, 13467683, 10368698, 12586486, 9724970
13769507, 11815753, 9905049, 10053725, 12834027, 10229886, 9869287
9735237, 9896536, 12846268, 9912965, 12794305, 10022980, 14546673
13503598, 11695285, 12595730, 13399435, 13343244, 14023636, 12371955
12633340, 13257247, 10039731, 11674898, 13769505, 9824435, 6892311
11841309, 10031806, 12894807, 11076894, 10170431, 12748240, 9965655
12323180, 12531263, 10219583, 12417369, 12419331, 9539440, 10622001
14107385, 10227288, 11867127, 10258337, 11814891, 10228393, 10621169
9847634, 8547978, 15896435, 10159846, 10142857, 10187168, 10269503
10395345, 12596444, 9564886, 10373013, 11785938, 10213073, 11827088
10302581, 12569482, 10278372, 14546638, 9795214, 12397410, 9707965
9443361, 10210507, 10126094, 10073683, 10172453, 11811073, 10230571
12419321, 12656535, 10312847, 9943960, 10052141, 12408350, 13250244
9903826, 12409916, 11056082, 10026601, 12420002, 8685446, 8223165
9401552, 12780098, 10094823, 11716621, 12589039, 14390377, 10228151
10623249, 10356513, 12345717, 11057263, 11856395, 11775474, 11670161
15896433, 11924400, 14841437, 10094201, 10378005, 10115630, 9835264
10422126, 10021111, 14258925, 11818335, 10281887, 11707302, 10140809
10317487, 12586488, 10322959, 9727147, 10151017, 13386082, 11706168
10245086, 14469008, 10205230, 10158965, 11937253, 11733179, 9829397
10278773, 14107387, 11882425, 10419629, 12586494, 12337012, 12848798
10388660, 9788588, 10239480, 6523037, 10417716, 9842573, 12879027
11883472, 12586492, 10200404, 10232083, 12685431, 9881076, 14275621
10157402, 9709292, 11830778, 14461357, 10207092, 12586490, 11800170
9683047, 12391602, 14262913, 10417216, 10635701, 9869401, 10157249
10131867, 13632725, 9970255, 14683459, 13468884, 15896428, 11830776
10633840, 12976376, 11695333, 10200390, 10142909, 13326736, 10237773
12366627, 7312717, 10019218, 11664046, 9233544, 12569737, 14107389
13001379, 13099577, 10222719, 9873405, 11834448, 9819805, 11872103
10165083, 13769502, 10193846, 10285394, 11715084, 12827726, 9375300
14040433, 11723722, 10264696, 10264680, 13769508, 11842991, 12845115
14473913, 9436324, 10358019, 10089333, 14741727, 14038791, 13550185
10175192, 8672862, 10207551, 9956713, 12639177, 11853815, 14461356
10180307, 10048701, 12828071, 10079168, 12423475, 13923804, 9771278
10356782, 14127510, 13769506, 10229719, 12340939, 9966609, 11651810
14035825, 9078442, 10137324, 13769504, 10219576, 12378147, 10217802
10142788, 10129643, 12400751, 12539000, 11724984, 9735282, 10040921
9591812, 9906422, 9746210, 12917230, 9770451, 10021022, 12846269
10110863, 12579349, 11067567, 10411618, 11699057, 10425676, 13916709
12635537, 14076523, 11707699, 9895207, 11890804, 10299224, 10018789
14205448, 9926929, 11800854, 11866952, 14467061, 10384285, 10636231
11069199, 11689702, 14624146, 10427260, 10324526, 13696224, 12543639
11690639, 9285259, 10284838, 10082277, 9952554, 9470768, 15896430
11785390, 10310299, 10412247, 12313857, 12431716, 14107386, 10102506
10238786, 10132870, 10247152, 9953542, 14727315, 9572787, 15896434
11800959, 13769510, 10052956, 12374212, 10040531, 15896432, 9681133
10190172, 11878443, 10040035, 12620422, 10171273, 11893621, 10249791
11788856, 11664719, 9748749, 13554409, 11889177
--------------------------------------------------------------------------------
OPatch succeeded.
9.启动监听
[oracle3@svr7-168 10220118]$ lsnrctl start
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21605631/viewspace-758498/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21605631/viewspace-758498/