top of page

Upgrading Oracle Database 19c to 23ai with AutoUpgrade — Runbook

OmerNarman
Oct 3
5 min read

Updated: Oct 24

Environment used in this runbook:

  • Source: CDB CDB19 (Oracle Database 19c, latest Release Update) in /u01/app/oracle/product/19.0.0/dbhome_1

  • Target home: /u01/app/oracle/product/23.0.0/dbhome_1 (Oracle Database 23ai + latest RU)

  • Platform: Linux x86-64, single instance

  • RAC: the same flow applies; AutoUpgrade handles the nodes

  • Non-CDB source: a 19c non-CDB must be converted to a PDB during the upgrade, because 23ai is multitenant-only


Facts to know before you start

  • Direct upgrade to 23ai is supported from 19c and 21c. Anything older goes to 19c first.

  • Non-CDB architecture is desupported: a 19c non-CDB is upgraded and plugged into a 23ai CDB in the same AutoUpgrade job (target_cdb parameter).

  • AutoUpgrade (autoupgrade.jar) is the only supported upgrade method; dbupgrade/DBUA are gone. Always use the latest jar from My Oracle Support note 2485457.1, not the one shipped in the home.

  • AutoUpgrade creates a guaranteed restore point (GRP) before the upgrade, so rollback is a one-liner as long as you have not raised COMPATIBLE.

  • Traditional auditing, DBMS_JOB legacy behaviour and other desupported features are reported by the pre-checks — read the report.

Step 1 — Install and patch the 23ai home

Shell

# as oracle

mkdir -p /u01/app/oracle/product/23.0.0/dbhome_1

cd /u01/app/oracle/product/23.0.0/dbhome_1

unzip -q /stage/LINUX.X64_23ai_db_home.zip

./runInstaller -silent -responseFile /stage/db_install.rsp # software-only install

# root scripts when prompted, then apply the latest RU with OPatch

$ORACLE_HOME/OPatch/opatch apply /stage/<RU_patch_dir>

$ORACLE_HOME/OPatch/opatch lspatches

Why: upgrade into a home that already has the latest RU; upgrading and then patching means a second outage. Check OS prerequisites (oracle-database-preinstall-23ai package on Oracle Linux) before installing.

Step 2 — Get the latest AutoUpgrade

Shell

mkdir -p /u01/app/oracle/autoupgrade && cd /u01/app/oracle/autoupgrade

cp /stage/autoupgrade.jar . # downloaded from MOS 2485457.1

$ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -version

Why: the jar is updated monthly with new checks and fixups; old versions miss known issues.

Step 3 — Write the config file

Shell

java -jar autoupgrade.jar -create_sample_file config # produces sample_config.cfg

Edit /u01/app/oracle/autoupgrade/cdb19.cfg:

Shell

global.autoupg_log_dir=/u01/app/oracle/autoupgrade/logs

upg1.sid=CDB19

upg1.source_home=/u01/app/oracle/product/19.0.0/dbhome_1

upg1.target_home=/u01/app/oracle/product/23.0.0/dbhome_1

upg1.log_dir=/u01/app/oracle/autoupgrade/logs/CDB19

upg1.restoration=yes # guaranteed restore point (default)

upg1.timezone_upg=yes # upgrade the time-zone file as part of the job

upg1.run_utlrp=yes # recompile invalid objects afterwards

upg1.drop_grp_after_upgrade=no # keep the GRP until you have validated (watch FRA space!)

upg1.raise_compatible=no # never raise COMPATIBLE automatically

# upg1.pdbs=PDB1,PDB2 # upgrade only selected PDBs of the CDB

For a 19c non-CDB (ORCL19) that must become a PDB in an existing 23ai CDB:

SQL

upg2.sid=ORCL19

upg2.source_home=/u01/app/oracle/product/19.0.0/dbhome_1

upg2.target_home=/u01/app/oracle/product/23.0.0/dbhome_1

upg2.target_cdb=CDB23 # existing 23ai CDB that receives the new PDB

upg2.target_pdb_name=ORCLPDB

upg2.target_pdb_copy_option=file_name_convert=('/u01/oradata/ORCL19','/u01/oradata/CDB23/ORCLPDB')

Why: each upgN block is one database; one config can upgrade several in parallel. drop_grp_after_upgrade=no gives you a rollback path after the application team has tested, at the cost of FRA space (flashback logs keep growing until the GRP is dropped).

Step 4 — Analyze (read-only pre-checks)

Shell

java -jar autoupgrade.jar -config cdb19.cfg -mode analyze

Then open the report:

SQL

/u01/app/oracle/autoupgrade/logs/CDB19/<job>/prechecks/cdb19_preupgrade.html

Why: analyze touches nothing. Fix every ERROR yourself (typical: obsolete parameters, missing free space in SYSTEM/SYSAUX, invalid objects owned by SYS, deprecated features you must remove, COMPATIBLE too low). WARNING items with fixup: yes are handled by AutoUpgrade; the others need your decision.

Common findings for 19c → 23ai:

  • Traditional audit settings present → they are dropped; make sure unified audit policies replace them.

  • DBMS_JOB jobs → converted to Scheduler jobs automatically (check afterwards).

  • Time-zone file older than the target's → timezone_upg=yes handles it (adds time to the outage).

  • Invalid objects, stale dictionary stats → EXEC DBMS_STATS.GATHER_DICTIONARY_STATS; and @?/rdbms/admin/utlrp.sql before the upgrade.

Step 5 — Run the fixups ahead of the outage (optional but recommended)

Shell

java -jar autoupgrade.jar -config cdb19.cfg -mode fixups

Why: executes the automatic fixups on the source database while it is still on 19c (gathering stats, purging recyclebin, refreshing MVs…). Doing it days before shortens the downtime window and lets you re-run analyze to confirm a clean report.

Step 6 — Back up

RMAN

rman target /

RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT TAG 'PRE_23AI_UPGRADE';

RMAN> BACKUP CURRENT CONTROLFILE;

Also back up the SPFILE, password file, tnsnames.ora/listener.ora, wallet directory (TDE!) and /etc/oratab.

Why: the GRP covers "upgrade failed"; the RMAN backup covers "storage failed". You need both.

Step 7 — Deploy (the actual upgrade)

Shell

java -jar autoupgrade.jar -config cdb19.cfg -mode deploy

Inside the AutoUpgrade console:

SQL

upg> lsj # list jobs and their stage

upg> status -job 100 # details of one job

upg> tasks # running tasks

upg> logs # log locations

Stages you will see: SETUP → PREUPGRADE → PRECHECKS → GRP → PREFIXUPS → DRAIN → DBUPGRADE → POSTCHECKS → POSTFIXUPS → POSTUPGRADE. Progress is also in .../CDB19/<job>/dbupgrade/autoupgrade_<date>_<db>.log.

Why: deploy runs the whole chain unattended: shuts the database down, restarts it from the 23ai home, upgrades the CDB root and every PDB in parallel, runs post-fixups, the time-zone upgrade and recompilation, updates /etc/oratab, and copies the SPFILE and password file into the new home. Expect 30–90 minutes for a typical CDB with a few PDBs.

If something breaks:

SQL

upg> resume -job 100 # after fixing the cause

upg> restore -job 100 # flash back to the GRP and restart in the 19c home

upg> abort -job 100

Step 8 — Post-upgrade validation

SQL

-- new home, same SID

SELECT banner_full FROM v$version;

SELECT comp_id, comp_name, version_full, status FROM dba_registry ORDER BY 1; -- all VALID

SELECT name, open_mode, restricted FROM v$pdbs;

SELECT owner, object_type, COUNT(*) FROM dba_objects WHERE status = 'INVALID' GROUP BY owner, object_type;

SELECT * FROM v$timezone_file;

SELECT name, value FROM v$parameter WHERE name = 'compatible'; -- still 19.0.0

Check CDB19/<job>/postchecks/*.html for remaining warnings, update the listener to the new home (lsnrctl from the 23ai home, listener.ora copied), and update environment scripts, cron jobs and monitoring agents that hard-code the old ORACLE_HOME.

Why: COMPATIBLE intentionally stays at the 19c value until you are sure — new 23ai on-disk features are disabled but flashback to the GRP remains possible.

Step 9 — Application test, then commit the upgrade

SQL

-- after sign-off: drop the GRP (AutoUpgrade named it AUTOUPGRADE_<timestamp>)

SELECT name, guarantee_flashback_database FROM v$restore_point;

DROP RESTORE POINT AUTOUPGRADE_221145114461854_CDB19;

-- raise COMPATIBLE (irreversible; needs a restart)

ALTER SYSTEM SET COMPATIBLE = '23.0.0' SCOPE = SPFILE;

SHUTDOWN IMMEDIATE

STARTUP

Then take a fresh full backup — backups from before raising COMPATIBLE cannot be used with the new format after this point in a recovery that crosses it.

Why: COMPATIBLE = 23.0.0 unlocks the features you upgraded for (vector data type, wide tables, new TDE modes, etc.). Do it deliberately, once, after the backup.

Step 10 — Clean up

  • Remove 19c home from /etc/oratab entries that are no longer used; keep the software until the fallback window closes, then deinstall ($OLD_HOME/deinstall/deinstall).

  • Re-register the database with OEM / Data Safe / RMAN catalog (rman ... UPGRADE CATALOG if the catalog schema is older).

  • Update Data Guard standbys: they must be started from a 23ai home before the primary upgrade (redo apply is deferred during the upgrade and resumes afterwards); AutoUpgrade documentation has the Data Guard sequence.

Rollback decision table

Situation

Action

Failure during DBUPGRADE, GRP exists

restore -job N in the console → back on 19c in minutes

Upgrade done, app test fails, COMPATIBLE not raised

FLASHBACK DATABASE TO RESTORE POINT ... from the 23ai home, then STARTUP in the 19c home (or restore -job)

COMPATIBLE already raised

Restore from the pre-upgrade RMAN backup (full downtime) — this is why Step 9 is last


Frequently hit errors

  • ORA-01403 / "insufficient disk space" in prechecks → SYSTEM/SYSAUX/UNDO/TEMP autoextend or add space; FRA for the GRP flashback logs.

  • Job stuck in DRAIN → sessions still connected; AutoUpgrade waits for drain_timeout (config upg1.drain_timeout) before killing them.

  • ORA-39700: database must be opened with UPGRADE option after a manual restart → let AutoUpgrade resume; do not start the database by hand mid-job.

  • Post-upgrade invalid SYS objects → rerun @?/rdbms/admin/utlrp.sql; check the postfixups log for the failing component.

Recent Posts

See All

Comments


bottom of page