一、准备工作
1、下载补丁程序
oracle patch是oracle的更新工具,由于本次更新补丁要求使用OPatch 11.2.0.3.6以上,而默认安装的oracle 11.2.0.4的OPatch为11.2.0.3.5。
为此需要下载一个新的OPatch工具。下载地址:https://updates.oracle.com/download/6880880.html
p6880880_112000_Linux-x86-64.zip ---opatch11.2.0.3.18
p26925576_112040_Linux-x86-64.zip ----11.2.0.4.180116
2、关闭数据库及监听
二、更新OPatch程序
To install this patch, Please extract the file "zipped file" using unzip or winzip,
depending upon the platform. You should extract the zip file directly under the
ORACLE_HOME. Please follow the following steps for extracting the zip file of OPatch.
(1) Please take a backup of ORACLE_HOME/OPatch into a dedicated backup
location.
(2) Please make sure no directory ORACLE_HOME/OPatch exist.
(3) Please unzip the OPatch downloaded zip into ORACLE_HOME directory.
To check the version of the opatch utility installed in the above step,
go to the OPatch directory and run "opatch version".
将原ORACLE_HOME目录下的OPatch目录备份,并解压新的OPatch程序,操作步骤如下:
[oracle@ogg1 db_1]$ export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[oracle@ogg1 db_1]$ cd $ORACLE_HOME/
[oracle@ogg1 db_1]$ mv OPatch/ OPatchbk
[oracle@ogg1 db_1]$ unzip p6880880_112000_Linux-x86-64.zip
[oracle@ogg1 db_1]$ opatch version
OPatch Version: 11.2.0.3.18
三、更新PSU
1、更新操作
[oracle@ogg1 soft]$ export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[oracle@ogg1 soft]$ unzip p26925576_112040_Linux-x86-64.zip
[oracle@ogg1 soft]$ cd /26925576
[oracle@ogg1 26925576]$ opatch apply
更新中根据提示完成。
2、检查更新
[oracle@ogg1 26925576]$ opatch lspatches --查看补丁集
26925576;Database Patch Set Update : 11.2.0.4.180116 (26925576)
OPatch succeeded.
[oracle@ogg1 26925576]$ opatch lsinventory --查看补丁清单
Oracle Interim Patch Installer version 11.2.0.3.18
Copyright (c) 2018, Oracle Corporation. All rights reserved.
Oracle Home : /u01/oracle/product/11.2.0/db_1
Central Inventory : /u01/oraInventory
from : /u01/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version : 11.2.0.3.18
OUI version : 11.2.0.4.0
Log file location : /u01/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2018-03-14_17-15-03PM_1.log
Lsinventory Output file location : /u01/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2018-03-14_17-15-03PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ogg1
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 26925576 : applied on Wed Mar 14 16:48:49 CST 2018
Unique Patch ID: 21773885
Patch description: "Database Patch Set Update : 11.2.0.4.180116 (26925576)"
Created on 5 Dec 2017, 05:23:24 hrs PST8PDT
Sub-patch 26392168; "Database Patch Set Update : 11.2.0.4.171017 (26392168)"
Sub-patch 26609445; "Database Patch Set Update : 11.2.0.4.170814 (26609445)"
Sub-patch 25869727; "Database Patch Set Update : 11.2.0.4.170718 (25869727)"
Sub-patch 24732075; "Database Patch Set Update : 11.2.0.4.170418 (24732075)"
Sub-patch 24006111; "Database Patch Set Update : 11.2.0.4.161018 (24006111)"
Sub-patch 23054359; "Database Patch Set Update : 11.2.0.4.160719 (23054359)"
Sub-patch 22502456; "Database Patch Set Update : 11.2.0.4.160419 (22502456)"
Sub-patch 21948347; "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch 21352635; "Database Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch 20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch 20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch 19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch 19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch 18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch 18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
Bugs fixed:
21174504, 17184721, 21538558, 16091637, 18092127, 17381384, 15979965
20671094, 16731148, 16314254, 13837378, 18441944, 17835048, 13558557
17008068, 17201159, 25427662, 17853498, 20717359, 17246576, 18356166
18681862, 18440047, 20569094, 20031873, 16875449, 20387265, 19788842
17296856, 21330264, 14010183, 17648596, 17551063, 17025461, 24719736
17267114, 22507210, 17912217, 17889583, 18202441, 17040764, 17478145
25655390, 16524926, 19358317, 22148226, 18747196, 26544823, 18641419
17036973, 18948177, 17811789, 16542886, 14285317, 18009564, 16618694
8322815, 16832076, 18247991, 16692232, 22507234, 17570240, 13871092
24624166, 17848897, 17441661, 14034426, 17465741, 16596890, 17437634
21343897, 20506706, 21453153, 18339044, 21795111, 22321741, 17951233
18430495, 21787056, 22380919, 19469538, 20506715, 17811429, 17903598
19721304, 18230522, 19554106, 19458377, 21281607, 17612828, 6599380
22092979, 22321756, 17040527, 17811438, 18641461, 14657740, 13364795
21387964, 19490948, 17346671, 17588480, 18235390, 26474853, 18849970
17889549, 19309466, 16472716, 20596234, 18331850, 18641451, 17344412
21179898, 19461270, 17546761, 24842886, 14521849, 18203835, 18203838
18964939, 18203837, 17313525, 22195457, 18139690, 16837842, 22296366
14106803, 17842825, 21352646, 22657942, 16360112, 20657441, 22195441
17389192, 26198926, 14565184, 17205719, 18440095, 22195448, 14354737
14764829, 13944971, 16571443, 21868720, 17186905, 17080436, 18673342
22905130, 17027426, 19972569, 19972568, 20144308, 19972566, 17282229
19972564, 16870214, 21629064, 19615136, 21354456, 17390431, 18762750
23007241, 16613964, 17957017, 18098207, 18471685, 19730508, 21538485
18264060, 17323222, 17754782, 17600719, 18317531, 17852463, 17596908
17655634, 27053456, 16228604, 20074391, 19972570, 18090142, 18996843
19854503, 16042673, 17835627, 20334344, 17393683, 18000422, 20861693
17551709, 26575788, 23315889, 20506699, 19006849, 18277454, 18456514
19174430, 17258090, 17174582, 25654936, 17242746, 16399083, 21132297
17824637, 22465352, 17762296, 22168163, 17397545, 16450169, 12364061
20067212, 18856999, 19211724, 19463893, 21343775, 19463897, 17853456
18673304, 20004021, 26030218, 21668627, 16194160, 17477958, 16538760
12982566, 24570598, 20828947, 20296213, 18259031, 18293054, 17610798
19699191, 23065323, 17311728, 18135678, 23294548, 16785708, 10136473
19777862, 22551446, 24560906, 17786518, 18315328, 18334586, 12747740
18096714, 19032867, 21641760, 18899974, 17390160, 17232014, 20598042
16422541, 18673325, 18155762, 14015842, 19827973, 22683225, 17726838
18554871, 23177648, 18051556, 20803583, 21972320, 15990359, 17922254
18282562, 16855292, 16668584, 21343838, 20299015, 17446237, 18093615
18043064, 23713236, 17694209, 17288409, 20475845, 17274537, 13955826
16934803, 17634921, 17501491, 16315398, 22683212, 17006183, 13829543
18191164, 22809871, 17655240, 26746894, 18384391, 19393542, 21538567
16198143, 21847223, 25823754, 17892268, 20142975, 19584068, 25165496
17165204, 21756699, 18508861, 16901385, 18554763, 21532755, 18189036
17443671, 17385178, 17936109, 14829250, 20925795, 20509482, 17478514
16850630, 13951456, 16595641, 14054676, 15861775, 21142837, 16912439
17299889, 23003979, 17297939, 18619917, 16833527, 17798953, 17816865
18607546, 17571306, 21286665, 17341326, 26910644, 17851160, 20558005
17586955, 19049453, 21051840, 17587063, 16956380, 18328509, 25423453
14133975, 18061914, 18522509, 21051833, 18765602, 20860659, 20324049
18199537, 17332800, 13609098, 22502493, 18384537, 14338435, 17945983
16392068, 21067387, 17752995, 21051862, 16863422, 25505382, 17237521
18244962, 19544839, 24433711, 24717859, 17156148, 18973907, 23026585
17877323, 17449815, 18180390, 17088068, 17037130, 20004087, 21422580
19466309, 25505371, 11733603, 18084625, 21051858, 18674024, 21051852
18091059, 25369547, 16306373, 18306996, 18193833, 19915271, 17787259
20513399, 20631274, 25879656, 16344544, 14692762, 18614015, 17346091
18228645, 17721717, 18436307, 21756677, 19888853, 11883252, 17891943
19475971, 22353199, 16384983, 19121551, 12816846, 17982555, 17761775
22243719, 17265217, 25505394, 17071721, 16721594, 21756661, 18262334
15913355, 17891946, 17672719, 17602269, 17239687, 17042658, 17238511
17811456, 17284817, 17752121, 20879889, 21380789, 17394950, 16579084
17011832, 22195465, 14602788, 18325460, 26569225, 24476265, 24476274
12611721, 16903536, 17006570, 19689979, 16043574, 18783224, 24662775
16494615, 21526048, 19197175, 16069901, 17811447, 17308789, 24835538
22195477, 17865671, 19013183, 17343514, 17325413, 18316692, 16180763
17348614, 14368995, 21983325, 17393915, 16285691, 19211433, 20331945
17883081, 24316947, 17705023, 17614227, 19578350, 22195485, 14084247
13645875, 16777840, 19727057, 14852021, 18744139, 18674047, 17716305
19285025, 18482502, 17622427, 19289642, 22195492, 25947799, 14458214
20869721, 21172913, 17767676, 18723434, 25505407, 17786278, 19258504
17082983, 21351877, 17365043, 13498382, 18331812, 16065166, 25489607
16685417, 18031668, 22893153, 16943711, 19272701, 21517440, 25897615
17649265, 13866822, 18094246, 24528741, 17783588, 14245531, 17082359
20448824, 18280813, 23330119, 16268425, 25600421, 18018515, 17302277
17215560, 24411921, 19271443, 25764020, 17016369, 20777150, 16756406
23330124, 20441797, 19769489, 17545847, 25093656, 18260550, 13853126
17227277, 23536835, 25957038, 24652769, 19207117, 9756271, 18868646
17614134, 26667023, 17546973, 18704244, 19680952, 26667015, 17050888
18828868, 18273830, 17360606, 16992075, 17375354, 12905058, 18362222
21429602, 17571039, 17468141, 18436647, 17235750, 21168487, 16220077
16929165
--------------------------------------------------------------------------------
OPatch succeeded.
3、应用sql脚本
For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT
If the OJVM PSU was applied for a previous PSU patch, you may see invalid Java classes after execution of the catbundle.sql script in the previous step. If this is the case, run utlrp.sql to re-validate these Java classes.
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
4、查看更新结果
SQL> set linesize 500
SQL> select ACTION_TIME, ACTION, COMMENTS from sys.DBA_REGISTRY_HISTORY;
ACTION_TIME ACTION COMMENTS
--------------------------------------------------------------------------- ------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
24-AUG-13 12.03.45.119862 PM APPLY Patchset 11.2.0.2.0
13-MAR-18 07.11.46.135922 PM APPLY Patchset 11.2.0.2.0
14-MAR-18 05.06.09.494514 PM APPLY PSU 11.2.0.4.180116 ===此处为更新后增加的
3 rows selected.
查看各项组件是否正常
SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;
COMP_ID COMP_NAME VERSION STATUS
------------------------------ -------------------------------------------------- -------------------- ----------------------
OWB OWB 11.2.0.4.0 VALID
APEX Oracle Application Express 3.2.1.00.12 VALID
EM Oracle Enterprise Manager 11.2.0.4.0 VALID
AMD OLAP Catalog 11.2.0.4.0 VALID
SDO Spatial 11.2.0.4.0 VALID
ORDIM Oracle Multimedia 11.2.0.4.0 VALID
XDB Oracle XML Database 11.2.0.4.0 VALID
CONTEXT Oracle Text 11.2.0.4.0 VALID
EXF Oracle Expression Filter 11.2.0.4.0 VALID
RUL Oracle Rules Manager 11.2.0.4.0 VALID
OWM Oracle Workspace Manager 11.2.0.4.0 VALID
CATALOG Oracle Database Catalog Views 11.2.0.4.0 VALID
CATPROC Oracle Database Packages and Types 11.2.0.4.0 VALID
JAVAVM JServer JAVA Virtual Machine 11.2.0.4.0 VALID
XML Oracle XDK 11.2.0.4.0 VALID
CATJAVA Oracle Database Java Packages 11.2.0.4.0 VALID
APS OLAP Analytic Workspace 11.2.0.4.0 VALID
XOQ Oracle OLAP API 11.2.0.4.0 VALID
18 rows selected.