In this article we will see how to patch the database with the latest PSU patches
Check the following note for the patch numbers for all versions
Primary Note for Database Proactive Patch Program (Doc ID 888.1)
Download the relevant patch for the DB version and OS version , in this case
21c – Linux
Patch = 21.9.0.0.230117 DB RU
Patch Number = 34839741
Check database version : 21.3.0.0
Always download the latest OPatch from support
https://updates.oracle.com/download/6880880.html
cd $ORACLE_HOME/OPatch
./opatch version
Unzip the patch zip file and run the precheck
Perform Precheck :
cd 34839741
$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Once the precheck is successful we can apply the patch. Make sure all the database running from the Oracle home being patched are shutdown. Take a backup of the Oracle home (tar/zip) any format should be ok. This is just to be safe in the event of corruption of home.
/home/oracle/patches/34839741
$ cd $ORACLE_HOME/OPatch
$ ./opatch lspatches
34839741;Database Release Update : 21.9.0.0.230117 (34839741)
OPatch succeeded.
After the patch we need apply to Apply Datapatch (Datapatch is run to complete the post-install SQL deployment for the patch being installed) This will be applied to cdb,seed pdb and all pdbs.
$ cd $ORACLE_HOME/OPatch
$ ./datapatch -verbose
Upgrade RMAN catalog to complete the patch apply
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;
The new version after patching : 21.9.0.0
If we need to rollback the patch for any circumstance,
cd $ORACLE_HOME/Opatch
$ ./opatch rollback -id 34839741