首页 > 数据库 > Oracle > 基于19c RAC的 RU补丁自动升级 标准化文档
自动RU补丁升级会牵扯到 关库关集群, 无需人为关库关集群,请注意
若建完实例后自动打补丁不需要将SQL文件加载到数据库中
上传
p30899722_190000_Linux-x86-64.zip
p6880880_190000_Linux-x86-64
解压,赋权
unzip p30899722_190000_Linux-x86-64.zip
chmod 775 -R 30899722
Grid:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30869156
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30894985
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30869304
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30898856
Oracle:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30869156
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir <UNZIPPED_PATCH_LOCATION>/30899722/30894985
检测成功
(2个节点的oracle、grid都要更新opatch)(本文补丁打至30899722,opatch版本最低需求为12.2.0.1.19)
opatch version
1,2 节点分别执行:
oracle:
cd $ORACLE_HOME
mv OPatch OPatch.bak
unzip p6880880_190000_Linux-x86-64 -d $ORACLE_HOME
解压grid会碰到$ORACLE_HOME属组问题,用root解压好,更改成grid属组
grid:
cd $ORACLE_HOME
mv OPatch OPatch.bak
unzip p6880880_190000_Linux-x86-64 -d $ORACLE_HOME
opatch lspatches
[root@rac1 OPatch]# ./opatchauto apply /oracle/soft/30899722
[root@rac2 OPatch]# ./opatchauto apply /oracle/soft/30899722
节点一成功
节点二失败:
错误一:
Start applying binary patch on home /oracle/grid/crs_1
Failed while applying binary patches on home /oracle/grid/crs_1
Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:
Patch Target : rac2->/oracle/grid/crs_1 Type[crs]
Details: [
---------------------------Patching Failed---------------------------------
Command execution failed during patching in home: /oracle/grid/crs_1, host: rac2.
Command failed: /oracle/grid/crs_1/OPatch/opatchauto apply /oracle/soft/30899722 -oh /oracle/grid/crs_1 -target_type cluster -binary -invPtrLoc /oracle/grid/crs_1/oraInst.loc -jre /oracle/grid/crs_1/OPatch/jre -persistresult /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/sessionresult_rac2_crs_1.ser -analyzedresult /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/sessionresult_analyze_rac2_crs_1.ser
Command failure output:
==Following patches FAILED in apply:
Patch: /oracle/soft/30899722/30869156
Log: /oracle/grid/crs_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-06-28_01-27-06AM_1.log
Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: ApplySession failed in system modification phase... 'ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: java.io.FileNotFoundException: /oracle/oraInventory/ContentsXML/oui-patch.xml (Permission denied)'
After fixing the cause of failure Run opatchauto resume
OPATCHAUTO-68061: The orchestration engine failed.
OPATCHAUTO-68061: The orchestration engine failed with return code 1
OPATCHAUTO-68061: Check the log for more details.
OPatchAuto failed.
OPatchauto session completed at Sun Jun 28 01:36:27 2020
Time taken to complete the session 31 minutes, 32 seconds
opatchauto failed with error code 42
solution :观察节点1与节点2 /oracle/oraInventory/ContentsXML/oui-patch.xml权限差异,并将节点二修改成与节点一一致。
错误二:resume
[root@rac2 OPatch]# ./opatchauto resume
Start applying binary patch on home /oracle/grid/crs_1
Failed while applying binary patches on home /oracle/grid/crs_1
Execution of [OPatchAutoBinaryAction] patch action failed, check log for more details. Failures:
Patch Target : rac2->/oracle/grid/crs_1 Type[crs]
Details: [
---------------------------Patching Failed---------------------------------
Command execution failed during patching in home: /oracle/grid/crs_1, host: rac2.
Command failed: /oracle/grid/crs_1/OPatch/opatchauto apply /oracle/soft/30899722 -oh /oracle/grid/crs_1 -targerid/crs_1/OPatch/jre -persistresult /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/sessionresult_rac2_crs_1.seranalyze_rac2_crs_1.ser
Command failure output:
==Following patches FAILED in apply:
Patch: /oracle/soft/30899722/30869156
Log:
Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Unable to create patchObject
Possible causes are:
ORACLE_HOME/inventory/oneoffs/30869156 is corrupted. PatchObject constructor: Input file "/oracle/grid/crs_1//oneoffs/30869156/etc/config/inventory" does not exist.
After fixing the cause of failure Run opatchauto resume
]
OPATCHAUTO-68061: The orchestration engine failed.
OPATCHAUTO-68061: The orchestration engine failed with return code 1
OPATCHAUTO-68061: Check the log for more details.
OPatchAuto failed.
OPatchauto session completed at Sun Jun 28 10:44:27 2020
Time taken to complete the session 0 minute, 50 seconds
opatchauto failed with error code 42
根据MOS2286025.1 solution:
从节点1拷贝
[grid@rac1 oneoffs]$ scp -r 30869156/ rac2:/oracle/grid/crs_1/inventory/oneoffs/
在节点2再次resume
[grid@rac2 OPatch]$ ./opatchauto resume
OPatchauto session is initiated at Sun Jun 28 11:10:27 2020
Session log file is /oracle/grid/crs_1/cfgtoollogs/opatchauto/opatchauto2020-06-28_11-10-28AM.log
Resuming existing session with id V8YC
OPATCHAUTO-68116: Failed to save patch session.
OPATCHAUTO-68116: Failed to save patch session file /oracle/grid/crs_1/opatchautocfg/db/sessioninfo/V8YC.json
OPATCHAUTO-68116: Check log for more information.
OPatchAuto failed.
OPatchauto session completed at Sun Jun 28 11:10:37 2020
Time taken to complete the session 0 minute, 11 seconds
opatchauto failed with error code 42
再次执行一次错误消失:
[root@rac2 OPatch]# ./opatchauto resume
OPatchauto session is initiated at Sun Jun 28 17:28:56 2020
Session log file is /oracle/grid/crs_1/cfgtoollogs/opatchauto/opatchauto2020-06-28_05-28-56PM.log
Resuming existing session with id V8YC
Start applying binary patch on home /oracle/grid/crs_1
Binary patch applied successfully on home /oracle/grid/crs_1
Checking shared status of home.....
Starting CRS service on home /oracle/grid/crs_1
CRS service started successfully on home /oracle/grid/crs_1
Preparing home /oracle/app/product/19.3.0/db_1 after database service restarted
No step execution required.........
Trying to apply SQL patch on home /oracle/app/product/19.3.0/db_1
SQL patch applied successfully on home /oracle/app/product/19.3.0/db_1
OPatchAuto successful.
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
需要2遍确认
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23825935/viewspace-2937914/ ,如需转载,请注明出处,否则将追究法律责任。