一、准备工作
1,数据库环境
操作系统版本   : Redhat 6.5 x64
数据库版本     : Oracle 11.2.0.4 x64
Oracle database: 11.2.0.4
2,准备内容
OPatch : p6880880_112000_Linux-x86-64.zip
DB PSU : p21352635_112040_Linux-x86-64.zip 仅单实例使用。
OPatch下载地址:
https://updates.oracle.com/download/6880880.html
说明:GI PSU包括DB PSU,CPU。

二、更新OPatch版本,必须要更新
1. 更新OPatch版本,需要更新到11.2.0.3.11,OPatch直接压缩替换就可以了。
 (1) 上传p6880880_112000_Linux-x86-64.zip到/u01/software目录下, /u01/software给777权限,也可以采用/tmp目录。
(2) root用户下将原OPatch目录改名。
# mv /u01/app/oracle/product/11.2.0/db_1/OPatch /u01/app/oracle/product/11.2.0/db_1/OPatchBK

2. oracle目录OPatch替换
(1) root用户
cd /u01/software/
chown oracle:oinstall p6880880_112000_Linux-x86-64.zip

(2) oracle用户
su - oracle
cd /u01/software/
unzip p6880880_112000_Linux-x86-64.zip

(3) root用户
cd /u01/software/
mv OPatch /u01/app/oracle/product/11.2.0/db_1/

(4) oracle用户测试
su - oracle
$/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch version
OPatch Version: 11.2.0.3.11
OPatch succeeded.

3. 测试兼容性, 之前没有打过,这步也可以忽略。
su - oracle
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/21352635 -oh $ORACLE_HOME
----------------------------------------------------
Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, Oracle Corporation.  All rights reserved.

PREREQ session
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.11
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-12-20_15-01-26PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
----------------------------------------------------

五、打database PSU补丁

1. 准备工作

(1) Root用户下,重新给PSU补丁包赋予权限
cd /u01/software/
chown oracle:oinstall p21523375_112040_Linux-x86-64.zip

(2) oracle用户
su - oracle
cd /u01/software/
unzip p21352635_112040_Linux-x86-64.zip

(3) Oracle用户下检查兼容性
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/21352635 -oh $ORACLE_HOME
----------------------------------------------------
Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/11.2.0/grid/oraInst.loc
OPatch version    : 11.2.0.3.11
OUI version       : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2015-12-18_16-21-46PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
----------------------------------------------------

2. 关闭数据库
sqlplus / as sysdba;
shutdown immediate;

3. oracle database打补丁
su - oracle
$/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/software/21352635

Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, 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.11
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-12-20_15-05-41PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   17478514  18031668  18522509  19121551  19769489  20299013  20760982  21352635 

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/db_1')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u01/app/oracle/product/11.2.0/db_1'

Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.sdo, 11.2.0.4.0...
Patching component oracle.sysman.agent, 10.2.0.4.5...
Patching component oracle.xdk, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.sdo.locator, 11.2.0.4.0...
Patching component oracle.nlsrtl.rsf, 11.2.0.4.0...
Patching component oracle.xdk.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Verifying the update...
Applying sub-patch '18031668' to OH '/u01/app/oracle/product/11.2.0/db_1'
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.ldap.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.crs, 11.2.0.4.0...
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.ldap.rsf.ic, 11.2.0.4.0...
Patching component oracle.rdbms.deconfig, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Verifying the update...
Applying sub-patch '18522509' to OH '/u01/app/oracle/product/11.2.0/db_1'
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.rdbms.deconfig, 11.2.0.4.0...
Verifying the update...
Applying sub-patch '19121551' to OH '/u01/app/oracle/product/11.2.0/db_1'
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.sysman.console.db, 11.2.0.4.0...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.ordim.client, 11.2.0.4.0...
Patching component oracle.ordim.jai, 11.2.0.4.0...

Verifying the update...
Applying sub-patch '19769489' to OH '/u01/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.sysman.agent, 11.2.0.4.0 ]  not present in the Oracle Home or a higher version is found.
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.ovm, 11.2.0.4.0...
Patching component oracle.xdk, 11.2.0.4.0...
Patching component oracle.rdbms.util, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...
Patching component oracle.xdk.parser.java, 11.2.0.4.0...
Patching component oracle.oraolap, 11.2.0.4.0...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.xdk.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Patching component oracle.rdbms.deconfig, 11.2.0.4.0...

Verifying the update...
Applying sub-patch '20299013' to OH '/u01/app/oracle/product/11.2.0/db_1'
Patching component oracle.rdbms.dv, 11.2.0.4.0...
Patching component oracle.rdbms.oci, 11.2.0.4.0...
Patching component oracle.precomp.common, 11.2.0.4.0...
Patching component oracle.sysman.agent, 10.2.0.4.5...
Patching component oracle.xdk, 11.2.0.4.0...
Patching component oracle.sysman.common, 10.2.0.4.5...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 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.common.core, 10.2.0.4.5...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Patching component oracle.rdbms.deconfig, 11.2.0.4.0...

Verifying the update...
Applying sub-patch '20760982' to OH '/u01/app/oracle/product/11.2.0/db_1'
Patching component oracle.sysman.console.db, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Verifying the update...
Applying sub-patch '21352635' to OH '/u01/app/oracle/product/11.2.0/db_1'
Patching component oracle.sysman.agent, 10.2.0.4.5...
Patching component oracle.rdbms.rsf, 11.2.0.4.0...
Patching component oracle.rdbms.rman, 11.2.0.4.0...
Patching component oracle.rdbms, 11.2.0.4.0...

Verifying the update...
Composite patch 21352635 successfully applied.
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-12-20_15-05-41PM_1.log
OPatch succeeded.

查看打补丁情况:
/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lsinv

Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, 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.11
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-12-20_15-14-09PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-12-20_15-14-09PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: testdb
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 11g                                                  11.2.0.4.0
here are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch  21352635     : applied on Sun Dec 20 15:11:43 CST 2015
Unique Patch ID:  19227862
Patch description:  "Database Patch Set Update : 11.2.0.4.8 (21352635)"
   Created on 1 Sep 2015, 07:49:44 hrs
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:
...(略)

/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lspatches

[oracle@testdb OPatch]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lspatches
21352635;Database Patch Set Update : 11.2.0.4.8 (21352635)
OPatch succeeded.

六、升级数据库数据字典
数据库启动,并加载修改SQL Files到数据库

$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sun Dec 20 15:29:02 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> startup

SQL> @?/rdbms/admin/catbundle.sql psu apply
中间等待过程。

执行完后我们可以查到PSU更新信息:
SQL>

set line 150
col ACTION_TIME for a30
col ACTION for a8
col NAMESPACE for a8
col VERSION for a10
col BUNDLE_SERIES for a5
col COMMENTS for a20
select * from dba_registry_history;

ACTION_TIME                    ACTION   NAMESPAC VERSION            ID BUNDL COMMENTS
------------------------------ -------- -------- ---------- ---------- ----- --------------------
24-AUG-13 12.03.45.119862 PM   APPLY    SERVER   11.2.0.4            0 PSU   Patchset 11.2.0.2.0
27-OCT-15 11.43.27.172237 AM   APPLY    SERVER   11.2.0.4            0 PSU   Patchset 11.2.0.2.0
20-DEC-15 03.19.26.562797 PM   APPLY    SERVER   11.2.0.4            8 PSU   PSU 11.2.0.4.8
3 rows selected.
SQL>
SQL>