Overview

Oracle ships Release Updates (RUs) quarterly (security and bug fixes) and major releases. Planning means choosing a release, patching regularly, and testing the optimizer behaviour change (oracle-optimizer-statistics).

Core concepts

  • Naming: the tested image is Oracle AI Database 26ai Free 23.26.4. The 23ai release was renamed 26ai, and its version string is 23.x; the banner shows 23.26.4.0.0. 19c is the widely deployed long-term-support release; innovation releases (21c, 23ai/26ai) have shorter or different support timelines. Always read the support dates in Oracle’s Lifetime Support Policy.
  • Patching tools: OPatch applies patches to the Oracle home; datapatch applies SQL changes to the database (run after the binaries are patched and the database is open). AutoUpgrade (a single Java tool) analyses, fixes, upgrades and patches databases, and is the recommended path for upgrades.
  • Out-of-place patching: install the new Oracle home next to the old, switch the database over, and keep the old home for rollback. Preferred over in-place.
  • Rolling patching with RAC (oracle-rac) or Data Guard standby-first (oracle-data-guard) minimises downtime.
  • COMPATIBLE parameter: once raised it cannot be lowered; raise it only after the upgrade is proven (the test database had compatible = 23.6.0). OPTIMIZER_FEATURES_ENABLE can pin older optimizer behaviour temporarily.
  • Multitenant upgrades: the CDB is upgraded, PDBs are upgraded with it or moved by unplug/plug into a newer CDB (oracle-multitenant).

Worked example

An upgrade outline using AutoUpgrade (from documentation, not executed; the slim container lacks datapatch):

java -jar autoupgrade.jar -config prod.cfg -mode analyze    # pre-checks and fixups report
java -jar autoupgrade.jar -config prod.cfg -mode deploy     # backup point, upgrade, post-steps

Checking the patch level afterwards:

SELECT patch_id, action, status, description FROM dba_registry_sqlpatch ORDER BY action_time DESC;
SELECT banner_full FROM v$version;

Protect plan quality: before upgrading capture plans into SQL Plan Management baselines (or SQL Tuning Sets), then compare after (oracle-execution-plans).

Pitfalls and production notes

  • Test the whole stack: application, drivers (JDBC, ODP.NET), and the optimizer on production-sized data.
  • Take backups and a guaranteed restore point before upgrading (oracle-flashback, oracle-rman-backup).
  • Keep patching cadence regular; unpatched databases accumulate known vulnerabilities.
  • Document the order: backup, binaries, datapatch, utlrp.sql to recompile invalid objects, statistics.
  • Compare with SQL Server compatibility levels (sqlserver-upgrades-compat) and PostgreSQL major upgrades with pg_upgrade or logical replication (pg-replication-failover).

Practice questions

  1. Why is out-of-place patching safer than in-place?
  2. What is datapatch for?
  3. Why can you not lower COMPATIBLE after the upgrade?

References

  • Oracle Database Upgrade Guide; AutoUpgrade documentation; Oracle Lifetime Support Policy

oracle-optimizer-statistics · oracle-multitenant · oracle-data-guard · sqlserver-upgrades-compat