Skip to main content

Command Palette

Search for a command to run...

Patch your database with autoupgrade

Published
4 min read
Patch your database with autoupgrade
M

nerd, consultant, dba (not always in that order) curious about postgres, oracle, kafka and other tech stuff addicted to books, music and podcasts

With the help of autoupgrade you could easily patch you're current database to the latest available patch by using a 2-step approach

Let's dive directly into it

Assume we have installed Oracle database 19c no patches, base version 19.19 (as we're running on ARM) with a running instance orcl.

opatch lspatches
There are no Interim patches installed in this Oracle Home "/u00/app/oracle/product/19c/dbhome_1".

create the autoconfig file

First of all we need to prepare a autoupgrade config file.

If you like to get this generated automatically I'd highly recommend Marcus excellent Autoupgrade-composer tool which automatically will create you a config file Link here

For the current setup we will use the following config file patch_orcl.cfg

global.global_log_dir=/home/oracle/autoupgrade/log
global.keystore=/home/oracle/autoupgrade/keystore
patch1.sid=orcl
patch1.log_dir=/home/oracle/autoupgrade/log
patch1.source_home=/u00/app/oracle/product/19c/dbhome_1
patch1.target_home=/u00/app/oracle/product/%RELEASE%.%UPDATE%_dbhome
patch1.restoration=YES
patch1.folder=/u00/ora-repo/patches
patch1.patch=RU,OPATCH
patch1.platform=arm.x64
patch1.download=YES

We make use of the placeholder %RELEASE%.%UPDATE% to let autoupgrade automatically determines the new Oracle home which will be

```/u00/app/oracle/product/19.28_dbhome``

With the placeholder it's even easier to automate the RU patching in every quarter without making chances to your code/config files.

download the patches

next download the required patches with

if haven't already configured your MyOracleSupport credentials yet check the steps in my earlier blogpost Configure MOS credentials

java -jar autoupgrade.jar -config patch_oh19.cfg -patch -mode download

keep in mind that autoupgrade does not download the base image therefore you need to take care of downloading the base image (LINUX.ARM64_1919000_db_home.zip in our case) by yourself and put in the patch1.folder (/u00/ora-repo/patches/)

the above command should start with something like the following and end up successfully

Previous execution found loading latest data
Total jobs recovered: 1
AutoUpgrade Patching 25.6.251016 launched with default internal options
Processing config file ...
Loading AutoUpgrade Patching keystore
AutoUpgrade Patching keystore is loaded

Connected to MOS - Searching for specified patches

------------------------------------------
Downloading files to /u00/ora-repo/patches
------------------------------------------

install the new Oracle Home

with the same config file as above we could now install the new Oracle Home

just start autoupgrade with the following option create_home

java -jar autoupgrade.jar -config install_latest_19c.cfg -patch -mode create_home

with lsj we can list the current status of the home creation, e.g:

-----------------------------------------+
| Starting AutoUpgrade Patching execution |
+-----------------------------------------+
Type 'help' to list console commands
patch> lsj
+----+-------------+-------+---------+-------+----------+-------+---------------------+
|Job#|      DB_NAME|  STAGE|OPERATION| STATUS|START_TIME|UPDATED|              MESSAGE|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
| 100|create_home_1|EXTRACT|EXECUTING|RUNNING|  09:49:23| 2s ago|Extracting gold image|
+----+-------------+-------+---------+-------+----------+-------+---------------------+
Total jobs 1

job will print the following once he completed and asks for executing the root specific script for Oracle Home creation.

patch> Job 100 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]
Jobs restored                  [0]
Jobs pending                   [0]

# Run the root.sh script as root for the following jobs:
For create_home_1 -> /u00/app/oracle/product/19.28_dbhome/root.sh

--> as usual login as prviliged user and execute the root script

patch the datbase

now we're ready to patch our database to the latest RU (19.28 in my term).

start with java -jar autoupgrade.jar -config patch_orcl.cfg -patch -mode deploy

autoupgrade will start some checks and then starts patching process (excerpt below)

java -jar autoupgrade.jar -config patch_orcl.cfg -patch -mode deploy
AutoUpgrade Patching 25.6.251016 launched with default internal options
Processing config file ...
Loading AutoUpgrade Patching keystore
AutoUpgrade Patching keystore is loaded

Connected to MOS - Searching for specified patches

------------------------------------------
Downloading files to /u00/ora-repo/patches
------------------------------------------
DATABASE RELEASE UPDATE 19.28.0.0.0
    File: p37960098_190000_Linux-ARM-64.zip - LOCATED

OPatch 12.2.0.1.49 for DB 19.0.0.0.0 (Jan 2026)
    File: p6880880_190000_Linux-ARM-64.zip - LOCATED
------------------------------------------

+-----------------------------------------+
| Starting AutoUpgrade Patching execution |
+-----------------------------------------+
1 CDB(s) plus 1 PDB(s) will be processed
Type 'help' to list console commands
patch> lsj
+----+-------+---------+---------+-------+----------+-------+----------------------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|START_TIME|UPDATED|                     MESSAGE|
+----+-------+---------+---------+-------+----------+-------+----------------------------+
| 100|   orcl|PRECHECKS|EXECUTING|RUNNING|  10:27:33| 6s ago|Loading database information|
+----+-------+---------+---------+-------+----------+-------+----------------------------+

patch> Job 100 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]
Jobs restored                  [0]
Jobs pending                   [0]

# Run the root.sh script as root for the following jobs:
For orcl -> /u00/app/oracle/product/19.28_dbhome/root.sh

with my above config autoupgrade creates a guaranted restore point autoupgrade prints an information to drop the restore point if no longer needed after patching has been succesful.

---- Drop GRP at your convenience once you consider it is no longer needed ----
Drop GRP from orcl: drop restore point AU_PATCHING_9212_ORCL1919000

Finally database has been successfully patched to the latest RU and is up and running.

Happy patching :-)

summary/lessons learned

  • autoupgrade eases the whole process of downloading and patching your database

  • make use of autoupgrade composer to get a config file created

  • make sure you have the latest version of autoupgrade installed

autoupgrade docs

Daniel Overby Hansens blog around autoupgrade

autoupgrade composer by Marcus Vinicius

Mike Dietrichs blogs about upgrades