Major Version Oracle Fleet Upgrades: Wrapping AutoUpgrade in Temporal State Machines
A major version Oracle fleet upgrade is a distributed state machine, and executing autoupgrade.jar across 3,000 databases from terminal sessions turns the DBA team into an unscalable coordination layer.
TL;DR
- Problem:
autoupgrade.jarautomates single-host 19c-to-26ai dictionary upgrades, but lacks fleet-wide pre-check aggregation, systemic failure halts, storage-domain concurrency limits, and unattended parallel flashback rollback.- Answer: Keep
autoupgrade.jaras the local execution engine on each host and wrap it in a Temporal workflow control plane that parsesstatus.json, gates rollouts on<10%systemic errors, caps concurrent upgrades per storage cluster, and automates Guaranteed Restore Point (GRP) flashback on failure.- Watch out: Non-CDB databases are desupported in Oracle AI Database 26ai, so any 19c non-CDB must convert to a PDB during the upgrade, and AutoUpgrade requires a matching Java 11 runtime plus updated OEM/RMAN
$ORACLE_HOMEpaths afterward.
Situation
Under Oracle’s Lifetime Support Policy (MOS Doc ID 742060.1), Oracle Database 19c Premier Support runs through December 31, 2029, with Extended Support running from January 1, 2030 through December 31, 2032. Moving a multi-thousand-database estate from 19c to Oracle AI Database 26ai is a multi-year engineering program, and starting in 26ai, traditional manual upgrade scripts (catctl.pl / DBUA-style manual paths) are desupported in favor of autoupgrade.jar.
Oracle’s autoupgrade.jar is the right local engine: it runs analyze pre-checks, executes fixups, creates Guaranteed Restore Points (restoration=yes), upgrades the data dictionary, converts non-CDBs to PDBs, and emits machine-readable JSON status files. Where it stops is the fleet boundary. Each invocation manages the databases listed in its local configuration file on that host or reachable SSH targets, leaving cross-fleet aggregation, global halt thresholds, storage-domain throttling, and post-upgrade OEM/RMAN reconfiguration to external orchestration.
The Problem
At 3,000 databases, manual or ad-hoc scripted coordination breaks on four explicit operational constraints.
1. Maintenance-window concurrency math. Assume an average end-to-end major version upgrade—pre-checks, GRP creation, dictionary compilation, utlrp.sql recompilation, and smoke tests—takes 2.0 hours per database. Upgrading 3,000 databases serially consumes 6,000 database-hours. Even if an enterprise schedules 12 quarterly 8-hour maintenance windows (96 total window hours), finishing the fleet requires 6,000 / 96 = 62.5 databases upgraded concurrently in every single window—and closer to 100 concurrent jobs if you account for soak time and rollbacks. Human operators watching SSH terminals saturate well before 10 concurrent sessions per DBA.
2. Systemic pre-check blind spots. If 800 of 3,000 databases fail analyze due to a shared blocker—such as deprecated CTXSYS (Oracle Text) objects or an undersized SYSTEM tablespace—per-host text logs obscure the fleet-wide pattern. Without central JSON aggregation, teams discover the systemic defect piecemeal during live maintenance windows instead of halting early and shipping one automated pre-fixup.
3. Fast Recovery Area (FRA) headroom for GRPs. A Guaranteed Restore Point (CREATE RESTORE POINT ... GUARANTEE FLASHBACK DATABASE) does not require ALTER DATABASE FLASHBACK ON beforehand, but it does require ARCHIVELOG mode and a configured FRA (DB_RECOVERY_FILE_DEST) large enough to retain flashback logs plus archived redo for the entire upgrade and soak window. If a busy OLTP primary generates 50 MB/s of redo during dictionary upgrade or post-upgrade soak, 8 hours of retention consumes 50 * 3600 * 8 / 1024 = 1,406 GB of FRA space. Filling the FRA to 100% stalls the database mid-upgrade.
4. Shared storage I/O and post-upgrade path drift. Running 50 concurrent dictionary upgrades on a single shared NFS or SAN storage pod saturates IOPS and stalls every database in that pod. Furthermore, autoupgrade.jar updates oratab and the database home, but leaves systemd units, OEM agent target properties, and RMAN catalog scripts pointing at the old 19c $ORACLE_HOME.
How do you coordinate 3,000 autoupgrade.jar executions across bounded maintenance windows with systemic failure halts, per-storage concurrency caps, and automated GRP flashback rollback?
Options Considered
| Approach | Fleet Size Viable | Durable State | Systemic Halt | Why Chosen or Rejected |
|---|---|---|---|---|
Manual autoupgrade.jar via SSH | <50 databases | None (local terminal) | None | Rejected — saturates DBA headcount and misses systemic failures |
| Ansible playbooks calling AutoUpgrade | <500 databases | Lost if control node crashes | Basic play failure count | Rejected — weak mid-upgrade state recovery and no per-pod semaphores |
| Temporal workflow + host agent | >1,000 databases | Durable event history | Global JSON aggregation | Chosen — survives coordinator restarts and enforces phase gates |
| OCI / Autonomous managed upgrades | Cloud-only subset | Vendor-managed | Vendor-managed | Rejected for fleet — does not cover on-premises or self-managed VMs |
Ansible works well for stateless configuration pushes, but a 2-to-4-hour database upgrade is a long-running stateful workflow. If the Ansible controller restarts mid-play, recovering which of 500 databases are in analyze, deploy, or flashback requires brittle idempotency scripts and manual inventory reconciliation. Temporal persists every activity transition in durable event history, supports per-storage-domain task queues or rate limits, and pauses cleanly at human approval gates without holding open SSH connections. Direct SSH with autoupgrade.jar fails for the opposite reason: while AutoUpgrade supports multi-database configs on a single host or over SSH, it does not aggregate findings across thousands of independent hosts, enforce storage-cluster concurrency semaphores, or orchestrate external OEM and RMAN updates. Cloud-managed upgrades handle the control plane automatically on OCI Autonomous Database or Exadata Cloud Service, but leave on-premises and self-managed VM estates uncovered.
The AutoUpgrade Fleet Orchestration Architecture
The architecture keeps autoupgrade.jar untouched as the local database upgrade engine while placing Temporal above it as the global state machine. A lightweight host agent (Go or Python systemd service) translates Temporal activities into autoupgrade.jar invocations, reads AutoUpgrade’s structured JSON output, and handles surrounding OS/OEM/RMAN updates.
flowchart TD
A[Fleet Upgrade Catalog — 3000 DBs targeting 26ai] --> B[Temporal Control Plane — durable orchestrator]
B --> C[Phase 1 — Analyze across fleet]
C --> D{Systemic check — more than 10pct failed?}
D -->|Yes — halt wave| E[Platform team ships global fixup]
D -->|No — proceed| F[Phase 2 — Fixups and FRA pre-flight]
F --> G[Phase 3 — Batched deploy max 20 per storage pod]
G --> H{Upgrade exit and V$INSTANCE check}
H -->|Pass| I[Phase 4 — Update OEM RMAN and drop GRP]
H -->|Fail or timeout| J[Automated GRP flashback to 19c]
AutoUpgrade configuration and structured JSON parsing. AutoUpgrade configuration files use key-value property syntax (global.* and <prefix>.*), not INI section brackets. The host agent writes a clean config per database, invokes autoupgrade.jar with -mode analyze -noconsole using Java 11 (bundled in Oracle 26ai homes), and reads status.json from <global.autoupg_log_dir>/cfgtoollogs/upgrade/auto/status/status.json:
import json
import subprocess
from pathlib import Path
AUTOUPGRADE_JAR = "/u01/app/oracle/product/autoupgrade/autoupgrade.jar"
LOG_DIR = "/u01/autoupgrade_logs"
def write_autoupgrade_config(db_sid: str, source_home: str, target_home: str) -> Path:
cfg = (
f"global.autoupg_log_dir={LOG_DIR}\n"
f"upg1.sid={db_sid}\n"
f"upg1.source_home={source_home}\n"
f"upg1.target_home={target_home}\n"
f"upg1.start_time=NOW\n"
)
cfg_path = Path(f"/tmp/autoupgrade_{db_sid}.cfg")
cfg_path.write_text(cfg)
return cfg_path
def run_analyze(db_sid: str, source_home: str, target_home: str) -> dict:
cfg_path = write_autoupgrade_config(db_sid, source_home, target_home)
proc = subprocess.run(
["java", "-jar", AUTOUPGRADE_JAR, "-config", str(cfg_path), "-mode", "analyze", "-noconsole"],
capture_output=True, text=True, timeout=1800,
)
status_path = Path(LOG_DIR) / "cfgtoollogs" / "upgrade" / "auto" / "status" / "status.json"
if status_path.exists():
data = json.loads(status_path.read_text())
return {"db_sid": db_sid, "returncode": proc.returncode, "status": data}
return {"db_sid": db_sid, "returncode": proc.returncode, "stderr": proc.stderr[:500]}
Temporal workflow with systemic halt and storage-pod batching. Temporal runs analyze across the catalog first, halts automatically if more than 10% of databases report blocking findings, and schedules deploy activities onto per-storage-cluster task queues capped at 20 concurrent upgrades:
from datetime import timedelta
import asyncio
from temporalio import workflow
@workflow.defn
class FleetUpgradeWorkflow:
@workflow.run
async def run(self, db_specs: list[dict], target_home: str) -> dict:
analyze_results = await asyncio.gather(*[
workflow.execute_activity(
"analyze_database",
args=[spec["sid"], spec["source_home"], target_home],
start_to_close_timeout=timedelta(minutes=45),
)
for spec in db_specs
])
failed = [r for r in analyze_results if r["returncode"] != 0]
if len(failed) / max(len(analyze_results), 1) > 0.10:
return {"halted": True, "failed_count": len(failed)}
for i in range(0, len(db_specs), 50):
wave = db_specs[i : i + 50]
await asyncio.gather(*[
workflow.execute_activity(
"deploy_with_grp_rollback",
args=[spec["sid"], spec["source_home"], target_home],
task_queue=f"storage-pod-{spec['storage_pod']}",
start_to_close_timeout=timedelta(hours=6),
)
for spec in wave
], return_exceptions=True)
return {"halted": False, "waves_completed": (len(db_specs) + 49) // 50}
FRA pre-flight and automated GRP flashback. Before deploy starts, the host agent checks V$RECOVERY_FILE_DEST and recent redo volume in V$ARCHIVED_LOG. If fra_free_gb is below 8 hours of peak redo, the database is marked BLOCKED_FRA_INSUFFICIENT and skipped. Because AutoUpgrade creates a Guaranteed Restore Point by default (restoration=yes), or the wrapper creates a named GRP in ARCHIVELOG mode, an unattended non-zero exit triggers immediate flashback via standard sqlplus heredoc (never sqlplus -e, which is not a valid flag):
SELECT ROUND(space_limit / 1024 / 1024 / 1024, 1) AS fra_total_gb,
ROUND((space_limit - space_used) / 1024 / 1024 / 1024, 1) AS fra_free_gb
FROM v$recovery_file_dest;
if [[ $UPGRADE_EXIT -ne 0 ]]; then
sqlplus -S / as sysdba <<EOF
SHUTDOWN ABORT;
STARTUP MOUNT;
FLASHBACK DATABASE TO RESTORE POINT ${GRP_NAME};
ALTER DATABASE OPEN RESETLOGS;
DROP RESTORE POINT ${GRP_NAME};
EXIT;
EOF
fi
Idempotency, non-CDB conversion, and ancillary reconfiguration. Two details determine whether an automated wave survives partial failures. First, every deploy activity must begin by querying SELECT version FROM v$instance before invoking autoupgrade.jar. If a network partition drops the activity completion signal after the database has already opened on 26ai, Temporal retries the activity; checking V$INSTANCE prevents autoupgrade.jar from failing with a version mismatch on an already-upgraded instance. Second, for legacy 19c non-CDB databases, the host agent sets upg1.target_cdb=<cdb_sid> in the AutoUpgrade configuration so AutoUpgrade converts the non-CDB into a Pluggable Database inside the 26ai CDB in the same workflow rather than leaving an unsupported architecture behind. Finally, after autoupgrade.jar returns zero, a separate post-upgrade activity updates /etc/oratab, systemd unit Environment=ORACLE_HOME=... overrides, OEM agent target properties via the OEM REST API, and RMAN catalog scripts so nightly Level 1 backups and monitoring probes do not fail against the retired 19c home.
How It Rolls Out
A 3,000-database upgrade factory rolls out in four gated phases so that systemic defects are caught before any production downtime window opens.
Phase 1: Fleet-wide Analyze and FRA Audit. Run autoupgrade.jar -mode analyze -noconsole and the V$RECOVERY_FILE_DEST check across all 3,000 databases online with zero downtime. The Temporal aggregator groups findings by AutoUpgrade check name (for example, INVALID_OBJECTS_EXIST or TABLESPACE_AUTOEXTEND) so platform engineers see whether an error affects 3 databases or 800. Gate: <10% systemic blockers and every target database passes 8-hour FRA headroom. Rollback: none needed; read-only phase.
Phase 2: Automated Fixups and Non-CDB Conversion Prep. Execute -mode fixups to clear stale invalid objects, purge recyclebin, and gather dictionary statistics; flag any remaining 19c non-CDBs for target CDB PDB conversion (since non-CDB is desupported in Oracle 26ai) and pre-provision the target 26ai $ORACLE_HOME binaries on every host. Gate: 0 unresolved ERROR-severity findings in status.json and verified JRE 11 availability in the target home. Rollback: re-run pre-checks after manual DBA remediation.
Phase 3: Wave-Gated Deploy with Storage Caps. Execute -mode deploy in waves of 50 databases, throttled by Temporal worker max_concurrent_activities=20 per storage pod so shared SAN or NFS arrays never hit queue saturation. The host agent polls V$RECOVERY_FILE_DEST every 5 minutes during dictionary compilation and triggers automated cloud volume expansion if FRA usage crosses 80%. Gate: V$INSTANCE.VERSION matches target 26ai and DBA_REGISTRY components are VALID. Rollback: non-zero exit, 90% FRA critical threshold, or activity timeout triggers automated FLASHBACK DATABASE TO RESTORE POINT to restore 19c within minutes.
Phase 4: Ancillary Reconfiguration and GRP Drop. Update OEM agent target $ORACLE_HOME properties, RMAN catalog scripts, and systemd units, run application smoke queries, and drop the GRP only after a 24-hour soak window so FRA space is reclaimed safely. Keeping the Guaranteed Restore Point active during that 24-hour window gives application owners a deterministic rollback path if subtle execution-plan regressions surface under morning batch or OLTP peak traffic, though monitoring V$RECOVERY_FILE_DEST remains mandatory until DROP RESTORE POINT runs. Gate: 100% OEM target green status, zero ORA-00600/ORA-07445 alert log entries during soak, and successful RMAN Level 1 backup under the 26ai home. Rollback: keep the GRP active until the 24-hour soak clears; after dropping the GRP, rollback requires RMAN restore.
In Practice
- Oracle 26ai AutoUpgrade mandate (Pattern A): Per Oracle Database 26ai Upgrade documentation, manual upgrade scripts are desupported in 26ai and
autoupgrade.jaris the required upgrade mechanism; non-CDB architecture is also desupported, requiring 19c non-CDBs to convert to PDBs during upgrade. - AutoUpgrade Java 11 requirement (Pattern A): Per Oracle’s AutoUpgrade documentation,
autoupgrade.jaris compiled with Java 11 and Oracle 26ai homes bundle JRE 11, avoiding older JDK mismatches when invoked from the target home. - Guaranteed Restore Point behavior without
FLASHBACK ON(Pattern B): Per Oracle Database Backup and Recovery documentation,CREATE RESTORE POINT ... GUARANTEE FLASHBACK DATABASEsucceeds inARCHIVELOGmode with a configured FRA even whenV$DATABASE.FLASHBACK_ONisNO; Oracle writes only the flashback logs needed to rewind to that point. - Temporal durable execution (Pattern B): Temporal worker task queues naturally isolate storage domains: assigning one task queue per storage pod with
max_concurrent_activities=20prevents 50 parallel dictionary upgrades from saturating shared SAN/NFS bandwidth, and survives orchestrator restarts without losing per-database state.
Where It Breaks
| Failure Mode | Breaks How | Detect | Mitigate |
|---|---|---|---|
| FRA exhaustion mid-upgrade | Heavy redo fills FRA past 95% while GRP retains flashback logs; upgrade hangs | Poll V$RECOVERY_FILE_DEST every 5 min; alert at 80% used | Auto-expand FRA via cloud storage API at 80%; abort and flashback at 90% |
| Activity retry after network drop | Upgrade finishes on host, network drops ack, Temporal retries deploy on 26ai DB | Agent checks SELECT version FROM v$instance before running JAR | Return idempotent success if V$INSTANCE is already at target 26ai version |
status.json schema drift | Newer autoupgrade.jar release changes JSON keys; parser misclassifies success | CI contract test runs parser against pinned JAR sample outputs | Pin autoupgrade.jar SHA-256 in host image; version the parser schema |
| Storage pod I/O saturation | 50 parallel dictionary upgrades on one storage array spike db file sequential read | Storage latency >20ms or Temporal activity duration >2x baseline | Cap Temporal worker concurrency at 20 per storage pod task queue |
$ORACLE_HOME path drift | Post-upgrade OEM agents and RMAN scripts still reference 19c home path | OEM target down alert or first post-upgrade RMAN backup failure | Run Phase 4 OEM/RMAN reconfiguration and test Level 1 backup before closing wave |
| Non-CDB conversion skipped | Legacy 19c non-CDB attempts direct upgrade to 26ai where non-CDB is desupported | analyze flags non-CDB target incompatibility | Configure upg1.target_cdb in AutoUpgrade config to convert non-CDB to PDB |
Key Takeaways
- Do not replace
autoupgrade.jar—orchestrate it: AutoUpgrade handles dictionary upgrades, fixups, and GRPs reliably on one host; Temporal adds the global state machine,status.jsonaggregation, and storage-pod throttling needed at 3,000-database scale. - Size the FRA for peak redo plus soak time: A Guaranteed Restore Point works without
FLASHBACK ON, but requiresARCHIVELOGmode and enough FRA headroom to hold 8+ hours of redo until the post-upgrade soak clears and the GRP is dropped. - Plan non-CDB-to-PDB conversion in the same workflow: Non-CDB architecture and manual upgrade scripts are desupported in Oracle AI Database 26ai, making AutoUpgrade’s PDB conversion path mandatory for legacy 19c non-CDBs.
- Make host activities idempotent on
V$INSTANCE: Temporal retries after transient network drops must inspectV$INSTANCE.VERSIONbefore invokingautoupgrade.jarso an already-upgraded database is never re-submitted. - Include OEM, RMAN, and systemd in the definition of done: An upgrade is incomplete until monitoring targets and backup catalogs reflect the new 26ai
$ORACLE_HOME.
What to Do Next
- Problem: Executing
autoupgrade.jarmanually across thousands of Oracle 19c databases fails on coordination math, hidden systemic pre-check blockers, and slow manual flashback recovery. - Solution: Wrap host-local
autoupgrade.jaragents in a Temporal workflow control plane that aggregatesstatus.json, halts on>10%systemic errors, caps concurrency per storage pod, and automates GRP flashback. - Proof: Verify
autoupgrade.jar -mode analyze -noconsoleproduces parseablestatus.jsonundercfgtoollogs/upgrade/auto/status/, and test a simulated non-zero exit to confirmFLASHBACK DATABASE TO RESTORE POINTrestores 19c cleanly. - Action: Run
java -jar autoupgrade.jar -create_sample_file configand-mode analyze -noconsoleon one staging 19c database this week, inspectstatus.json, and validate your FRA sizing query againstV$RECOVERY_FILE_DEST.
Sources
- Oracle Lifetime Support Policy — Oracle Database 19c Support Dates (MOS Doc ID 742060.1): https://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf
- Oracle Database Upgrade Guide — AutoUpgrade Command-Line Parameters and Options: https://docs.oracle.com/en/database/oracle/oracle-database/21/upgrd/autoupgrade-command-line-parameters-and-options.html
- Oracle Database Backup and Recovery User’s Guide — Guaranteed Restore Points: https://docs.oracle.com/en/database/oracle/oracle-database/19/bradv/using-flasback-database-restore-points.html
- Oracle Database Reference —
V$RECOVERY_FILE_DEST: https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/V-RECOVERY_FILE_DEST.html - Oracle Database 23ai/26ai Upgrade Release Notes — AutoUpgrade & Non-CDB Desupport: https://docs.oracle.com/en/database/oracle/oracle-database/23/upgrd/oracle-database-release-notes.html
- Temporal Documentation — Durable Execution and Activities: https://docs.temporal.io/concepts/what-is-an-activity
Interactive tools for this topic