apply database oop patch

Oracle 19c RAC Database Out of Place Patching

I will patch all my database servers database software from 19.16 to 19.20. As there are more than 20 servers to patch, we will use fleet patching. First i will patch a 2 node cluster database homes by using out of place ( OOP ) patching  methodology through runInstaller in silent mode. Later i will use patched database homes to create a gold image for fleet patching of all database homes.

Setup List:

  • Database 19.3 Base Release (LINUX.X64_193000_db_home.zip)
  • Database 19.20 RU (p35320081_190000_Linux-x86-64.zip)
  • Grid 19.20 August MRP involves DB August MRP. (p35656840_1920000DBRU_Linux-x86-64.zip)
  • OJVM 19.20 Patch (p35354406_190000_Linux-x86-64.zip)
  • DPBP 19.20 Datapump Bundle Patch (p35512813_1920000DBRU_Generic.zip)
  • Spatial 19.20 Bundle Patch (p35602358_1920000DBRU_Linux-x86-64.zip)
  • DB 555.1 Recommended One-off (p35372179_1920000DBRU_Linux-x86-64.zip)
  • DB 555.1 Recommended One-off (p30787757_1920000DBRU_Linux-x86-64.zip)
  • Opatch Latest Version (p6880880_122010_Linux-x86-64.zip)

Preparation Phase:

[oracle@oravt01 product]$ cd /u01/app/oracle/product
[oracle@oravt01 product]$ mkdir -p 19.20/dbhome_1
[oracle@oravt01 ~]$ cd /u01/app/Setup/
[oracle@oravt01 Setup]$ mkdir DBRU
[oracle@oravt01 Setup]$ mkdir OJVM
[oracle@oravt01 Setup]$ mkdir DPBP
[oracle@oravt01 Setup]$ mkdir DBRU_Oneoff
[oracle@oravt01 Setup]$ mkdir GIMRP
[oracle@oravt01 Setup]$ mkdir Spatial
[oracle@oravt01 Setup]$ cd DBRU
[oracle@oravt01 DBRU]$ unzip p35320081_190000_Linux-x86-64.zip
[oracle@oravt01 DBRU]$ cd ../GIMRP
[oracle@oravt01 GIMRP]$ unzip p35656840_1920000DBRU_Linux-x86-64.zip
[oracle@oravt01 GIMRP]$ cd ../Spatial
[oracle@oravt01 Spatial]$ unzip p35602358_1920000DBRU_Linux-x86-64.zip
[oracle@oravt01 Spatial]$ cd /u01/app/Setup/DBRU_Oneoff/
[oracle@oravt01 DBRU_Oneoff]$ unzip p30787757_1920000DBRU_Linux-x86-64.zip
[oracle@oravt01 DBRU_Oneoff]$ unzip p35372179_1920000DBRU_Linux-x86-64.zip
[oracle@oravt01 DBRU_Oneoff]$ cd /u01/app/Setup/DPBP/
[oracle@oravt01 DPBP]$ unzip p35512813_1920000DBRU_Generic.zip
[oracle@oravt01 DPBP]$ cd /u01/app/Setup/OJVM/
[oracle@oravt01 OJVM]$ unzip p35354406_190000_Linux-x86-64.zip
[oracle@oravt01 OJVM]$ cd /u01/app/oracle/product/19.20/dbhome_1/
[oracle@oravt01 dbhome_1]$ unzip -qo /u01/app/Setup/LINUX.X64_193000_db_home.zip
[oracle@oravt01 dbhome_1]$ rm -rf OPatch
[oracle@oravt01 dbhome_1]$ unzip -qo /u01/app/Setup/p6880880_122010_Linux-x86-64.zip
[oracle@oravt01 dbhome_1]$ export ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1
[oracle@oravt01 dbhome_1]$ cd $ORACLE_HOME

We replaced scp binary with the below commands not to hit “[FATAL] [INS-06006] Passwordless SSH connectivity not set up between the following node(s):” error related with Openssh_8 shipped with Oracle Linux 8 according to INS-06006 GI RunInstaller Fails If OpenSSH Is Upgraded to 8.x (Doc ID 2555697.1)

[root@oravt01 ~]# ssh -V
OpenSSH_8.0p1, OpenSSL 1.1.1k FIPS 25 Mar 2021
— rename original scp binary.
[root@oravt01 ~]# mv /usr/bin/scp /usr/bin/scp.orig
–create new scp binary referring to original one
[root@oravt01 ~]# vi /usr/bin/scp
/usr/bin/scp.orig -T $*
–chmod to executable
[root@oravt01 ~]# chmod 555 /usr/bin/scp
view raw replace_scp.txt hosted with ❤ by GitHub

Deploying new software to all nodes with a single command. (DBRU + DB MRP + OJVM + DPBP + Spatial Bundle + One-offs)

[oracle@oravt01 grid]$ export CV_ASSUME_DISTID=OL7 ./runInstaller -applyRU /u01/app/Setup/DBRU/35320081
-applyOneOffs /u01/app/Setup/OJVM/35354406,/u01/app/Setup/DPBP/35512813,/u01/app/Setup/Spatial/35602358,/u01/app/Setup/DBRU_Oneoff/30787757,/u01/app/Setup/DBRU_Oneoff/35372179,/u01/app/Setup/GIMRP/35656840/35571653,/u01/app/Setup/GIMRP/35656840/35156218,/u01/app/Setup/GIMRP/35656840/35395648,/u01/app/Setup/GIMRP/35656840/35499173,/u01/app/Setup/GIMRP/35656840/35525143,/u01/app/Setup/GIMRP/35656840/35585502,/u01/app/Setup/GIMRP/35656840/35655714
-silent -ignorePrereqFailure -waitforcompletion
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.20/dbhome_1
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.CLUSTER_NODES=oravt01,oravt02
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true

Now new database home software ready to go. We will just execute root.sh scripts on all nodes. 

[root@oravt01 dbhome_1]# /u01/app/oracle/product/19.20/dbhome_1/root.sh
[root@oravt02 dbhome_1]# /u01/app/oracle/product/19.20/dbhome_1/root.sh

As we make use of unified auditing on all databases, we will relink unified auditing with on option with the below command before switching to new home.

Now it is time to switch new homes. Just before switch;

  • Do not forget to update all your shell scripts, .bashrc etc files to refer new db home. 
  • Copy tnsnames.ora and sqlnet.ora from old db home to new db home.
  • Copy glogin.sql from old db home to new db home.
  • Make sure that your wallet path is not dependent to your old db home, if it is, just copy to a different path and update your sqlnet.ora.

Final step, modify your database homes with srvctl command and startup your databases from new home node by node. Below is a sample.

[oracle@oravt01 dbhome_1]$ srvctl modify database -d clouddb -oraclehome /u01/app/oracle/product/19.20/dbhome_1
[oracle@oravt01 ~]$ srvctl stop instance -d clouddb -i clouddb1
[oracle@oravt01 ~]$ srvctl start instance -d clouddb -i clouddb1
[oracle@oravt02 ~]$ srvctl stop instance -d clouddb -i clouddb2
[oracle@oravt02 ~]$ srvctl start instance -d clouddb -i clouddb2

Edited on 10th May 2025:
When patching with out-of-place patching, some directory objects (dba_directories) managed internally by Oracle are not properly configured to the new Oracle Home. Although an enhancement request was submitted (Enh 35988020 – DATAPATCH SHOULD INVOKE UTLFIXDIRS.SQL), as of the 19.26 RU, it is still not available in the patch inventory.

Therefore, each time you patch using the out-of-place method, you should manually run utlfixdirs.sql to correct these directory references. Refer to DBMS_OPTIM_BUNDLE and Out-Of-Place Patching blog post of Mike Dietrich for more information.

Additionally, if you encounter an issue with the DBMS_OPTIM_BUNDLE package – such as the following error: ORA-20002: Error stat’ing file bundlefcp_DBBP.xml
You can recreate the package by executing the dbmsoptim.sql and prvtoptim.plb scripts located in the Oracle Home’s rdbms/admin directory.

Hope it helps.

See you on Step 3 – Patching in the Deep. (Oracle Grid Patching using Fleet Maintenance).


Discover More from Osman DİNÇ


Comments

Leave your comment