最近生产上要给Oracle数据库打11g最新的补丁,这里先做一个测试记录一下。

Oracle数据库所有补丁的MOS文档ID 1922396.1下载地址:https://support.oracle.com/epmos/faces/DocContentDisplay?_afrLoop=242245405602967&id=1577380.1&_afrWindowMode=0&_adf.ctrl-state=zv36z4hoo_53这个下载需要有MOS账号

Oracle数据库的补丁有几种:PSU、SPU、CPU等,这次打的PSU24006111 (11.2.0.4.161018)

平台:OS Linux6.7 x86-64+Oracle 11.2.0.4.0单实例

升级方法已经在补丁包里的README.html文档里写的很清楚了,这里只是做个演示。

1、下载最新的的PSU包和最新的OPatch包,上传到服务器上

p24006111_112040_Linux-x86-64.zip

p6880880_112000_Linux-x86-64.zip

2、解压压缩包,并把OPatch替换原ORACLE_HOME里的OPatch目录

[oracle@rhel6 psu]$ unzip p24006111_112040_Linux-x86-64.zip
[oracle@rhel6 psu]$ unzip p6880880_112000_Linux-x86-64.zip
[oracle@rhel6 psu]$ ls -l |grep ^d
drwxrwxr-x 14 oracle oinstall      4096 Aug 26 21:56 24006111
drwxr-x--- 10 oracle oinstall      4096 Aug 18  2015 OPatch
[oracle@rhel6 psu]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
[oracle@rhel6 psu]$ mv OPatch/ $ORACLE_HOME

3、配置OPatch的环境变量

[oracle@rhel6 psu]$ vi ~/.bash_profile
#添加
export PATH=$PATH:$ORACLE_HOME/OPatch
[oracle@rhel6 psu]$ source ~/.bash_profile
[oracle@rhel6 psu]$ which opatch
/u02/app/oracle/product/11.2.4/db1/OPatch/opatch
#查看当前数据库的补丁情况
[oracle@rhel6 psu]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventoryfrom           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-45-47AM_1.logLsinventory Output file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/lsinv/lsinventory2016-12-20_10-45-47AM.txt--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rhel6
ARU platform id: 226
ARU platform description:: Linux x86-64Installed Top-level Products (1): Oracle Database 11g                                                  11.2.0.4.0
There are 1 products installed in this Oracle Home.There are no Interim patches installed in this Oracle Home.--------------------------------------------------------------------------------OPatch succeeded.

4、升级前检查是否有冲突

[oracle@rhel6 psu]$ cd 24006111/
[oracle@rhel6 24006111]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.PREREQ sessionOracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventoryfrom           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-49-53AM_1.logInvoking prereq "checkconflictagainstohwithdetail"Prereq "checkConflictAgainstOHWithDetail" passed.OPatch succeeded.

5、安装Patch包,单实例的数据库按如下方法打patch就可以了,如果是RAC则需要详细查看README.html

[oracle@rhel6 psu]$ cd 24006111/
[oracle@rhel6 24006111]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventoryfrom           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-53-13AM_1.logVerifying environment and performing prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:Following executables are active :
/u02/app/oracle/product/11.2.4/db1/bin/oracle
/u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1
UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
Log file location: /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-53-13AM_1.logOPatch failed with error code 73
#打补丁报错,查看日志
[oracle@rhel6 24006111]$ more /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_10-53-13AM_1.log
......
[Dec 20, 2016 10:53:21 AM]   Following executables are active :/u02/app/oracle/product/11.2.4/db1/bin/oracle/u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1
[Dec 20, 2016 10:53:21 AM]   Prerequisite check "CheckActiveFilesAndExecutables" failed.The details are:Following executables are active :/u02/app/oracle/product/11.2.4/db1/bin/oracle/u02/app/oracle/product/11.2.4/db1/lib/libclntsh.so.11.1
......
#这个错误的意思是检测到有命令正在运行,不能进行升级,停止数据库和监听
[oracle@rhel6 24006111]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 20 10:57:16 2016Copyright (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 optionssys@ORCL>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORCL>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@rhel6 24006111]$ lsnrctl stopLSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-DEC-2016 10:58:32Copyright (c) 1991, 2013, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The command completed successfully
[oracle@rhel6 24006111]$ ps -ef |grep ora
root      2361  2342  0 10:11 pts/0    00:00:00 su - oracle
oracle    2362  2361  0 10:11 pts/0    00:00:01 -bash
oracle    3409  2362  0 10:59 pts/0    00:00:00 ps -ef
oracle    3410  2362  0 10:59 pts/0    00:00:00 grep ora
#重新打补丁
[oracle@rhel6 24006111]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventoryfrom           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_11-18-32AM_1.logVerifying environment and performing prerequisite checks...
OPatch continues with these patches:   17478514  18031668  18522509  19121551  19769489  20299013  20760982  21352635  21948347  22502456  23054359  24006111  Do you want to proceed? [y|n]
y
User Responded with: YAll 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]:  yPlease shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u02/app/oracle/product/11.2.4/db1')Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u02/app/oracle/product/11.2.4/db1'
......
Composite patch 24006111 successfully applied.
Log file location: /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_11-18-32AM_1.logOPatch succeeded.

6、升级数据字典并重新编译无效对象

[oracle@rhel6 24006111]$ sqlplus / as sysdba
idle>startup
......
idle>@?/rdbms/admin/catbundle.sql psu apply
.......
idle>SPOOL off
idle>SET echo off
Check the following log file for errors:
/u02/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ORCL_APPLY_2016Dec20_11_30_47.log
#检查日志没有报错
#编译失效对象
sys@ORCL>@?/rdbms/admin/utlrp.sql
#检查升级情况
sys@ORCL>col action_time for a30
sys@ORCL>col action for a10
sys@ORCL>col namespace for a20
sys@ORCL>col version for a20
sys@ORCL>col bundle_series for a30
sys@ORCL>col comments for a30
sys@ORCL>select * from dba_registry_history;ACTION_TIME            ACTION     NAMESPACE        VERSION              ID BUNDLE_SERIES              COMMENTS
------------------------------ ---------- -------------------- -------------------- ---------- ------------------------------ ------------------------------
24-AUG-13 12.03.45.119862 PM   APPLY      SERVER           11.2.0.4              0 PSU                Patchset 11.2.0.2.0
07-JUL-16 11.03.29.165250 AM   APPLY      SERVER           11.2.0.4              0 PSU                Patchset 11.2.0.2.0
20-DEC-16 11.32.28.671654 AM   APPLY      SERVER           11.2.0.4         161018 PSU                PSU 11.2.0.4.161018
#使用opatch命令查看补丁情况
[oracle@rhel6 24006111]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation.  All rights reserved.Oracle Home       : /u02/app/oracle/product/11.2.4/db1
Central Inventory : /u01/app/oraInventoryfrom           : /u02/app/oracle/product/11.2.4/db1/oraInst.loc
OPatch version    : 11.2.0.3.12
OUI version       : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/opatch2016-12-20_11-52-01AM_1.logLsinventory Output file location : /u02/app/oracle/product/11.2.4/db1/cfgtoollogs/opatch/lsinv/lsinventory2016-12-20_11-52-01AM.txt--------------------------------------------------------------------------------
Local Machine Information::
Hostname: rhel6
ARU platform id: 226
ARU platform description:: Linux x86-64Installed 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  24006111     : applied on Tue Dec 20 11:24:30 CST 2016
Unique Patch ID:  20508568
Patch description:  "Database Patch Set Update : 11.2.0.4.161018 (24006111)"Created on 26 Aug 2016, 05:54:48 hrs PST8PDT
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:17288409, 21051852, 24316947, 17811429, 18607546, 17205719, 2050669917816865, 17922254, 23330119, 17754782, 16934803, 13364795, 1731172817441661, 17284817, 16992075, 17446237, 14015842, 19972569, 2175667717375354, 20925795, 21538558, 17449815, 19463897, 13866822, 1723575017982555, 17478514, 18317531, 14338435, 18235390, 20803583, 1394497120142975, 17811789, 16929165, 18704244, 20506706, 17546973, 2033434414054676, 17088068, 17346091, 18264060, 17343514, 21538567, 1968095218471685, 19211724, 13951456, 21847223, 16315398, 18744139, 1685063023177648, 19049453, 18673304, 17883081, 19915271, 18641419, 1826233417006183, 16065166, 18277454, 16833527, 10136473, 18051556, 1786567117852463, 18554871, 17853498, 18334586, 17551709, 17588480, 1982797317344412, 17842825, 18828868, 17025461, 11883252, 13609098, 1723968717602269, 19197175, 22195457, 18316692, 17313525, 12611721, 1954483918964939, 17600719, 18191164, 19393542, 17571306, 20777150, 1848250219466309, 22243719, 17040527, 17165204, 18098207, 16785708, 1746574117174582, 16180763, 16777840, 12982566, 19463893, 22195465, 2214822616875449, 12816846, 17237521, 6599380, 19358317, 17811438, 1781144717945983, 21983325, 18762750, 16912439, 17184721, 18061914, 1728222918331850, 18202441, 17082359, 18723434, 21972320, 19554106, 1403442618339044, 19458377, 17752995, 20448824, 17891943, 17258090, 1776767616668584, 18384391, 17040764, 17381384, 15913355, 18356166, 1408424720596234, 20506715, 21756661, 13853126, 18203837, 14245531, 1604357421756699, 22195441, 17848897, 17877323, 21453153, 17468141, 2086169317786518, 17912217, 17037130, 16956380, 18155762, 17478145, 1739495018641461, 18189036, 18619917, 17027426, 21352646, 16268425, 2447627422195492, 19584068, 18436307, 22507210, 17265217, 17634921, 1349838221526048, 19258504, 20004087, 17443671, 22195485, 18000422, 2232175620004021, 17571039, 21067387, 16344544, 18009564, 14354737, 2128666518135678, 18614015, 20441797, 18362222, 17835048, 16472716, 1793610917050888, 17325413, 14010183, 18747196, 17761775, 16721594, 1708298320067212, 21179898, 17302277, 18084625, 15990359, 18203835, 1729793917811456, 22380919, 16731148, 21168487, 14133975, 13829543, 1721556017694209, 17385178, 18091059, 8322815, 17586955, 17201159, 1765563418331812, 19730508, 18868646, 17648596, 16220077, 16069901, 1734861417393915, 17274537, 17957017, 18096714, 17308789, 18436647, 1428531719289642, 14764829, 18328509, 17622427, 16943711, 22195477, 1436899522502493, 17346671, 18996843, 17783588, 21343838, 16618694, 1767271918856999, 18783224, 17851160, 17546761, 17798953, 18273830, 2209297916596890, 19972566, 16384983, 17726838, 22296366, 17360606, 2232174113645875, 18199537, 16542886, 21787056, 17889549, 14565184, 1707172117610798, 20299015, 21343897, 22893153, 20657441, 17397545, 1823052216360112, 19769489, 12905058, 18641451, 12747740, 18430495, 1701636917042658, 14602788, 17551063, 19972568, 21517440, 18508861, 1978884214657740, 17332800, 13837378, 19972564, 17186905, 18315328, 1969919117437634, 22353199, 18093615, 19006849, 19013183, 17296856, 1867402417232014, 16855292, 17762296, 14692762, 21051840, 17705023, 2250723419121551, 21330264, 19854503, 21868720, 19309466, 18681862, 2055800518554763, 17390160, 18456514, 16306373, 13955826, 18139690, 1750149117752121, 21668627, 17299889, 17889583, 18673325, 19721304, 1829305417242746, 17951233, 18094246, 17649265, 19615136, 17011832, 1687021417477958, 18522509, 20631274, 16091637, 17323222, 16595641, 1652492618228645, 18282562, 17596908, 18031668, 17156148, 16494615, 2268322517545847, 17655240, 24528741, 17614134, 13558557, 17341326, 1789194617716305, 22657942, 16392068, 19271443, 21351877, 18092127, 1761422718440047, 16903536, 14106803, 18973907, 18673342, 19032867, 1738919217612828, 16194160, 17006570, 17721717, 17390431, 17570240, 1686342218325460, 19727057, 16422541, 19972570, 17267114, 18244962, 2153848518765602, 18203838, 16198143, 17246576, 14829250, 17835627, 1824799114458214, 21051862, 16692232, 17786278, 17227277, 24476265, 1604267316314254, 16228604, 16837842, 17393683, 23536835, 17787259, 2033194520074391, 15861775, 16399083, 18018515, 22683212, 18260550, 2105185817080436, 16613964, 17036973, 16579084, 24433711, 18384537, 1828081320296213, 16901385, 15979965, 23330124, 18441944, 16450169, 975627117892268, 11733603, 16285691, 17587063, 21343775, 18180390, 1653876018193833, 21387964, 21051833, 17238511, 17824637, 16571443, 1830699614852021, 17853456, 18674047, 12364061, 22195448--------------------------------------------------------------------------------OPatch succeeded.

7、升级失败回滚

opatch rollback -id 24006111

本文转自:http://blog.51cto.com/hbxztc/1884214

Oracle 11.2.0.4打PSU 11.2.0.4.161018相关推荐

  1. Oracle 11.2.0.3.7 PSU补丁升级

    说明:这是新上线主机,还没有建库的.如果库已经存在,那么最后还要进行刷库操作! 环境:Red Hat Enterprise Linux 6.4 (x86_64) 将Oracle数据库从11.2.0.3 ...

  2. 单机 Oracle 11g(11.2.0.4)手动打补丁PSU(11.2.0.4.8)

    环境说明: database : 11.2.0.4 x64 os: centos6.7 x64 准备内容: OPatch : p6880880_112000_Linux-x86-64.zip DB P ...

  3. oracle 11.2.0.3.4 psu 14275605 下载,Oracle RAC 11.2.0.3.2 升级 11.2.0.3.4

    Oracle RAC 11.2.0.3.2升级11.2.0.3.4 安装环境操作系统:RHEL6.264bitOracle Database版本:11.2.0.3.2Oracle Grid版本:11. ...

  4. Oracle Linux 6.9安装和Oracle 11.2.0.4.0安装及psu补丁升级

    原文有图图https://www.linuxidc.com/linux/2018-09/154218.htm 图文详解在Oracle Linux 6.9安装和Oracle 11.2.0.4.0安装及p ...

  5. Oracle Database Grid 11.2.0.4 最新 PSU

    Database 11.2.0.4 Proactive Patch Information (文档 ID 2285559.1)In this DocumentDetailsDatabase 11.2. ...

  6. oracle oui gi是什么,Oracle 11g RAC手动打GI PSU补丁(11.2.0.4.8)

    一.准备工作 1,数据库环境 操作系统版本   : Redhat 6.5 x64 数据库版本     : Oracle 11.2.0.4 x64 RAC Grid           : 11.2.0 ...

  7. 11.2.0.3.7 PSU补丁升级

    说明:这是新上线主机,还没有建库的.如果库已经存在,那么最后还要进行刷库操作呢! 环境:SUSE Linux Enterprise Server 11 sp1 (x86_64) 要求将数据库从11.2 ...

  8. 11g r2 rac 11.2.0.2升级11.2.0.2.3 [PSU patch 12419353]

    下载的补丁号为12419353(里面包含DB的11.2.0.2.3) 在这里选择手动打 操作前记得下载最先的opatch工具替换原$ORACLE_HOME/OPatch这个文件夹的内容(包含grid, ...

  9. Applying 11G R2 GI PSU 11.2.0.2.3

    GI PSU 11.2.0.2.3在最近的一次CPU July中被释出,该Patch Set Update包含了最新的CPU,且GI和Database PSU的都包含在其中,可以直接从<Patc ...

最新文章

  1. Linux--内存结构
  2. 哎!马上要涉水了,装修的水!
  3. 什么是SQL 注入?
  4. Python编程专属骚技巧3
  5. Single forest vs. multi-forest Active Directory design
  6. SAP Spartacus routing parameter mapping介绍
  7. 第十八节:跨域请求的解决方案和WebApi特有的处理方式
  8. 计算机组成原理补充实验,计算机组成原理实验补充实验指导-实.doc
  9. nginx的目录结构和配置文件
  10. python输入list_python学习(list增删改查、及常用方法)
  11. iOS-保存图片到(自定义)相册步骤
  12. linux7新建用户,CentOS 7中添加一个新用户并授权
  13. 用 3 只“鸽子”,告诉你闪电网络如何改变加密消息传递方式!
  14. COMSOL案例内容,有需要的了解下!
  15. 基于ssm框架实现的企业进销存管理系统【源码+数据库+毕设】
  16. java添加文本框和标签_如何在column.expression中插入文本框或标签的值?
  17. RPC框架简析--Pigeon
  18. 设计递归函数模拟汉诺塔游戏
  19. (十一)51单片机——用AT24C02实现存储秒表数据(附成果展示)
  20. 垃圾大学,想自学 Java 可以吗?难吗?毕业后能找到一份 6k左右的工作吗?

热门文章

  1. 计算机辅助设计基础及应用答案,计算机辅助设计基础与答案
  2. 利用elementUI上传图片和后台node.js操作完整过程
  3. 微信小程序期末大作业 中草药小程序 药海拾遗
  4. 网络安全2020年前景展望:九大未来的安全威胁
  5. Android自定义控件——获取验证码倒计时
  6. unity-菜单MenuItem的使用
  7. 口袋妖怪复刻怎么在电脑上玩 口袋妖怪复刻电脑版玩法教程
  8. php无法识别excel,求助!使用PHPExcel类读取Excel2007,出现错误
  9. wxParse多数据循环使用方法
  10. 虞书欣为什么这么有自信,而你却没有?