apps-dba journal

A working journal for Oracle DBAs.

October 27, 2026

Oracle DBA Lesson 82 Part 1 — Identify Exactly What Will Be Patched

A useful patch baseline links a running database to its actual Oracle home, records the patches installed in that home, and captures SQL patch and component state in every relevant container. This lets an administrator detect an incomplete earlier patch or a wrong-home assumption before planning another change.

Oracle DBA Lesson 82 Part 1 — Identify Exactly What Will Be Patched

Map the database to its Oracle home

An Oracle home is a directory tree containing an installation of Oracle software. One host can contain several homes, and several databases can use the same home. A software change to a shared home needs a scope that includes every database and service that uses it.

Establish the running database's home from the deployment's service or resource configuration and the maintained inventory. Verify that mapping against the running environment. The shell's PATH, a client executable, or an unverified ORACLE_HOME value can refer to another installation.

The database runs from Home A, /opt/oracle/dbhome_a. Home B is another installation. Set the shell to the verified home with the site's procedure before running that home's inspection tools. See running OPatch from the appropriate Oracle home.

Check the software inventory

"$ORACLE_HOME/OPatch/opatch" version
"$ORACLE_HOME/OPatch/opatch" lsinventory
CommandUseful resultInterpretation
opatch versionOPatch utility versionCompare this with the selected patch's required tool version
opatch lsinventoryReported Oracle home, installed products and patchesRetain patch IDs, descriptions and the home identity

Home A reports this inventory:

Inventory fieldValue
Oracle Home/opt/oracle/dbhome_a
Patch ID98765432
DescriptionDatabase Release Update

Capture the complete inventory, including existing one-offs, rather than keeping only the RU description. Record any inventory error and resolve it before planning an apply operation. Inventory inspection can create OPatch diagnostic logs. It does not apply or remove database patches.

Also capture the database banner:

SELECT banner_full FROM v$version;

BANNER_FULL supplies the full database version banner. Retain it with the detailed binary inventory and the SQL patch records. The OPatch tool version and the database software version describe different components. See OPatch syntax and commands and V$VERSION and BANNER_FULL.

Read the SQL patch state

Some database patches include SQL scripts that must update objects inside the database. Datapatch performs the required SQL actions and updates DBA_REGISTRY_SQLPATCH. Each row describes an apply or rollback attempt for a patch. The view is a history of attempts.

The binary inventory describes installed software in a home. SQL patch records describe SQL work in the queried database container. Name the intended container before reading its dictionary:

SHOW CON_NAME

SELECT patch_id, action, status, action_time,
       description, logfile
FROM dba_registry_sqlpatch
ORDER BY action_time;

SHOW CON_NAME is a SQL*Plus command. Repeat the inspection in each relevant container, or use a correctly scoped CDB-wide collection with verified container visibility. This lesson uses per-container collection so the scope stays explicit.

FieldMeaning and action
PATCH_IDPatch identifier; reconcile it with the intended patch set and home inventory
ACTIONAPPLY or ROLLBACK, identifying the attempted operation
STATUSSUCCESS means the attempt completed without errors; WITH ERRORS requires investigation
ACTION_TIMEWhen the attempt occurred; read the sequence in time order
DESCRIPTIONPatch description from OPatch metadata
LOGFILELog for that apply or rollback attempt; inspect it when interpreting a failure

One old success row is not enough. The root history for patch 98765432 is:

PATCH_IDACTIONSTATUSACTION_TIME
98765432APPLYSUCCESS22-OCT 08:00
98765432ROLLBACKSUCCESS22-OCT 08:30
98765432APPLYSUCCESS22-OCT 09:00

The latest relevant attempt here is the successful apply at 09:00. Retain the complete history and compare applicable patch IDs, actions, logs, and current binary state. A simple “last row” rule across the entire view can overlook other relevant patches. If more detail is needed, retain INSTALL_ID, PATCH_UID, source and target versions, and the associated logs as well.

Do not modify registry rows to make them appear successful. Investigate the failure and use the supported patching procedure to correct the underlying state. See DBA_REGISTRY_SQLPATCH.

Check container coverage

When the home's binary inventory contains patch 98765432, separate inspections can produce this summary:

ContainerLatest relevant actionStatus
CDB$ROOTAPPLYSUCCESS
SHOPAPPLYSUCCESS
REPORTINGAPPLYWITH ERRORS

SHOP and REPORTING are application PDBs. This summary is assembled from separate container inspections. It is not the direct output of the preceding query.

The reporting PDB has an unresolved SQL patch failure. Collect its log and investigate that attempt before rehearsing another change. Record the exact container and patch involved. For a patch that requires SQL actions, include any closed or skipped PDB whose work was deferred and plan its supported completion. Datapatch needs the required PDBs open in the mode specified by the applicable procedure. Opening a PDB or running datapatch is a separate change from recording this baseline.

Inventory the required root, seed handling, and application PDB coverage according to the selected procedure. Preserve each container's identity and collection time. A missing SQL row may mean the patch has no SQL actions, the work was deferred, the wrong scope was queried, or the operation is incomplete. Determine which condition applies from the README and the logs. See Datapatch troubleshooting and open PDB requirements.

Capture database component state

SELECT comp_id, version, status
FROM dba_registry
ORDER BY comp_id;
COMP_IDVERSIONSTATUS
CATALOG19.0.0.0.0VALID
CATPROC19.0.0.0.0VALID

CATALOG identifies the catalog component, and CATPROC identifies the PL/SQL packages and types component. The registry records separately loadable components, their versions, and statuses. Save these results in the relevant containers so later changes can be compared with the baseline. A pre-existing component problem needs an owner and a disposition before the change. A newly introduced problem needs investigation against this baseline.

Component version and status fields serve component inspection. Use the binary inventory and SQL patch history to reconcile the patch set. Retain VERSION_FULL when the component's full version is relevant. See DBA_REGISTRY.

Define the proposed change

ChangeMeaning
Release Update (RU)A bundle of fixes within a database release
One-off/interim patchA fix for a particular issue, product version and platform
Oracle-home switchChange the software installation used to run the database; the base release can remain the same
Release upgradeMove the database to a newer release using a supported upgrade path

An out-of-place patch commonly uses another home at the intended patch level. The home switch and the release change are separate properties of the plan. Select the supported tool and deployment procedure for the actual release, topology, and package. These inspection commands do not prescribe a universal opatch apply sequence. See Oracle Database patch maintenance and choosing a new Oracle home location.

Record the patch-specific preflight

Use the exact patch package's README and the applicable support and certification material. Do not label a fixed historical RU as permanently “latest.”

Planning itemEvidence needed before rehearsal
Exact targetPatch ID, target RU/release, platform and README revision
Supported pathApplicable source/target combination and certification
DependenciesOS, Grid Infrastructure and other topology requirements
Patching utilityRequired OPatch/tool version compared with the actual version
Existing fixesDocumented prerequisite and conflict checks against the current inventory
Space and outageSoftware, staging/working space, time window and affected services
RecoverabilityTested database/home recovery resources and patch-specific rollback route
Container stateScope, SQL patch attempts, component state and deferred work

Keep the baseline and the intended target in the same record. Resolve the REPORTING failure from its log and the supported procedure, then reassess readiness. Applying binaries, completing SQL patch actions, abort decisions, and fallback execution belong to the later rehearsal.

Recap

Record the verified Oracle home, the OPatch inventory, the full version banner, SQL patch history in every relevant container, and component status. Read the latest relevant action together with the full history. Resolve a container that shows WITH ERRORS, such as REPORTING, before treating the target patch, platform, README, prerequisites, and recovery route as ready.

Quiz

1. What does opatch version identify?

2. A binary patch is listed for Home A. What SQL-side verification is needed for a patch with SQL actions?

3. An apply succeeded at 08:00 and a rollback succeeded at 08:30 for the same patch. Which interpretation follows?

4. Root and SHOP show success, while REPORTING shows WITH ERRORS. What should happen before another change rehearsal?

5. What information makes a target patch plan reproducible?

No comments:

Post a Comment

Oracle DBA Lesson 82 Part 3 — Treat an Upgrade as an Application Change

A release upgrade is accepted when the database is healthy, the application produces the required results, and the recovery choices are...