oracle打补丁

升级Opatch

选择操作系统版本进行下载,进入目录中执行opatch apply,

[oracle@emrep11 24006111]$ /u01/app/oracle/11.2.0.4/dbhome_1/OPatch/opatch apply
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.
Oracle Home       : /u01/app/oracle/11.2.0.4/dbhome_1
Central Inventory : /u01/app/oracle/oraInventory
   from           : /u01/app/oracle/11.2.0.4/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/11.2.0.4/dbhome_1/cfgtoollogs/opatch/opatch2016-11-25_19-06-21PM_1.log
Verifying environment and performing prerequisite checks...
Prerequisite check "CheckMinimumOPatchVersion" failed.
The details are:
The OPatch being used has version 11.2.0.3.4 while the following patch(es) require higher versions: 
Patch 17478514 requires OPatch version 11.2.0.3.5.
Patch 18031668 requires OPatch version 11.2.0.3.5.
Patch 18522509 requires OPatch version 11.2.0.3.5.
Patch 19121551 requires OPatch version 11.2.0.3.5.
Patch 19769489 requires OPatch version 11.2.0.3.5.
Patch 20299013 requires OPatch version 11.2.0.3.5.
Patch 20760982 requires OPatch version 11.2.0.3.5.
Patch 21352635 requires OPatch version 11.2.0.3.5.
Patch 21948347 requires OPatch version 11.2.0.3.5.
Patch 22502456 requires OPatch version 11.2.0.3.5.
Patch 23054359 requires OPatch version 11.2.0.3.5.
Patch 24006111 requires OPatch version 11.2.0.3.5.
Please download latest OPatch from My Oracle Support.
UtilSession failed: Prerequisite check "CheckMinimumOPatchVersion" failed.
Log file location: /u01/app/oracle/11.2.0.4/dbhome_1/cfgtoollogs/opatch/opatch2016-11-25_19-06-21PM_1.log
OPatch failed with error code 73
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29

提示patch安装需要OPatch的版本是11.2.0.3.5,使用OPatch version查看当前版本是11.2.0.3.4,所以第一步需要升级OPatch。

[oracle@emrep11 ~]$ /u01/app/oracle/11.2.0.4/dbhome_1/OPatch/opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
如下选择对应操作系统版本,下载OPatch,p17836989_112000_Linux-x86-64.zip, 
补丁程序17836989: OPatch patch of version 11.2.0.3.5 for Oracle software releases 11.2.0.x (NOV 2013) 
这里写图片描述

解压缩,并复制至$ORACLE_HOME下,可以提前备份下旧版的OPatch。再执行OPatch version,

[oracle@emrep11 ~]$ /u01/app/oracle/11.2.0.4/dbhome_1/OPatch/opatch version
OPatch Version: 11.2.0.3.6
OPatch succeeded.

进入补丁包的解压目录

cd /u01/app/oracle/product/11.2.0/db_1/OPatch/OPatch/19918718
运行打补丁
[oracle@oracleplus 19918718]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/OPatch/opatch apply
Oracle 中间补丁程序安装程序版本 11.2.0.3.6
版权所有 (c) 2013, Oracle Corporation。保留所有权利。
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.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/19918718_May_16_2018_15_49_25/apply2018-05-16_15-49-25下午_1.log
Applying interim patch '19918718' to OH '/u01/app/oracle/product/11.2.0/db_1'
Verifying environment and performing prerequisite checks...
Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/19918718_May_16_2018_15_49_25/apply2018-05-16_15-49-25下午_1.log
Recommended actions: There are missing system commands that OPatch needs to proceed patching.
OPatch failed with error code 37

问题1:error code 37
Missing command :fuser
解决:
[root@oracleplus ~]# yum install -y psmisc


问题2:error code 41

。。。。。。

Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:
Following executables are active :

/u01/app/oracle/product/11.2.0/db_1/bin/oracle

。。。。。。

解决:
SQL> shutdown immediate
[oracle@oracleplus ~]$ ps -ef | grep ora
root      3026  3009  0 14:05 pts/0    00:00:00 su - oracle
oracle    3027  3026  0 14:05 pts/0    00:00:00 -bash
root      3075  3058  0 14:09 pts/1    00:00:00 su - oracle
oracle    3076  3075  0 14:09 pts/1    00:00:00 -bash
root      3248  3151  0 14:57 pts/3    00:00:00 su - oracle
oracle    3249  3248  0 14:57 pts/3    00:00:00 -bash
root      3975  3123  0 15:54 pts/2    00:00:00 su - oracle
oracle    3976  3975  0 15:54 pts/2    00:00:00 -bash
oracle    4174  3976  0 15:58 pts/2    00:00:00 ps -ef
oracle    4175  3976  0 15:58 pts/2    00:00:00 grep --color=auto ora

再继续成功
请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/u01/app/oracle/product/11.2.0/db_1')

本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing up files...
正在为组件 oracle.rdbms, 11.2.0.4.0 打补丁...
Verifying the update...
Patch 19918718 successfully applied
Log file location: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/19918718_May_16_2018_15_59_08/apply2018-05-16_15-59-08下午_1.log
OPatch succeeded.
检查安装情况
[oracle@oracleplus 19918718]$ /u01/app/oracle/product/11.2.0/db_1/OPatch/OPatch/opatch lsinv
Oracle 中间补丁程序安装程序版本 11.2.0.3.6
版权所有 (c) 2013, Oracle Corporation。保留所有权利。
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.6
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2018-05-16_16-01-34下午_1.log
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2018-05-16_16-01-34下午.txt
--------------------------------------------------------------------------------
已安装的顶级产品 (1):
Oracle Database 11g                                                  11.2.0.4.0
此 Oracle 主目录中已安装 1 个产品。
中间补丁程序 (1) :
Patch  19918718     : applied on Wed May 16 16:00:23 CST 2018
Unique Patch ID:  18329634
   Created on 4 Dec 2014, 10:44:29 hrs PST8PDT
   Bugs fixed:
     19918718
--------------------------------------------------------------------------------
OPatch succeeded.
可以看出已安装了相应的patch。

总结: 
1.要了解Oracle Patch补丁体系中,各种类型补丁的关系、适用范围,这样才能在需要打补丁的时候选择正确的补丁并完成安装步骤了。 
2.某些补丁要求最低的OPatch版本,OPatch的升级仅需要下载对应操作系统版本的OPatch压缩包,直接解压缩至$ORACLE_HOME即可,以防万一可以备份之前的OPatch。 
3.OPatch有一系列的命令参数,可以查看帮助继续了解,例如有些补丁可以不用停机,在线打使用online参数。

猜你喜欢

转载自blog.csdn.net/cuiyan1982/article/details/80338826