Oracle 11gR2 PSU安装手册

说明:
1、安装11.2.0.4.1至11.2.0.4.8 psu,按照psu中readme.html中的步骤正常操作即可;

2、安装11.2.0.4.160119及11.2.0.4.160419 psu时,单机环境按照psu中readme.html中的步骤正常操作即可;

RAC环境中(后期每隔三个月出的新psu或许还存在此问题,除非oracle在新psu中修复此问题),在执行完opatch apply之后,需要关注$ORACLE_HOME/bin/oracle文件属组及权限已经改变,需要参考Database Will Not Mount: ORA-15025, ORA-27041, 'Permission denied', ORA-15081 (文档 ID 1378747.1)的方法解决;否则starup启动数据库将报错。

3、单机ASM环境中待测试。。。

PSU升级步骤详解:
一、升级psu前后环境说明(举例升级至11.2.0.4.160119

升级前版本:Oracle 11.2.0.4.5 RAC
升级后版本:Oracle 11.2.0.4.160119
二、数据库升级PSU前期准备工作
1、强烈建议升级前备份数据库
2、升级前检查RAC状态、OS日志、alert日志及集群件日志信息
3、重启RAC服务,确定RAC启动正常
4、安装此类补丁要求数据库版本大于某个版本(比如安装oracle 11.2.0.4.160419 psu需要先升级至11.2.0.4.4及以上版本),满足此要求,可正常安装此补丁。
三、升级Opatch
检查确认当前的OPatch版本是否满足psu补丁readme.html中规定的最低要求。
$ORACLE_HOME/OPatch/opatch lsinventory
建议使用“OPatch 11.2.0.3.6(p6880880_112000_Linux-x86-64)即可
四、升级psu前检查软件版本信息
SQL> select * from dba_registry_history;
五、升级psu前准备
RAC安装此psu前,需停止所有节点数据库实例、EM及退出所有sqlplus界面(否则将报错某些进程被占用or active)
grid$ srvctl stop database -d db_name
node1.oracle$ export ORACLE_UNQNAME=db_name
node1.oracle$ emctl stop dbconsole
单机环境安装此类psu,还需要停止监听程序:$ lsnrctl stop
六、使用如下命令检测psu是否有补丁冲突
(如若不存在冲突,继续以下步骤;如若存在,需重新下载新的superset补丁,必要时需联系ORACLE原厂协助判断补丁冲突问题及提供superset补丁下载。)
$unzip p****_112040_Linux-x86-64.zip
$ cd <PATCH_TOP_DIR>/p****
$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
七、升级psu补丁
$ cd <PATCH_TOP_DIR>/p****
$ <OPatch directory>/opatch apply
执行过程中会提示是否在RAC其他节点安装psu(在两个节点的RAC中执行opatch apply,在执行完第一个节点后会提示是否在第二个节点安装;在大于两个节点的RAC中执行opatch apply,在执行完第一个节点后会提示输入下一个需要安装psu的节点名字,而不是按1-2-3-4-...顺序安装)
执行opatch apply打补丁的过程日志(略):
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Verifying the update...
Applying sub-patch '21948347' to OH '/u02/app/oracle/product/11.2.0home_1'
ApplySession: Optional component(s) [ oracle.tfa, 11.2.0.4.0 ]  not present in the Oracle Home or a higher version is found.
Patching component oracle.sysman.agent, 10.2.0.4.5...
Patching component oracle.ovm, 11.2.0.4.0...
Patching component oracle.xdk, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.nlsrtl.rsf, 11.2.0.4.0...
Patching component oracle.xdk.parser.java, 11.2.0.4.0...
Patching component oracle.sysman.console.db, 11.2.0.4.0...
Patching component oracle.xdk.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.sysman.oms.core, 10.2.0.4.5...
Verifying the update...
...
Patching in rolling mode.
The node 'rac2' will be patched next.
Please shutdown Oracle instances running out of this ORACLE_HOME on 'rac2'.
(Oracle Home = '/u02/app/oracle/product/11.2.0home_1')
Is the node ready for patching? [y|n]
八、升级psu中(后)发现的问题
在执行opatch apply过程中,$ORACLE_HOME/bin下的oracle文件属组发生变化(由oracle:asmadmin变为oracle:oinstall)
[oracle@rac1 bin]$cd $ORACLE_HOME/bin
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Mar 16 02:55 oracle
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Mar 16 02:56 oracle
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Mar 16 02:57 oracle
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Mar 16 02:58 oracle
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle asmadmin 239626641 Mar 16 02:58 oracle      
[oracle@rac1 bin]$ ll oracle   <<<<<<--此时oracle文件属组由oracle:asmadmin变为oracle:oinstall
-rwsr-s--x 1 oracle oinstall 239820050 Mar 16 03:46 oracle
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle oinstall 239820050 Mar 16 03:46 oracle
[oracle@rac1 bin]$ 

九、执行完opatch apply后,此时启动两节点数据库均报错及解决,如下

SQL> startup

ORACLE instance started.
Total System Global Area 1252663296 bytes
Fixed Size                  2252824 bytes
Variable Size             452988904 bytes
Database Buffers          788529152 bytes
Redo Buffers                8892416 bytes
ORA-00205: error in identifying control file, check alert log for more info

后台alert日志报错如下:
Wed Mar 16 03:49:24 2016
Starting background process RSMN
Wed Mar 16 03:49:24 2016
RSMN started with pid=31, OS id=6430 
ORACLE_BASE from environment = /u02/app/oracle
Wed Mar 16 03:49:26 2016
ALTER DATABASE   MOUNT
NOTE: Loaded library: System 
ORA-15025: could not open disk "/dev/raw/raw4"
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
SUCCESS: diskgroup DATA was dismounted
ERROR: diskgroup DATA was not mounted
ORA-00210: cannot open the specified control file
ORA-00202: control file: '+DATA/orcl/controlfile/current.260.906535775'
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/controlfile/current.260.906535775
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-15040: diskgroup is incomplete
ORA-205 signalled during: ALTER DATABASE   MOUNT...
Wed Mar 16 03:49:33 2016
ALTER SYSTEM SET local_listener=' (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.115)(PORT=1521))' SCOPE=MEMORY SID='orcl1';

参考如下MOS文章:
Database Will Not Mount: ORA-15025, ORA-27041, 'Permission denied', ORA-15081 (文档 ID 1378747.1)

解决办法:
此时需要在grid用户下执行如下操作修改此文件的属组:
[root@rac1 bin]# su - grid
[grid@rac1 ~]$ cd $ORACLE_HOME/bin
[grid@rac1 bin]$ ./setasmgidwrap o=/u02/app/oracle/product/11.2.0home_1/bin/oracle
(注意:此处是$GRID_HOME/bin/setasmgidwrap o=$ORACLE_HOME/bin/oracle)
[grid@rac1 bin]$ exit
logout
[root@rac1 bin]# su - oracle
[oracle@rac1 ~]$ cd $ORACLE_HOME/bin
[oracle@rac1 bin]$ ll oracle
-rwsr-s--x 1 oracle asmadmin 239820050 Mar 16 03:48 oracle

[root@rac1 bin]# su - grid
[grid@rac1 ~]$ srvctl stop instance -d orcl -i orcl1 
[grid@rac1 ~]$ 
SQL> startup         --在两节点再次执行startup正常
ORACLE instance started.
Total System Global Area 1252663296 bytes
Fixed Size                  2252824 bytes
Variable Size             452988904 bytes
Database Buffers          788529152 bytes
Redo Buffers                8892416 bytes
Database mounted.
Database opened.
此时两节点数据库实例均启动成功。
十、验证补丁安装成功
[oracle@*** OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2016-03-23_10-25-31AM_1.log
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-03-23_10-25-31AM.txt
--------------------------------------------------------------------------------
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  21948347     : applied on Mon Mar 14 17:18:05 CST 2016
Unique Patch ID:  19564435
Patch description:  "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
   Created on 14 Dec 2015, 03:31:48 hrs PST8PDT
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:
     17288409, 21051852, 18607546, 17205719, 17811429, 17816865, 20506699
     17922254, 17754782, 16934803, 13364795, 17311728, 17441661, 17284817
     16992075, 17446237, 14015842, 19972569, 17449815, 21538558, 20925795
     17375354, 19463897, 17982555, 17235750, 13866822, 17478514, 18317531
     18235390, 14338435, 20803583, 13944971, 20142975, 17811789, 16929165
     18704244, 20506706, 17546973, 20334344, 14054676, 17088068, 18264060
     17346091, 17343514, 21538567, 19680952, 18471685, 19211724, 13951456
     21847223, 16315398, 18744139, 16850630, 19049453, 18673304, 17883081
     19915271, 18641419, 18262334, 17006183, 16065166, 18277454, 16833527
     10136473, 18051556, 17865671, 17852463, 18554871, 17853498, 18334586
     17588480, 17551709, 19827973, 17842825, 17344412, 18828868, 17025461
     11883252, 13609098, 17239687, 17602269, 19197175, 22195457, 18316692
     17313525, 12611721, 19544839, 18964939, 17600719, 18191164, 19393542
     17571306, 18482502, 20777150, 19466309, 17040527, 17165204, 18098207
     16785708, 17174582, 16180763, 17465741, 16777840, 12982566, 19463893
     22195465, 12816846, 16875449, 17237521, 19358317, 17811438, 17811447
     17945983, 18762750, 17184721, 16912439, 18061914, 17282229, 18331850
     18202441, 17082359, 18723434, 21972320, 19554106, 14034426, 18339044
     19458377, 17752995, 20448824, 17891943, 17258090, 17767676, 16668584
     18384391, 17040764, 17381384, 15913355, 18356166, 14084247, 20506715
     13853126, 18203837, 14245531, 21756699, 16043574, 22195441, 17848897
     17877323, 21453153, 17468141, 20861693, 17786518, 17912217, 17037130
     18155762, 16956380, 17478145, 17394950, 18189036, 18641461, 18619917
     17027426, 21352646, 16268425, 22195492, 19584068, 18436307, 17265217
     17634921, 13498382, 21526048, 20004087, 22195485, 17443671, 18000422
     22321756, 20004021, 17571039, 21067387, 16344544, 18009564, 14354737
     18135678, 18614015, 20441797, 18362222, 17835048, 16472716, 17936109
     17050888, 17325413, 14010183, 18747196, 17761775, 16721594, 17082983
     20067212, 21179898, 17302277, 18084625, 15990359, 18203835, 17297939
     17811456, 16731148, 21168487, 17215560, 13829543, 14133975, 17694209
     18091059, 17385178, 8322815, 17586955, 17201159, 17655634, 18331812
     19730508, 18868646, 17648596, 16220077, 16069901, 17348614, 17393915
     17274537, 17957017, 18096714, 17308789, 18436647, 14285317, 19289642
     14764829, 18328509, 17622427, 22195477, 16943711, 14368995, 17346671
     18996843, 17783588, 21343838, 16618694, 17672719, 18856999, 18783224
     17851160, 17546761, 17798953, 18273830, 22092979, 19972566, 16384983
     17726838, 17360606, 22321741, 13645875, 18199537, 16542886, 21787056
     17889549, 14565184, 17071721, 17610798, 20299015, 21343897, 20657441
     17397545, 18230522, 16360112, 19769489, 12905058, 18641451, 12747740
     18430495, 17042658, 17016369, 14602788, 17551063, 19972568, 21517440
     18508861, 19788842, 14657740, 17332800, 13837378, 19972564, 17186905
     18315328, 19699191, 17437634, 19006849, 19013183, 17296856, 18674024
     17232014, 16855292, 21051840, 14692762, 17762296, 17705023, 19121551
     21330264, 19854503, 19309466, 18681862, 18554763, 20558005, 17390160
     18456514, 16306373, 13955826, 18139690, 17501491, 21668627, 17299889
     17752121, 17889583, 18673325, 18293054, 17242746, 17951233, 17649265
     18094246, 19615136, 17011832, 16870214, 17477958, 18522509, 20631274
     16091637, 17323222, 16595641, 16524926, 18228645, 18282562, 17596908
     17156148, 18031668, 16494615, 17545847, 17655240, 17614134, 13558557
     17341326, 17891946, 17716305, 16392068, 19271443, 21351877, 18092127
     18440047, 17614227, 14106803, 16903536, 18973907, 18673342, 19032867
     17389192, 17612828, 16194160, 17006570, 17721717, 17570240, 17390431
     16863422, 18325460, 19727057, 16422541, 19972570, 17267114, 18244962
     21538485, 18765602, 18203838, 16198143, 17246576, 14829250, 17835627
     18247991, 14458214, 21051862, 16692232, 17786278, 17227277, 16042673
     16314254, 16228604, 16837842, 17393683, 17787259, 20331945, 20074391
     15861775, 16399083, 18018515, 21051858, 18260550, 17036973, 16613964
     17080436, 16579084, 18384537, 18280813, 20296213, 16901385, 15979965
     18441944, 16450169, 9756271, 17892268, 11733603, 16285691, 17587063
     21343775, 16538760, 18180390, 18193833, 21051833, 17238511, 17824637
     16571443, 18306996, 14852021, 18674047, 17853456, 12364061, 22195448
--------------------------------------------------------------------------------
OPatch succeeded.
十一、继续参考该补丁README.html,执行如下操作
(1) load modified SQL files into the database
$ sqlplus / as sysdba
SQL> STARTUP
SQL> @?/rdbms/admin/catbundle.sql psu apply
SQL> QUIT
(2)编译无效对象
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus / as sysdba
SQL> @?/rdbms/admin/utlrp.sql
十二、升级成功后验证数据库版本信息
SQL> select * from dba_registry_history;
此时查询结果中将会显示新版本的信息。
十三、执行完所有操作后务必检查确认RAC状态正常
grid$ crsctl stat res -t
检查确认所有节点的数据库alert_sid.log无报错信息。

PSU回退步骤:
因应用程序兼容性问题或者其他需求,亦或者安装psu过程中出现异常,需要去除(回退)高版本psu时,可按如下步骤:
一、关闭数据库相关服务
(1)Shut down all instances and listeners associated with the Oracle home that you are updating. For more information, see Oracle Database Administrator's Guide.
(2)Run the OPatch utility specifying the rollback argument as follows.
opatch rollback -id <psu_id>
二、启动数据库,执行回退脚本
1、Start all database instances running from the Oracle home. (For more information, see Oracle Database Administrator's Guide.)
For each database instance running out of the ORACLE_HOME, connect to the database using SQL*Plus as SYSDBA and run the rollback script as follows:
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle_PSU_<database SID>_ROLLBACK.sql
SQL> QUIT

In an Oracle RAC environment, the name of the rollback script will have the format catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql.

2、编译无效对象
在安装psu之前如果已经安装了新版本的OJVM,回退psu后,OJVM状态将变为INVALID,需要执行utlrp.sql脚本编译无效对象
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

三、执行完所有操作后务必检查确认RAC状态正常
grid$ crsctl stat res -t
检查确认所有节点的数据库alert_sid.log无报错信息。

你可能感兴趣的:(Oracle 11gR2 PSU安装手册)