参考文档:Oracle® Database Patch 36582629 - GI Release Update 19.24.0.0.240716
2.1.1.1 OPatch Utility Information
12.2.0.1.42 or later
2.1.1.2 Validation of Oracle Inventory
分别在GI和Oracle Home下执行
$ <ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh <ORACLE_HOME>
su - grid
/u01/app/19.0.0/grid/OPatch/opatch lsinventory -detail -oh /u01/app/19.0.0/gridsu - oracle
/u01/app/oracle/product/19.0.0/db_1/OPatch/opatch lsinventory -detail -oh /u01/app/oracle/product/19.0.0/db_1
2.1.1.4 Run OPatch Conflict Check
su - grid
/u01/app/19.0.0/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36582781
/u01/app/19.0.0/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36587798
/u01/app/19.0.0/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36590554
/u01/app/19.0.0/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36648174
/u01/app/19.0.0/grid/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36758186su - oracle
/u01/app/oracle/product/19.0.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36582781
/u01/app/oracle/product/19.0.0/db_1/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /stage/36582629/36587798
2.1.1.5 Run OPatch System Space Check
su - grid
cat /tmp/patch_list_gihome.txt
/stage/36582629/36582781
/stage/36582629/36587798
/stage/36582629/36590554
/stage/36582629/36648174
/stage/36582629/36758186/u01/app/19.0.0/grid/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txtsu - oracle
cat /tmp/patch_list_dbhome.txt
/stage/36582629/36582781
/stage/36582629/36587798/u01/app/oracle/product/19.0.0/db_1/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
2.1.4 OPatchAuto Out-of-Place Patching
-- 一次性打GI和DB home的补丁
To patch the Grid home and all Oracle RAC database homes of the same version:
# opatchauto apply <UNZIPPED_PATCH_LOCATION>/36582629
-- 分开打GI和DB的补丁
To patch only the Grid home:
# opatchauto apply <UNZIPPED_PATCH_LOCATION>/36582629 -oh <GI_HOME>To patch one or more Oracle RAC database homes:
# opatchauto apply <UNZIPPED_PATCH_LOCATION>/36582629 -oh <oracle_home1_path>,<oracle_home2_path>su - root
/u01/app/19.0.0/grid/OPatch/opatchauto apply /stage/36582629 -oh /u01/app/19.0.0/grid
/u01/app/oracle/product/19.0.0/db_1/OPatch/opatchauto apply /stage/36582629 -oh /u01/app/oracle/product/19.0.0/db_1
-- log
[root@asm19c stage]# /u01/app/19.0.0/grid/OPatch/opatchauto apply /stage/36582629 -oh /u01/app/19.0.0/gridOPatchauto session is initiated at Tue Oct 15 21:00:00 2024System initialization log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchautodb/systemconfig2024-10-15_09-00-21PM.log.Session log file is /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/opatchauto2024-10-15_09-00-31PM.log
The id for this session is XBRQExecuting OPatch prereq operations to verify patch applicability on home /u01/app/19.0.0/grid
Patch applicability verified successfully on home /u01/app/19.0.0/gridExecuting patch validation checks on home /u01/app/19.0.0/grid
Patch validation checks successfully completed on home /u01/app/19.0.0/gridPerforming prepatch operations on CRS - bringing down CRS service on home /u01/app/19.0.0/grid
Prepatch operation log file location: /u01/app/grid/crsdata/asm19c/crsconfig/hapatch_2024-10-15_09-05-19PM.log
CRS service brought down successfully on home /u01/app/19.0.0/gridStart applying binary patch on home /u01/app/19.0.0/grid
Binary patch applied successfully on home /u01/app/19.0.0/gridRunning rootadd_rdbms.sh on home /u01/app/19.0.0/grid
Successfully executed rootadd_rdbms.sh on home /u01/app/19.0.0/gridPerforming postpatch operations on CRS - starting CRS service on home /u01/app/19.0.0/grid
Postpatch operation log file location: /u01/app/grid/crsdata/asm19c/crsconfig/hapatch_2024-10-15_09-18-35PM.log
CRS service started successfully on home /u01/app/19.0.0/gridOPatchAuto successful.--------------------------------Summary--------------------------------Patching is completed successfully. Please find the summary as follows:Host:asm19c
SIHA Home:/u01/app/19.0.0/grid
Version:19.0.0.0.0
Summary:==Following patches were SUCCESSFULLY applied:Patch: /stage/36582629/36582781
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-06-01PM_1.logPatch: /stage/36582629/36587798
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-06-01PM_1.logPatch: /stage/36582629/36590554
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-06-01PM_1.logPatch: /stage/36582629/36648174
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-06-01PM_1.logPatch: /stage/36582629/36758186
Log: /u01/app/19.0.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-06-01PM_1.logOPatchauto session completed at Tue Oct 15 21:20:28 2024
Time taken to complete the session 20 minutes, 8 seconds
[root@asm19c stage]#
[root@asm19c stage]# /u01/app/oracle/product/19.0.0/db_1/OPatch/opatchauto apply /stage/36582629 -oh /u01/app/oracle/product/19.0.0/db_1OPatchauto session is initiated at Tue Oct 15 21:21:13 2024System initialization log file is /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchautodb/systemconfig2024-10-15_09-21-31PM.log.Session log file is /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/opatchauto2024-10-15_09-21-44PM.log
The id for this session is A579Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19.0.0/db_1
Patch applicability verified successfully on home /u01/app/oracle/product/19.0.0/db_1Executing patch validation checks on home /u01/app/oracle/product/19.0.0/db_1
Patch validation checks successfully completed on home /u01/app/oracle/product/19.0.0/db_1Verifying SQL patch applicability on home /u01/app/oracle/product/19.0.0/db_1
SQL patch applicability verified successfully on home /u01/app/oracle/product/19.0.0/db_1Preparing to bring down database service on home /u01/app/oracle/product/19.0.0/db_1
Successfully prepared home /u01/app/oracle/product/19.0.0/db_1 to bring down database serviceBringing down database service on home /u01/app/oracle/product/19.0.0/db_1
Following database has been stopped and will be restarted later during the session: test
Database service successfully brought down on home /u01/app/oracle/product/19.0.0/db_1Start applying binary patch on home /u01/app/oracle/product/19.0.0/db_1
Binary patch applied successfully on home /u01/app/oracle/product/19.0.0/db_1Running rootadd_rdbms.sh on home /u01/app/oracle/product/19.0.0/db_1
Successfully executed rootadd_rdbms.sh on home /u01/app/oracle/product/19.0.0/db_1Starting database service on home /u01/app/oracle/product/19.0.0/db_1
Database service successfully started on home /u01/app/oracle/product/19.0.0/db_1Preparing home /u01/app/oracle/product/19.0.0/db_1 after database service restarted
No step execution required.........Trying to apply SQL patch on home /u01/app/oracle/product/19.0.0/db_1
SQL patch applied successfully on home /u01/app/oracle/product/19.0.0/db_1OPatchAuto successful.--------------------------------Summary--------------------------------Patching is completed successfully. Please find the summary as follows:Host:asm19c
SIDB Home:/u01/app/oracle/product/19.0.0/db_1
Version:19.0.0.0.0
Summary:==Following patches were SKIPPED:Patch: /stage/36582629/36590554
Reason: This patch is not applicable to this specified target type - "oracle_database"Patch: /stage/36582629/36758186
Reason: This patch is not applicable to this specified target type - "oracle_database"Patch: /stage/36582629/36648174
Reason: This patch is not applicable to this specified target type - "oracle_database"==Following patches were SUCCESSFULLY applied:Patch: /stage/36582629/36582781
Log: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-28-14PM_1.logPatch: /stage/36582629/36587798
Log: /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatchauto/core/opatch/opatch2024-10-15_21-28-14PM_1.logOPatchauto session completed at Tue Oct 15 21:53:46 2024
Time taken to complete the session 32 minutes, 16 seconds
[root@asm19c stage]#
-- 验证
[grid@asm19c OPatch]$ ./opatch lspatches
36758186;DBWLM RELEASE UPDATE 19.0.0.0.0 (36758186)
36648174;TOMCAT RELEASE UPDATE 19.0.0.0.0 (36648174)
36590554;ACFS RELEASE UPDATE 19.24.0.0.0 (36590554)
36587798;OCW RELEASE UPDATE 19.24.0.0.0 (36587798)
36582781;Database Release Update : 19.24.0.0.240716 (36582781)OPatch succeeded.
[grid@asm19c OPatch]$ [oracle@asm19c OPatch]$ ./opatch lspatches
36587798;OCW RELEASE UPDATE 19.24.0.0.0 (36587798)
36582781;Database Release Update : 19.24.0.0.240716 (36582781)OPatch succeeded.
[oracle@asm19c OPatch]$
SQL> set linesize 200
SQL> col action for a14
SQL> col status for a20
SQL> col description for a70
SQL> select action,status,description from dba_registry_sqlpatch;ACTION STATUS DESCRIPTION
-------------- -------------------- ----------------------------------------------------------------------
APPLY SUCCESS Database Release Update : 19.3.0.0.190416 (29517242)
APPLY SUCCESS Database Release Update : 19.7.0.0.200414 (30869156)
APPLY SUCCESS Database Release Update : 19.12.0.0.210720 (32904851)
APPLY SUCCESS Database Release Update : 19.24.0.0.240716 (36582781)SQL>
END