AutoUpgrade: can we roll back after patching?

We were all waiting for it, and now it’s real with AU 26.4!

If you follow me, you’ll know that I have published many articles about applying patches in Oracle Database Server. If you haven’t, what are you waiting for? Start with the first article in the series “Learn to patch the way God intended.”

The most recent ones focus on using AutoUpgrade, a tool that helps simplify and automate tasks, but there was a problem: if we had already patched, it couldn’t help with rolling back; we had to do that by hand.

Rolling back a patch is not very hard, but it takes time and can lead to mistakes. Luckily, with version 26.4, we can now do it easily. Keep reading to learn how to execute it.

Starting point

To make things crystal clear, let’s walk through the entire patching and rollback journey together.

Our orcl database is currently on RU 19.30. We’ll upgrade it to RU 19.31 with AutoUpgrade, then roll it right back to RU 19.30—just to show you how smooth it is.

This is how it is registered in the OCR: in the Oracle Home /u01/app/oracle/19.0.0/db_1.

srvctl config database -db orcl

Database unique name: orcl
Database name: db
Oracle home: /u01/app/oracle/19.0.0/db_1
Oracle user: oracle
Spfile: /u01/app/oracle/19.0.0/db_1/dbs/spfileorcl.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DAT01
Services:
OSDBA group:
OSOPER group:
Database instance: orcl

And this is how the record of the previously applied patches is shown.

SET LINESIZE 200
SET PAGESIZE 100

COLUMN action_time FORMAT A28
COLUMN action FORMAT A8
COLUMN status FORMAT A8
COLUMN patch_type FORMAT A10
COLUMN description FORMAT A70

SELECT action_time,
       action,
       status,
       patch_id,
       patch_type,
       description
  FROM sys.dba_registry_sqlpatch
 ORDER BY action_time ASC;


ACTION_TIME                  ACTION       STATUS     PATCH_ID PATCH_TYPE DESCRIPTION
---------------------------- ------------ -------- ---------- ---------- ----------------------------------------------------------------------
22-MAY-26 11.09.11.329782 AM APPLY        SUCCESS    38523609 INTERIM    OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
22-MAY-26 11.10.13.150589 AM APPLY        SUCCESS    38632161 RU         Database Release Update : 19.30.0.0.260120(REL-JAN260130) (38632161)
22-MAY-26 11.10.14.452039 AM APPLY        SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
22-MAY-26 11.10.14.506877 AM APPLY        SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
22-MAY-26 11.10.14.542761 AM APPLY        SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
22-MAY-26 11.10.14.560754 AM APPLY        SUCCESS    38844367 INTERIM    19.30 OJVM PATCH APPLY IS FAILING ON SECOND NODE IN RAC ENVIRONMENT
22-MAY-26 11.10.21.538780 AM APPLY        SUCCESS    38844733 INTERIM    DATAPUMP BUNDLE PATCH 19.30.0.0.0

Time to patch

First up: creating the AutoUpgrade configuration file. To keep things simple, we’ll use the AutoUpgrade Composer tool and save the output in patch.cfg.

# Created by AutoUpgrade Composer
# Upgrade, UpgType: regular

global.global_log_dir=/home/oracle/autoupgrade/log

upg1.sid=orcl
upg1.log_dir=/home/oracle/autoupgrade/log/orcl_Upgrade
upg1.source_home=/u01/app/oracle/19.0.0/db_1
upg1.target_home=/u01/app/oracle/19.0.0/db_2
upg1.restoration=NO
upg1.timezone_upg=NO

Now for the big moment: we launch AutoUpgrade with -mode deploy and let it work its magic.

java -jar autoupgrade.jar \
-config patch.cfg \
-mode deploy

AutoUpgrade 26.4.260701 launched with default internal options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be processed
Type 'help' to list console commands
upg> Job 100 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

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


Please check the summary report at:
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.log

A few minutes later, patching wraps up successfully. Time to check the status.log file and confirm everything went smoothly.

status.log
==========================================
          Autoupgrade Summary Report
==========================================
[Date]           Fri Jul 10 10:06:37 PET 2026
[Number of Jobs] 1
==========================================
[Job ID] 100
==========================================
[DB Name]                orcl
[Version Before Upgrade] 19.30.0.0.0
[Version After Upgrade]  19.31.0.0.0
------------------------------------------
[Stage Name]    PREUPGRADE
[Status]        SUCCESS
[Start Time]    2026-07-10 09:59:26
[Duration]      0:00:00
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/preupgrade
------------------------------------------
[Stage Name]    PRECHECKS
[Status]        SUCCESS
[Start Time]    2026-07-10 09:59:26
[Duration]      0:00:16
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/prechecks
[Detail]        /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/prechecks/orcl_preupgrade.log
                Check passed and no manual intervention needed
------------------------------------------
[Stage Name]    PREFIXUPS
[Status]        SUCCESS
[Start Time]    2026-07-10 09:59:42
[Duration]      0:00:46
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/prefixups
[Detail]        /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/prefixups/prefixups.html
------------------------------------------
[Stage Name]    DRAIN
[Status]        SUCCESS
[Start Time]    2026-07-10 10:00:29
[Duration]      0:05:23
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/drain
------------------------------------------
[Stage Name]    DBUPGRADE
[Status]        SUCCESS
[Start Time]    2026-07-10 10:05:52
[Duration]      0:00:38
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/dbupgrade
------------------------------------------
[Stage Name]    POSTCHECKS
[Status]        SUCCESS
[Start Time]    2026-07-10 10:06:30
[Duration]      0:00:00
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/postchecks
[Detail]        /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/postchecks/orcl_postupgrade.log
                Check passed and no manual intervention needed
------------------------------------------
[Stage Name]    POSTFIXUPS
[Status]        SUCCESS
[Start Time]    2026-07-10 10:06:31
[Duration]      0:00:06
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/postfixups
[Detail]        /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/postfixups/postfixups.html
------------------------------------------
[Stage Name]    POSTUPGRADE
[Status]        SUCCESS
[Start Time]    2026-07-10 10:06:37
[Duration]      0:00:00
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/postupgrade
------------------------------------------
[Stage Name]    SYSUPDATES
[Status]        SUCCESS
[Start Time]    2026-07-10 10:06:37
[Duration]      0:00:00
[Log Directory] /home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/sysupdates
------------------------------------------
Summary:/home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/dbupgrade/datapatch_summary.log

The OCR reflects the change to the new Oracle Home /u01/app/oracle/19.0.0/db_2.

srvctl config database -db orcl

Database unique name: orcl
Database name: db
Oracle home: /u01/app/oracle/19.0.0/db_2
Oracle user: oracle
Spfile: /u01/app/oracle/19.0.0/db_2/dbs/spfileorcl.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DAT01
Services:
OSDBA group:
OSOPER group:
Database instance: orcl

The record of the applied patches was also updated (see lines 30 onward).

SET LINESIZE 200
SET PAGESIZE 100

COLUMN action_time FORMAT A28
COLUMN action FORMAT A8
COLUMN status FORMAT A8
COLUMN patch_type FORMAT A10
COLUMN description FORMAT A70

SELECT action_time,
       action,
       status,
       patch_id,
       patch_type,
       description
  FROM sys.dba_registry_sqlpatch
 ORDER BY action_time ASC;


ACTION_TIME                  ACTION       STATUS     PATCH_ID PATCH_TYPE DESCRIPTION
---------------------------- ------------ -------- ---------- ---------- ----------------------------------------------------------------------
22-MAY-26 11.09.11.329782 AM APPLY        SUCCESS    38523609 INTERIM    OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
22-MAY-26 11.10.13.150589 AM APPLY        SUCCESS    38632161 RU         Database Release Update : 19.30.0.0.260120(REL-JAN260130) (38632161)
22-MAY-26 11.10.14.452039 AM APPLY        SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
22-MAY-26 11.10.14.506877 AM APPLY        SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
22-MAY-26 11.10.14.542761 AM APPLY        SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
22-MAY-26 11.10.14.560754 AM APPLY        SUCCESS    38844367 INTERIM    19.30 OJVM PATCH APPLY IS FAILING ON SECOND NODE IN RAC ENVIRONMENT
22-MAY-26 11.10.21.538780 AM APPLY        SUCCESS    38844733 INTERIM    DATAPUMP BUNDLE PATCH 19.30.0.0.0
--- PATCH (19.30 -> 19.31) ---
10-JUL-26 10.06.04.078647 AM ROLLBACK     SUCCESS    38523609 INTERIM    OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
10-JUL-26 10.06.04.119547 AM APPLY        SUCCESS    38906621 INTERIM    OJVM RELEASE UPDATE: 19.31.0.0.260421 (38906621)
10-JUL-26 10.06.04.136593 AM ROLLBACK     SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
10-JUL-26 10.06.04.197918 AM ROLLBACK     SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
10-JUL-26 10.06.04.229539 AM ROLLBACK     SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
10-JUL-26 10.06.04.239443 AM ROLLBACK     SUCCESS    38844367 INTERIM    19.30 OJVM PATCH APPLY IS FAILING ON SECOND NODE IN RAC ENVIRONMENT
10-JUL-26 10.06.04.589098 AM ROLLBACK     SUCCESS    38844733 INTERIM    DATAPUMP BUNDLE PATCH 19.30.0.0.0
10-JUL-26 10.06.12.285543 AM APPLY        SUCCESS    39034528 RU         Database Release Update : 19.31.0.0.260421 (39034528)
10-JUL-26 10.06.15.459901 AM APPLY        SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
10-JUL-26 10.06.15.509353 AM APPLY        SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
10-JUL-26 10.06.15.531860 AM APPLY        SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
10-JUL-26 10.06.28.583074 AM APPLY        SUCCESS    39196236 INTERIM    DATAPUMP BUNDLE PATCH 19.31.0.0.0

Houston: we need to roll back

Here’s the exciting update: AutoUpgrade 26.4 introduces a rollback option, which you simply pair with your job number.

For us, that’s job 100. We just run AutoUpgrade with -rollback -jobs 100 and let it do the heavy lifting.

java -jar autoupgrade.jar \
-config patch.cfg \
-rollback -jobs 100

Previous execution found loading latest data
Total jobs being restored: 1
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
Job 100 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs restored                  [1]
Jobs failed                    [0]
-------------------- JOBS PENDING --------------------
Job 100 for orcl

Please check the summary report at:
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/autoupgrade/log/cfgtoollogs/upgrade/auto/status/status.log
Exiting

A few more minutes pass, and the rollback is done. We check the status.log file to make sure all is well.

status.log
==========================================
          Autoupgrade Summary Report
==========================================
[Date]           Fri Jul 10 10:19:57 PET 2026
[Number of Jobs] 1
==========================================
[Job ID] 100
==========================================
[DB Name]                orcl
[Version Before Upgrade] 19.30.0.0.0
[Version After Upgrade]  19.31.0.0.0
------------------------------------------
[Stage Name]    GRPRESTORE
[Status]        SUCCESS
[Start Time]
[Duration]
------------------------------------------
Summary:/home/oracle/autoupgrade/log/orcl_Upgrade/orcl/100/dbupgrade/datapatch_summary.log

In the OCR, the return to the previous Oracle Home /u01/app/oracle/19.0.0/db_1 is reflected.

srvctl config database -db orcl

Database unique name: orcl
Database name: db
Oracle home: /u01/app/oracle/19.0.0/db_1
Oracle user: oracle
Spfile: /u01/app/oracle/19.0.0/db_1/dbs/spfileorcl.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups: DAT01
Services:
OSDBA group:
OSOPER group:
Database instance: orcl

Similarly, the record of the applied patches was updated (see lines 42 onward).

SET LINESIZE 200
SET PAGESIZE 100

COLUMN action_time FORMAT A28
COLUMN action FORMAT A8
COLUMN status FORMAT A8
COLUMN patch_type FORMAT A10
COLUMN description FORMAT A70

SELECT action_time,
       action,
       status,
       patch_id,
       patch_type,
       description
  FROM sys.dba_registry_sqlpatch
 ORDER BY action_time ASC;


ACTION_TIME                  ACTION   STATUS     PATCH_ID PATCH_TYPE DESCRIPTION
---------------------------- -------- -------- ---------- ---------- ----------------------------------------------------------------------
2026-05-22 11:09             APPLY    SUCCESS    38523609 INTERIM    OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
2026-05-22 11:10             APPLY    SUCCESS    38844733 INTERIM    DATAPUMP BUNDLE PATCH 19.30.0.0.0
2026-05-22 11:10             APPLY    SUCCESS    38844367 INTERIM    19.30 OJVM PATCH APPLY IS FAILING ON SECOND NODE IN RAC ENVIRONMENT
2026-05-22 11:10             APPLY    SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
2026-05-22 11:10             APPLY    SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
2026-05-22 11:10             APPLY    SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
2026-05-22 11:10             APPLY    SUCCESS    38632161 RU         Database Release Update : 19.30.0.0.260120(REL-JAN260130) (38632161)
2026-07-10 10:06             APPLY    SUCCESS    39034528 RU         Database Release Update : 19.31.0.0.260421 (39034528)
2026-07-10 10:06             ROLLBACK SUCCESS    38844733 INTERIM    DATAPUMP BUNDLE PATCH 19.30.0.0.0
2026-07-10 10:06             ROLLBACK SUCCESS    38844367 INTERIM    19.30 OJVM PATCH APPLY IS FAILING ON SECOND NODE IN RAC ENVIRONMENT
2026-07-10 10:06             ROLLBACK SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
2026-07-10 10:06             ROLLBACK SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
2026-07-10 10:06             ROLLBACK SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
2026-07-10 10:06             APPLY    SUCCESS    38906621 INTERIM    OJVM RELEASE UPDATE: 19.31.0.0.260421 (38906621)
2026-07-10 10:06             ROLLBACK SUCCESS    38523609 INTERIM    OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
2026-07-10 10:06             APPLY    SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
2026-07-10 10:06             APPLY    SUCCESS    39196236 INTERIM    DATAPUMP BUNDLE PATCH 19.31.0.0.0
2026-07-10 10:06             APPLY    SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
2026-07-10 10:06             APPLY    SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
--- ROLLBACK (19.31 -> 19.30) ---
2026-07-10 10:15             ROLLBACK SUCCESS    38906621 INTERIM    OJVM RELEASE UPDATE: 19.31.0.0.260421 (38906621)
2026-07-10 10:15             APPLY    SUCCESS    38523609 INTERIM    OJVM RELEASE UPDATE: 19.30.0.0.260120 (38523609)
2026-07-10 10:15             ROLLBACK SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
2026-07-10 10:15             ROLLBACK SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
2026-07-10 10:15             ROLLBACK SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
2026-07-10 10:15             APPLY    SUCCESS    38844733 INTERIM    DATAPUMP BUNDLE PATCH 19.30.0.0.0
2026-07-10 10:15             ROLLBACK SUCCESS    39034528 RU         Database Release Update : 19.31.0.0.260421 (39034528)
2026-07-10 10:15             APPLY    SUCCESS    28907129 INTERIM    XF20.1PX_ADW - TRC - KGHFRF - ORA-600 [17114]
2026-07-10 10:15             APPLY    SUCCESS    38844367 INTERIM    19.30 OJVM PATCH APPLY IS FAILING ON SECOND NODE IN RAC ENVIRONMENT
2026-07-10 10:15             APPLY    SUCCESS    34774667 INTERIM    ORA-7445 IN PURGE QUEUE TABLE
2026-07-10 10:15             APPLY    SUCCESS    29259068 INTERIM    18.2 AUTO STATS JOB DOESNT FINISH DUE TO SLOW MERGE ON MON_MODS_ALL$
2026-07-10 10:15             ROLLBACK SUCCESS    39196236 INTERIM    DATAPUMP BUNDLE PATCH 19.31.0.0.0

Conclusions

Thanks to the latest AutoUpgrade update, rolling back a patch is now a breeze—even if you never need it, it’s just a single step away.

If you’re still patching by hand, AutoUpgrade is your ticket to easier work. Give it a try—you’ll thank yourself later!

Did you find this article interesting, did you have any doubts, do you want to suggest a topic to cover, leave me your comments or contact me me right now!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts

Plugin non-CDB
Multitenant is mandatory in Oracle 26ai. Learn how to upgrade from Oracle 19c Non-CDB to 26ai, including the full migration to Container Database (CDB).
Patching the database
Discover how to perform rolling patching to an Oracle RAC database using AutoUpgrade and a Gold Image.
Install with Gold Image - AutoUpgrade
Learn how to create and use a Gold Image with AutoUpgrade for installing a new Oracle Home.

Añade aquí tu texto de cabecera

Need Help?

Fill in these details and I will be in touch as soon as possible.