补丁流程"/>
Oracle OPatch工具部署PSU补丁流程
文章目录
- [注意事项]
- [适用范围]
- [操作步骤]
- 1. 下载与准备
- 2. 安装与检查
- [常见问题]
- [更新时间]
[注意事项]
- Opatch只针对PSU(Patch Set Update)补丁,不支持PSR(PatchSet Release)方式。
- Oracle补丁程序必须要具备有效的CSI Support官方年度运维才可以进行下载。
- PSU补丁 README.html 自述文件必须要仔细阅读反复阅读!
[适用范围]
- Oracle 11g (亲测)
- Oracle 12c (亲测)
- Oracle 18c (没有部署,但应该可行)
- Oracle 19c (亲测)
[操作步骤]
1. 下载与准备
- 登录MY Oracle Support网站,点击[补丁程序和更新程序],输入相关信息
- 产品:Oracle Database – Standard Edition
- 发行版:选择需要下载的版本(列表中将包含所有补丁版本)
- 检索结果通常选择[Windows DB Bundle Patch]最新版本,点击[补丁程序名]确认补丁信息
- 检查补丁信息并点击[下载]
- 解压PSU补丁包
解压路径:C:\Users\Administrator\Downloads\p26406331_121020_MSWIN-x86-64\
2. 安装与检查
- Windows环境量设置
set ORACLE_HOME=C:\app\oracledb\product\12.1.0\dbhome_1
set PATH=%ORACLE_HOME%\OPatch;%PATH%
set PATH=%ORACLE_HOME%\perl\bin;%PATH%
-
关闭数据库
Windows系统还需要手工关闭Services服务!
-
查看要安装的补丁和现有补丁是否存在冲突
cd C:\Users\Administrator\Downloads\p26406331_121020_MSWIN-x86-64\26406331
opatch prereq CheckConflictAgainstOHWithDetail -ph . -
OPatch补丁安装
opatch apply
PSU补丁部署完成
- OPatch 补丁确认
opatch lsinventory
※ 如果此时仍未构筑数据库,则无需操作如下步骤。
- 数据字典更新
※ 手工启动Windows服务
Oracle 11g方法
sqlplus / as sysdba
startup upgrade
@?/rdbms/admin/catbundle.sql psu apply
※ 如果PSU 是overlay PSU,比如10.2.0.4.8,则需要执行@catbundle.sql opsu apply,同样这些在README.html 中都有详细描述。
Oracle 12c或以上
sqlplus / as sysdba
startup upgrade
alter pluggable database all open upgrade;
quit
cd $ORACLE_HOME\OPatch
datapatch -verbose
- 检查数据字典状态
select * from dba_registry_history;
- 检查无效对象状态
# 无效数据库组件
select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY where status<>'VALID';
# 无效数据库对象
select owner,object_name,object_type,status from dba_objects where status<>'VALID';
※ 所有对象重编译方法:
@?/rdbms/admin/utlrp.sql
- 查询版本信息
select PATCH_ID,PATCH_TYPE,ACTION,STATUS,SOURCE_VERSION from dba_registry_sqlpatch;
[常见问题]
1.OPatch版本不满足要求
Oracle Home : C:\app\Administrator\product\11.2.0\dbhome_1
Central Inventory : C:\Program Files\Oracle\Inventoryfrom : n/a
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location : C:\app\Administrator\product\11.2.0\dbhome_1\cfgtoollogs\opa
tch\28761877_Aug_20_2019_11_28_09\apply2019-08-20_11-28-09上午_1.logApplying interim patch '28761877' to OH 'C:\app\Administrator\product\11.2.0\dbh
ome_1'
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) requi
re higher versions:
Patch 28761877 requires OPatch version 11.2.0.3.5.
Please download latest OPatch from My Oracle Support.Log file location: C:\app\Administrator\product\11.2.0\dbhome_1\cfgtoollogs\opat
ch\28761877_Aug_20_2019_11_28_09\apply2019-08-20_11-28-09上午_1.logRecommended actions: Please download latest OPatch from My Oracle Support by Pat
ch 6880880, release version (as appropriate) and appropriate platform.OPatch failed with error code = 31
解决方案:根据系统提示下载OPatch版本并安装。OPatch安装只需要复制到指定目录覆盖即可。
[更新时间]
2020/03/06 钟艺东 => 文档更新
更多推荐
Oracle OPatch工具部署PSU补丁流程
发布评论