暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ORACLE 12cR2单机补丁升级

数据库这点小事 2019-11-11
592

数据库版本:12.2.0.1

补丁包:p26609817_122010_Linux-x86-64.zip

一·环境检查

为了保证打补丁,需要先设置可执行权限的路径


export PATH=$PATH:/usr/ccs/bin


检查psu是否有冲突

unzip p26609817_122010_Linux-x86-64.zip


避免权限问题,解压出来的文件给了777权限


chmod -R 777 26609817/

检查psu冲突,在oracle用户下

cd 26609817
[oracle@DB-DW-0-75 26609817]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./Oracle Interim Patch Installer version 12.2.0.1.6Copyright (c) 2017, Oracle Corporation.  All rights reserved.PREREQ sessionOracle Home       : oracle/app/oracle/product/12.2.0/db_1Central Inventory : oracle/app/oraInventory   from           : oracle/app/oracle/product/12.2.0/db_1/oraInst.locOPatch version    : 12.2.0.1.6OUI version       : 12.2.0.1.4Log file location : oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-30-58PM_1.logInvoking prereq "checkconflictagainstohwithdetail"Prereq "checkConflictAgainstOHWithDetail" passed.OPatch succeeded.



二·补丁安装

oracle 单机模式下


[oracle@DB-DW-0-75 26609817]$ opatch applyOracle Interim Patch Installer version 12.2.0.1.6Copyright (c) 2017, Oracle Corporation.  All rights reserved.Oracle Home       : oracle/app/oracle/product/12.2.0/db_1Central Inventory : oracle/app/oraInventory   from           : oracle/app/oracle/product/12.2.0/db_1/oraInst.locOPatch version    : 12.2.0.1.6OUI version       : 12.2.0.1.4Log file location : oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-42-20PM_1.logVerifying environment and performing prerequisite checks...OPatch continues with these patches:   26609817Do you want to proceed? [y|n]yUser Responded with: YAll checks passed.Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.(Oracle Home = '/oracle/app/oracle/product/12.2.0/db_1')Is the local system ready for patching? [y|n]yUser Responded with: YBacking up files...Applying interim patch '26609817' to OH '/oracle/app/oracle/product/12.2.0/db_1'Patching component oracle.oracore.rsf, 12.2.0.1.0...Patching component oracle.ctx, 12.2.0.1.0...Patching component oracle.rdbms.deconfig, 12.2.0.1.0...Patching component oracle.rdbms.rsf, 12.2.0.1.0...Patching component oracle.rdbms.rman, 12.2.0.1.0...Patching component oracle.rdbms, 12.2.0.1.0...Patching component oracle.rdbms.util, 12.2.0.1.0...Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...Patching component oracle.tfa, 12.2.0.1.0...Patching component oracle.rdbms.rsf.ic, 12.2.0.1.0...Patch 26609817 successfully applied.Log file location: oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-42-20PM_1.logOPatch succeeded.

在数据库中执行修改的sql

sqlplus nologSQL>startupSQL>exitcd $ORACLE_HOME/OPatch./datapatch -verbose


执行成功后,可以在dba_registry_sqlpatch视图中看到psu的信息

处理OJVM patche

SQL > @dbmsjdev.sqlSQL > exec dbms_java_dev.disable


遇到的问题:

1.psu冲突检查不通过


[oracle@DB-DW-0-75 ~]$ oracle/app/oracle/product/12.2.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./Oracle Interim Patch Installer version 12.2.0.1.6Copyright (c) 2017, Oracle Corporation.  All rights reserved.PREREQ sessionOracle Home       : oracle/app/oracle/product/12.2.0/db_1Central Inventory : oracle/app/oraInventory   from           : oracle/app/oracle/product/12.2.0/db_1/oraInst.locOPatch version    : 12.2.0.1.6OUI version       : 12.2.0.1.4Log file location : oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-23-51PM_1.logInvoking prereq "checkconflictagainstohwithdetail"Prereq "checkConflictAgainstOHWithDetail" is not executed.The details are:Unable to create Patch Object.Exception occured : PatchObject constructor: Input file "/home/oracle/.java/etc/config/actions" or "/home/oracle/.java/etc/config/inventory" does not exist.OPatch failed with error code 2



原因:没有设置可执行权限路径

设置路径

export PATH=$PATH:/usr/ccs/bin

重新检查,成功

2.打补丁包不通过


[oracle@DB-DW-0-75 26609817]$ opatch applyOracle Interim Patch Installer version 12.2.0.1.6Copyright (c) 2017, Oracle Corporation.  All rights reserved.Oracle Home       : oracle/app/oracle/product/12.2.0/db_1Central Inventory : oracle/app/oraInventory   from           : oracle/app/oracle/product/12.2.0/db_1/oraInst.locOPatch version    : 12.2.0.1.6OUI version       : 12.2.0.1.4Log file location : oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-39-32PM_1.logVerifying environment and performing prerequisite checks...Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
UtilSession failed:
Prerequisite check "CheckSystemCommandAvailable" failed.
Log file location: /oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-39-32PM_1.log



解决方式:

检查日志/oracle/app/oracle/product/12.2.0/db_1/cfgtoollogs/opatch/opatch2017-09-20_16-39-32PM_1.log,发现其中有一段:


[Sep 20, 2017 4:32:14 PM]    Missing command :fuser
[Sep 20, 2017 4:32:14 PM] Prerequisite check "CheckSystemCommandAvailable" failed.
The details are:
Missing command :fuser
[Sep 20, 2017 4:32:14 PM] OUI-67073:UtilSession failed:
Prerequisite check "CheckSystemCommandAvailable" failed.


使用find在服务器上查找fuser命令,没有找到,使用yum search fuser查找相关包   

[root@DB-DW-0-75 ~]# yum search fuser
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
=============================================== Matched: fuser ================================================
dislocker.x86_64 : Utility to access BitLocker encrypted volumes
fuse-dislocker.x86_64 : FUSE filesystem to access BitLocker encrypted volumes
psmisc.x86_64 : Utilities for managing processes on your system

 

缺少psmisc.x86_64包,安装


[root@DB-DW-0-75 ~]# yum install psmisc


包安装完之后,重新打补丁,成功。


文章转载自数据库这点小事,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论